From patchwork Thu Feb 27 21:10:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11409939 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EEB9B138D for ; Thu, 27 Feb 2020 21:26:08 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D55E4246A0 for ; Thu, 27 Feb 2020 21:26:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D55E4246A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 01EB5348FB1; Thu, 27 Feb 2020 13:23:17 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id C298221FB5C for ; Thu, 27 Feb 2020 13:19:01 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id F41151E80; Thu, 27 Feb 2020 16:18:14 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id F2D1A46C; Thu, 27 Feb 2020 16:18:14 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:10:14 -0500 Message-Id: <1582838290-17243-147-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 146/622] lustre: obd: use correct names for conn_uuid 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" The LUSTRE_R[OW]_ATTR() macros assume that the name of the sysfs file to create matches the beginning of the function names. In the case of LUSTRE_RO_ATTR(conn_uuid) this maps to the function conn_uuid_show() and generated sysfs files "conn_uuid". While it makes sense to standardize this interface we need to keep the old xxx_conn_uuid. We can create these xxx_conn_uuid sysfs files by using the base sysfs attr macro LUSTRE_ATTR(). WC-bug-id: https://jira.whamcloud.com/browse/LU-8066 Lustre-commit: f2bf876ef77e ("LU-8066 obd: use correct names for conn_uuid") Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/33213 Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/mdc/lproc_mdc.c | 7 ++++--- fs/lustre/mgc/lproc_mgc.c | 5 +++-- fs/lustre/obdclass/lprocfs_status.c | 24 ------------------------ fs/lustre/osc/lproc_osc.c | 5 +++-- 4 files changed, 10 insertions(+), 31 deletions(-) diff --git a/fs/lustre/mdc/lproc_mdc.c b/fs/lustre/mdc/lproc_mdc.c index 0c52bcf..746dd21 100644 --- a/fs/lustre/mdc/lproc_mdc.c +++ b/fs/lustre/mdc/lproc_mdc.c @@ -303,8 +303,8 @@ static ssize_t max_mod_rpcs_in_flight_store(struct kobject *kobj, LUSTRE_RW_ATTR(max_pages_per_rpc); -#define mdc_conn_uuid_show conn_uuid_show -LUSTRE_RO_ATTR(mdc_conn_uuid); +LUSTRE_ATTR(mds_conn_uuid, 0444, conn_uuid_show, NULL); +LUSTRE_RO_ATTR(conn_uuid); LUSTRE_RO_ATTR(ping); @@ -529,7 +529,8 @@ static ssize_t mdc_dom_min_repsize_seq_write(struct file *file, &lustre_attr_max_rpcs_in_flight.attr, &lustre_attr_max_mod_rpcs_in_flight.attr, &lustre_attr_max_pages_per_rpc.attr, - &lustre_attr_mdc_conn_uuid.attr, + &lustre_attr_mds_conn_uuid.attr, + &lustre_attr_conn_uuid.attr, &lustre_attr_ping.attr, NULL, }; diff --git a/fs/lustre/mgc/lproc_mgc.c b/fs/lustre/mgc/lproc_mgc.c index 4c276f9..676d479 100644 --- a/fs/lustre/mgc/lproc_mgc.c +++ b/fs/lustre/mgc/lproc_mgc.c @@ -66,13 +66,14 @@ struct lprocfs_vars lprocfs_mgc_obd_vars[] = { { NULL } }; -#define mgs_conn_uuid_show conn_uuid_show -LUSTRE_RO_ATTR(mgs_conn_uuid); +LUSTRE_ATTR(mgs_conn_uuid, 0444, conn_uuid_show, NULL); +LUSTRE_RO_ATTR(conn_uuid); LUSTRE_RO_ATTR(ping); static struct attribute *mgc_attrs[] = { &lustre_attr_mgs_conn_uuid.attr, + &lustre_attr_conn_uuid.attr, &lustre_attr_ping.attr, NULL, }; diff --git a/fs/lustre/obdclass/lprocfs_status.c b/fs/lustre/obdclass/lprocfs_status.c index b3dbe85..cce9bec 100644 --- a/fs/lustre/obdclass/lprocfs_status.c +++ b/fs/lustre/obdclass/lprocfs_status.c @@ -524,30 +524,6 @@ int lprocfs_rd_server_uuid(struct seq_file *m, void *data) } EXPORT_SYMBOL(lprocfs_rd_server_uuid); -int lprocfs_rd_conn_uuid(struct seq_file *m, void *data) -{ - struct obd_device *obd = data; - struct ptlrpc_connection *conn; - int rc; - - LASSERT(obd); - - rc = lprocfs_climp_check(obd); - if (rc) - return rc; - - conn = obd->u.cli.cl_import->imp_connection; - if (conn && obd->u.cli.cl_import) - seq_printf(m, "%s\n", conn->c_remote_uuid.uuid); - else - seq_puts(m, "\n"); - - up_read(&obd->u.cli.cl_sem); - - return 0; -} -EXPORT_SYMBOL(lprocfs_rd_conn_uuid); - /** * Lock statistics structure for access, possibly only on this CPU. * diff --git a/fs/lustre/osc/lproc_osc.c b/fs/lustre/osc/lproc_osc.c index f025275..d9030b7 100644 --- a/fs/lustre/osc/lproc_osc.c +++ b/fs/lustre/osc/lproc_osc.c @@ -173,8 +173,8 @@ static ssize_t max_dirty_mb_store(struct kobject *kobj, } LUSTRE_RW_ATTR(max_dirty_mb); -#define ost_conn_uuid_show conn_uuid_show -LUSTRE_RO_ATTR(ost_conn_uuid); +LUSTRE_ATTR(ost_conn_uuid, 0444, conn_uuid_show, NULL); +LUSTRE_RO_ATTR(conn_uuid); LUSTRE_RO_ATTR(ping); @@ -962,6 +962,7 @@ void lproc_osc_attach_seqstat(struct obd_device *dev) &lustre_attr_short_io_bytes.attr, &lustre_attr_resend_count.attr, &lustre_attr_ost_conn_uuid.attr, + &lustre_attr_conn_uuid.attr, &lustre_attr_ping.attr, &lustre_attr_idle_timeout.attr, &lustre_attr_idle_connect.attr,