Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162153AbbKFWCm (ORCPT ); Fri, 6 Nov 2015 17:02:42 -0500 Received: from mta01.ornl.gov ([128.219.177.14]:40456 "EHLO mta01.ornl.gov" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030298AbbKFWCl convert rfc822-to-8bit (ORCPT ); Fri, 6 Nov 2015 17:02:41 -0500 X-SG: RELAYLIST X-IronPort-AV: E=Sophos;i="5.20,254,1444708800"; d="scan'208";a="115598551" From: "Simmons, James A." To: "'Shivani Bhardwaj'" , "gregkh@linuxfoundation.org" CC: "oleg.drokin@intel.com" , "devel@driverdev.osuosl.org" , "andreas.dilger@intel.com" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 1/3] Staging: lustre: ldlm_pool: Remove unneeded wrapper function Thread-Topic: [PATCH 1/3] Staging: lustre: ldlm_pool: Remove unneeded wrapper function Thread-Index: AQHRGLq1ovhUILOmi0CvEXimZeb0+p6PjCNQ Date: Fri, 6 Nov 2015 22:02:38 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [128.219.12.132] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4129 Lines: 115 >-----Original Message----- >From: devel [mailto:driverdev-devel-bounces@linuxdriverproject.org] On Behalf Of Shivani Bhardwaj >Sent: Friday, November 06, 2015 12:43 PM >To: gregkh@linuxfoundation.org >Cc: oleg.drokin@intel.com; devel@driverdev.osuosl.org; andreas.dilger@intel.com; linux-kernel@vger.kernel.org >Subject: [PATCH 1/3] Staging: lustre: ldlm_pool: Remove unneeded wrapper function > >Remove the function ldlm_pl2ns() and replace its calls with the function >it wrapped. > >Signed-off-by: Shivani Bhardwaj >--- > drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 25 +++++++++++++------------ > 1 file changed, 13 insertions(+), 12 deletions(-) Acked-by: James Simmons diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index 1a4eef6..2beb36b 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -176,11 +176,6 @@ enum { LDLM_POOL_LAST_STAT }; -static inline struct ldlm_namespace *ldlm_pl2ns(struct ldlm_pool *pl) -{ - return container_of(pl, struct ldlm_namespace, ns_pool); -} - /** * Calculates suggested grant_step in % of available locks for passed * \a period. This is later used in grant_plan calculations. @@ -254,7 +249,8 @@ static void ldlm_pool_recalc_stats(struct ldlm_pool *pl) } /** - * Sets SLV and Limit from ldlm_pl2ns(pl)->ns_obd tp passed \a pl. + * Sets SLV and Limit from container_of(pl, struct ldlm_namespace, + * ns_pool)->ns_obd tp passed \a pl. */ static void ldlm_cli_pool_pop_slv(struct ldlm_pool *pl) { @@ -264,7 +260,8 @@ static void ldlm_cli_pool_pop_slv(struct ldlm_pool *pl) * Get new SLV and Limit from obd which is updated with coming * RPCs. */ - obd = ldlm_pl2ns(pl)->ns_obd; + obd = container_of(pl, struct ldlm_namespace, + ns_pool)->ns_obd; LASSERT(obd != NULL); read_lock(&obd->obd_pool_lock); pl->pl_server_lock_volume = obd->obd_pool_slv; @@ -304,7 +301,8 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl) /* * Do not cancel locks in case lru resize is disabled for this ns. */ - if (!ns_connect_lru_resize(ldlm_pl2ns(pl))) { + if (!ns_connect_lru_resize(container_of(pl, struct ldlm_namespace, + ns_pool))) { ret = 0; goto out; } @@ -315,7 +313,8 @@ static int ldlm_cli_pool_recalc(struct ldlm_pool *pl) * It may be called when SLV has changed much, this is why we do not * take into account pl->pl_recalc_time here. */ - ret = ldlm_cancel_lru(ldlm_pl2ns(pl), 0, LCF_ASYNC, LDLM_CANCEL_LRUR); + ret = ldlm_cancel_lru(container_of(pl, struct ldlm_namespace, ns_pool), + 0, LCF_ASYNC, LDLM_CANCEL_LRUR); out: spin_lock(&pl->pl_lock); @@ -341,7 +340,7 @@ static int ldlm_cli_pool_shrink(struct ldlm_pool *pl, struct ldlm_namespace *ns; int unused; - ns = ldlm_pl2ns(pl); + ns = container_of(pl, struct ldlm_namespace, ns_pool); /* * Do not cancel locks in case lru resize is disabled for this ns. @@ -558,7 +557,8 @@ static struct kobj_type ldlm_pl_ktype = { static int ldlm_pool_sysfs_init(struct ldlm_pool *pl) { - struct ldlm_namespace *ns = ldlm_pl2ns(pl); + struct ldlm_namespace *ns = container_of(pl, struct ldlm_namespace, + ns_pool); int err; init_completion(&pl->pl_kobj_unregister); @@ -570,7 +570,8 @@ static int ldlm_pool_sysfs_init(struct ldlm_pool *pl) static int ldlm_pool_debugfs_init(struct ldlm_pool *pl) { - struct ldlm_namespace *ns = ldlm_pl2ns(pl); + struct ldlm_namespace *ns = container_of(pl, struct ldlm_namespace, + ns_pool); struct dentry *debugfs_ns_parent; struct lprocfs_vars pool_vars[2]; char *var_name = NULL; -- 2.1.0 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/