From patchwork Fri Jul 28 18:20:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kaher X-Patchwork-Id: 13332263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7E05C41513 for ; Fri, 28 Jul 2023 18:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236028AbjG1SVZ (ORCPT ); Fri, 28 Jul 2023 14:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230297AbjG1SVY (ORCPT ); Fri, 28 Jul 2023 14:21:24 -0400 Received: from CY4PR02CU008.outbound.protection.outlook.com (mail-westcentralusazon11012009.outbound.protection.outlook.com [40.93.200.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B29524231; Fri, 28 Jul 2023 11:21:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XohoCRtL+38tQk9AYkVGqYnjM8JNCACf2SgVf5VF2+7UedQAMOjmoo+r45l8QlWdfZ/owOxcDT16RTrQr68F86iAuK5iNQX5naNle/MljQEcpe54XVGgZXtAlOjhymMdrjkA6o1uTsHrbBWF3CpvblE/kQcpSSjgtRHe3yC0FffhgeHzAUPR9TsLleC9lsvzHKvNGkM0i87LHzVBMsptdnWf7nSpSy2eSKoJqXgtpd82GhTn56En1/xyV11ipijpHR0TeDQsQwfQsI7Dzh8X1H/YNxrHOYfqGcOemwQOZHu10F6S+WnkAyG9ombUZVTDCjedtzvPlOO5OtfTV7arvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RAWB6Lwkx0Qz1vK54TInJoGKBquAr68J0ferQze2GIg=; b=myngfAiV4Rc4pZj5bOXpQ90ysBXdl5dKMe4csuOi0MSSCozW98H/9cPDVMJjNTN53NZG/dDPpbjzpeJ+w12by39a4Y4wrJ6Sz+3HFEt+y1h6knlrTVK5p8BZPBq8jljZVz4QgACw4Twhwi5oqGs4qHtozeNyuY707QmE/neCtjpky7e9fU60AVr85kNdKxVo9CIjIxKkcWQmhe9RRJPNKyVXeBigZURIOrqlASAwfOX8wMaLgQ/Vmw8SWEuDGXNVM37sbkYq0q+ZB/+Q3Ry2jRR2rXqjpiZO+Ud/TQhzD2qxcZJc8rHCc0uiEGdrvdKRK2U/yGGK7qXtIrGgouGAwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RAWB6Lwkx0Qz1vK54TInJoGKBquAr68J0ferQze2GIg=; b=VRboNx8nvygBo/ikerGJmsF2jVc0TmfhvyglFrThNsOVtcUqW6DeggKNGNAzn6rqjesuYH9HOEZW8S5p4kapFx/KeZiBDRAMA9PIAi14RGJUdiG7q6fpo3RPNcG8dGwAhKdYwXLm7qxjJf8F23hFunWhyS/zQlWIXgrPBrTiL70= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vmware.com; Received: from PH0PR05MB8703.namprd05.prod.outlook.com (2603:10b6:510:bd::5) by SN7PR05MB9264.namprd05.prod.outlook.com (2603:10b6:806:26c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Fri, 28 Jul 2023 18:21:20 +0000 Received: from PH0PR05MB8703.namprd05.prod.outlook.com ([fe80::b5d8:98b9:6ca7:94f0]) by PH0PR05MB8703.namprd05.prod.outlook.com ([fe80::b5d8:98b9:6ca7:94f0%6]) with mapi id 15.20.6631.026; Fri, 28 Jul 2023 18:21:20 +0000 From: Ajay Kaher To: rostedt@goodmis.org, shuah@kernel.org, mhiramat@kernel.org Cc: chinglinyu@google.com, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-trace-kernel@vger.kernel.org, lkp@intel.com, namit@vmware.com, oe-lkp@lists.linux.dev, akaher@vmware.com, amakhalov@vmware.com, er.ajay.kaher@gmail.com, srivatsa@csail.mit.edu, tkundu@vmware.com, vsirnapalli@vmware.com Subject: [PATCH v6 03/10] tracefs: Rename and export some tracefs functions Date: Fri, 28 Jul 2023 23:50:45 +0530 Message-Id: <1690568452-46553-4-git-send-email-akaher@vmware.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1690568452-46553-1-git-send-email-akaher@vmware.com> References: <1690568452-46553-1-git-send-email-akaher@vmware.com> X-ClientProxiedBy: BYAPR11CA0090.namprd11.prod.outlook.com (2603:10b6:a03:f4::31) To PH0PR05MB8703.namprd05.prod.outlook.com (2603:10b6:510:bd::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR05MB8703:EE_|SN7PR05MB9264:EE_ X-MS-Office365-Filtering-Correlation-Id: 82286a59-4c0e-4bff-79ba-08db8f9770c9 X-LD-Processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RedBd62VR+SJxG0p9MGsOgQHh9s3oCA4fhnIldkIWIh37NmpT565U759h1/WW/v3MS8zBdt0RXPk4IBxrWR+/5bh71u4h+FaXL5VBA51Llv5ANn72y3N3aDM6bkYUDPusm6eQ1wr4+rj4yEWdbYwu5k+3345PWNuEXDv65+2qowH0Yh7qH5974B/W9BgDeT7bZT2/NdjYfvMt5bm3UPt9KSd46r0yx9DvCMRWYmIQG02afgeC815KFBE2sp4CvkWrsR2fkxETufw/F94VebkeerZS1qByunO6ruZn/OcPhr5jwtdr/eW7N0faJdJl7lKCdayFrMJAoBAH1YD5e2izJE1wfZouQ+bDLQcsoUF2+XStoJHDve7Osnl/c5hDbzlqhuDts7ylnG4yL71cYyE3AefFC5+CRH7R5OZx60WxYUIwcN6nh6PpwyxF1FkaWbWIBPAyyrEMwzJeBFtVMJH6cDUlXOTuP6qlIVLgiWNoKsSO6mrUXpcloLkLiaMxsSqtp6D0bHhWXRiRkTLDd8SFfMrm7+TPQ6WIPQI8oqKPt5ifWmQVrG17n6llv5M8Owj/Dl5wngmqOUn/nc0HgzkE7j3LzV1fzfDHCjhnDDy11OxTM56Po3n/0dzulEqrxIoooVVjiETKqdds9aV0dER0V7VIhnFzMVq+2x80VZmdes= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR05MB8703.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(376002)(396003)(346002)(136003)(366004)(451199021)(2906002)(316002)(7416002)(8676002)(86362001)(8936002)(41300700001)(36756003)(6512007)(5660300002)(107886003)(26005)(6506007)(6666004)(6486002)(52116002)(83380400001)(478600001)(38350700002)(186003)(38100700002)(4326008)(66556008)(66946007)(66476007)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4d/5YTV4imQ3tM8e5uFvAvnovgBivvo7RzwCZpL991dzYO0xgZTZlU7DhZOL+8r8JOP48ohkpRttTZRpxOmNkPRR8jF+L3T8B9g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tynVRwoKXL64sPaA/zScxTyT+LOPN0/091JOtfrCBLZsRDx1spgTU/mmYg+xiXofUsOb3i/D4799g5t39S8/EVPiTmghPo0wWxmjN3WsKTTPVz2WsXyVB57OU7Qj/9sBmRHZpBOqSO4dK2KiWEFS7FmKMiqEZ/Vf7ZCbJSCGyLiC+sirpzKHf+VKFDjlbx3hvMvw5Rmb/BH96r33HI4n5GRUpuioP4/fWv5cJX/y42fk6wFsMv0SD2FtkniqXS6hJzWwCnROZFk8XiXWTQjEI4VAdv7hGxltO9L38k+StAUcr2JZslX5wg4UNC9PMo9z1MjEmLlekBqiXWGOiXWwf6UdJaxBU2yCKPHAsJ+qeWH4dQKehBuPKthGGKJ1M8TTApn6WRhZVlpUoRmh0Rd2WtXxcvbCEqsCubjh30HFrpKD20NDZeLIV X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82286a59-4c0e-4bff-79ba-08db8f9770c9 X-MS-Exchange-CrossTenant-AuthSource: PH0PR05MB8703.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2023 18:21:19.9660 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fEhTwqO2248S3GWGXaWmMqIj4Ie2bovLz2k2iz9sCc8W9WU9nkn7dcxYtXWYa1w82rr+C6tZCZudcpkawJ9WXA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR05MB9264 Precedence: bulk List-ID: X-Mailing-List: linux-trace-kernel@vger.kernel.org Export a few tracefs functions that will be needed by the eventfs dynamic file system. Rename them to start with "tracefs_" to keep with the name space. start_creating -> tracefs_start_creating failed_creating -> tracefs_failed_creating end_creating -> tracefs_end_creating Signed-off-by: Ajay Kaher Co-developed-by: Steven Rostedt (VMware) Signed-off-by: Steven Rostedt (VMware) Tested-by: Ching-lin Yu --- fs/tracefs/inode.c | 20 ++++++++++---------- fs/tracefs/internal.h | 5 +++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index 2508944cc4d8..4acc4b4dfd22 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -147,7 +147,7 @@ static const struct inode_operations tracefs_dir_inode_operations = { .rmdir = tracefs_syscall_rmdir, }; -static struct inode *tracefs_get_inode(struct super_block *sb) +struct inode *tracefs_get_inode(struct super_block *sb) { struct inode *inode = new_inode(sb); if (inode) { @@ -422,7 +422,7 @@ static struct file_system_type trace_fs_type = { }; MODULE_ALIAS_FS("tracefs"); -static struct dentry *start_creating(const char *name, struct dentry *parent) +struct dentry *tracefs_start_creating(const char *name, struct dentry *parent) { struct dentry *dentry; int error; @@ -460,7 +460,7 @@ static struct dentry *start_creating(const char *name, struct dentry *parent) return dentry; } -static struct dentry *failed_creating(struct dentry *dentry) +struct dentry *tracefs_failed_creating(struct dentry *dentry) { inode_unlock(d_inode(dentry->d_parent)); dput(dentry); @@ -468,7 +468,7 @@ static struct dentry *failed_creating(struct dentry *dentry) return NULL; } -static struct dentry *end_creating(struct dentry *dentry) +struct dentry *tracefs_end_creating(struct dentry *dentry) { inode_unlock(d_inode(dentry->d_parent)); return dentry; @@ -513,14 +513,14 @@ struct dentry *tracefs_create_file(const char *name, umode_t mode, if (!(mode & S_IFMT)) mode |= S_IFREG; BUG_ON(!S_ISREG(mode)); - dentry = start_creating(name, parent); + dentry = tracefs_start_creating(name, parent); if (IS_ERR(dentry)) return NULL; inode = tracefs_get_inode(dentry->d_sb); if (unlikely(!inode)) - return failed_creating(dentry); + return tracefs_failed_creating(dentry); inode->i_mode = mode; inode->i_fop = fops ? fops : &tracefs_file_operations; @@ -529,13 +529,13 @@ struct dentry *tracefs_create_file(const char *name, umode_t mode, inode->i_gid = d_inode(dentry->d_parent)->i_gid; d_instantiate(dentry, inode); fsnotify_create(d_inode(dentry->d_parent), dentry); - return end_creating(dentry); + return tracefs_end_creating(dentry); } static struct dentry *__create_dir(const char *name, struct dentry *parent, const struct inode_operations *ops) { - struct dentry *dentry = start_creating(name, parent); + struct dentry *dentry = tracefs_start_creating(name, parent); struct inode *inode; if (IS_ERR(dentry)) @@ -543,7 +543,7 @@ static struct dentry *__create_dir(const char *name, struct dentry *parent, inode = tracefs_get_inode(dentry->d_sb); if (unlikely(!inode)) - return failed_creating(dentry); + return tracefs_failed_creating(dentry); /* Do not set bits for OTH */ inode->i_mode = S_IFDIR | S_IRWXU | S_IRUSR| S_IRGRP | S_IXUSR | S_IXGRP; @@ -557,7 +557,7 @@ static struct dentry *__create_dir(const char *name, struct dentry *parent, d_instantiate(dentry, inode); inc_nlink(d_inode(dentry->d_parent)); fsnotify_mkdir(d_inode(dentry->d_parent), dentry); - return end_creating(dentry); + return tracefs_end_creating(dentry); } /** diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h index 954ea005632b..7dfb7ebc1c3f 100644 --- a/fs/tracefs/internal.h +++ b/fs/tracefs/internal.h @@ -12,4 +12,9 @@ static inline struct tracefs_inode *get_tracefs(const struct inode *inode) { return container_of(inode, struct tracefs_inode, vfs_inode); } + +struct dentry *tracefs_start_creating(const char *name, struct dentry *parent); +struct dentry *tracefs_end_creating(struct dentry *dentry); +struct dentry *tracefs_failed_creating(struct dentry *dentry); +struct inode *tracefs_get_inode(struct super_block *sb); #endif /* _TRACEFS_INTERNAL_H */