From patchwork Fri Aug 17 03:10:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 10568411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1AB7B13B6 for ; Fri, 17 Aug 2018 03:12:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05E522886F for ; Fri, 17 Aug 2018 03:12:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC754288D0; Fri, 17 Aug 2018 03:12:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9377F2886F for ; Fri, 17 Aug 2018 03:12:55 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id D20404E20B6; Thu, 16 Aug 2018 20:11:45 -0700 (PDT) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id D05754E1AA4 for ; Thu, 16 Aug 2018 20:10:48 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id C591A100536C; Thu, 16 Aug 2018 23:10:45 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id C2C28465; Thu, 16 Aug 2018 23:10:45 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 16 Aug 2018 23:10:07 -0400 Message-Id: <1534475441-15543-5-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1534475441-15543-1-git-send-email-jsimmons@infradead.org> References: <1534475441-15543-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 04/38] lustre: llite: remove ll_sb X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: James Simmons , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP The only user of ll_sb in struct ll_sb_info is used to query the name locate in the file_system_type. We can get that information from using the super block located in struct path instead. This enables us to use struct ll_sb_info directly for every sysfs or debugfs entry. Signed-off-by: James Simmons WC-bug-id: https://jira.whamcloud.com/browse/LU-8066 Reviewed-on: https://review.whamcloud.com/24031 Reviewed-by: Bobi Jam Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/llite/llite_internal.h | 1 - drivers/staging/lustre/lustre/llite/llite_lib.c | 6 ++---- drivers/staging/lustre/lustre/llite/lproc_llite.c | 3 ++- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index 2719bc53..92dc05d 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -524,7 +524,6 @@ struct ll_sb_info { __kernel_fsid_t ll_fsid; struct kobject ll_kobj; /* sysfs object */ - struct super_block *ll_sb; /* struct super_block (for sysfs code)*/ struct completion ll_kobj_unregister; }; diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index d16f5d1..d352287 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -62,7 +62,7 @@ #define log2(n) ffz(~(n)) #endif -static struct ll_sb_info *ll_init_sbi(struct super_block *sb) +static struct ll_sb_info *ll_init_sbi(void) { struct ll_sb_info *sbi = NULL; unsigned long pages; @@ -129,8 +129,6 @@ static struct ll_sb_info *ll_init_sbi(struct super_block *sb) INIT_LIST_HEAD(&sbi->ll_squash.rsi_nosquash_nids); init_rwsem(&sbi->ll_squash.rsi_sem); - sbi->ll_sb = sb; - return sbi; } @@ -912,7 +910,7 @@ int ll_fill_super(struct super_block *sb) try_module_get(THIS_MODULE); /* client additional sb info */ - sbi = ll_init_sbi(sb); + sbi = ll_init_sbi(); lsi->lsi_llsbi = sbi; if (!sbi) { module_put(THIS_MODULE); diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c index a9ad328..8e418ba 100644 --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c @@ -33,6 +33,7 @@ #define DEBUG_SUBSYSTEM S_LLITE #include +#include #include #include @@ -215,7 +216,7 @@ static ssize_t fstype_show(struct kobject *kobj, struct attribute *attr, struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info, ll_kobj); - return sprintf(buf, "%s\n", sbi->ll_sb->s_type->name); + return sprintf(buf, "%s\n", sbi->ll_mnt.mnt->mnt_sb->s_type->name); } LUSTRE_RO_ATTR(fstype);