Received: by 10.192.165.148 with SMTP id m20csp938831imm; Wed, 2 May 2018 11:13:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqwcNkb1bx7wvwF11iDm5QXNHcawayurHJjbSh36aT9hW8eKlt3oUphM+gSMBTDmOhO14Cw X-Received: by 2002:a63:7344:: with SMTP id d4-v6mr16594910pgn.273.1525284781576; Wed, 02 May 2018 11:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525284781; cv=none; d=google.com; s=arc-20160816; b=nqQen1Ncua9FW0UqicML//uEaSxqjZxZHtZ+gwr576cmMHdRUrwuKjr0mBHEgeV6gL 89JfyC5yLITcYzbvNZgLqtIDL5Cg4foI5fjbSSsHCAp+nI5O1s775HIgomxN3ybtY817 B7Vlbg3+GX/4xulZvtoBs8r5kf9JilDSBCefZFLsRKiXEnie+65gS9Pkobe4v5R1CJIP 2LJzn6PATrp16C8ZZAO+zHQIfqVA5nBRmWWg7/l/8Q4BMIo8xKQi+iFIQ5Wu/QypCkz1 6JHo4iYPGEHOtE7+0Pr9qZvL+fyDm6RYLAEwHNs72TLZ7+DWWj9f87GmuzM3l0Qs0GyV lBuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=p/91GZnWzQMxM9aJRq9cLwrUEzaKE0jLdoQeNEp4h6I=; b=R7ZVnkamCIXjGNYbjHxL5nBkSoZ5ARs6Nt57Mi7zmS9LLWhIdCRPnWWrnU9Yqm2IG8 zQTfogpxmAskhb11FiK07uGEL+HPotnNJSSEbvfs1115fUl7hKld6FTLk8xCAh0p25Fl r6oyoi+N7DREAcRKtsqF4yruNgDbK395fjhbwboRWGooSGXFjfC3Cm2ynJJlsPc/DQR1 H3DF4Yqg+iPFheUZ3EAGugYYmWsQiYqWldNw7dpgwKGnVuJRmxz+zvCQCU3y1Qi2eLpT gI/zIbIPuQ3M+0aWK+T4nynwdDPsSkiYOGi1eMk/3ybA7TaTFLmOUdcQ86yqOpqdgZbo wjLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=K+Oj/Xoz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p18-v6si1744774pgu.52.2018.05.02.11.12.46; Wed, 02 May 2018 11:13:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=K+Oj/Xoz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751401AbeEBSLq (ORCPT + 99 others); Wed, 2 May 2018 14:11:46 -0400 Received: from casper.infradead.org ([85.118.1.10]:46850 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750965AbeEBSLm (ORCPT ); Wed, 2 May 2018 14:11:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Type:MIME-Version:References: Message-ID:In-Reply-To:Subject:cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=p/91GZnWzQMxM9aJRq9cLwrUEzaKE0jLdoQeNEp4h6I=; b=K+Oj/Xozp5H1KpNKm6psauSwl GtQHCSc1QWQsFtLktXCuWrmrANETBRQRxY67FUmOeK4cz94gx5LLf+L5K/LoIjN0cfaUazobxC0Qw f/hrl1SseeCs1NIHvqy848MG6JtXR3UgkbGZspRFMn3dCD3PJcUqhGPbEWFhrlsSqV7EYmvig54OR 2waKkSFKVj9/TcLOKETrKP7Mws/nKuZDgD1AqNdFWV5t1OOLemh0pGU+YIN6nzVHxUy44UAhFXfsu ricd2MVzxC8vSjAqDYJhuwJKoD6qSloMzPY04u/PK6yVWdwRk9chfRUWf7a6R881t4tD44fYcswTr u5JmTPQqA==; Received: from jsimmons (helo=localhost) by casper.infradead.org with local-esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fDwE1-0000Jp-BN; Wed, 02 May 2018 18:11:34 +0000 Date: Wed, 2 May 2018 19:11:33 +0100 (BST) From: James Simmons To: NeilBrown cc: Oleg Drokin , Greg Kroah-Hartman , Andreas Dilger , Linux Kernel Mailing List , Lustre Development List Subject: Re: [PATCH 01/10] staging: lustre: ldlm: store name directly in namespace. In-Reply-To: <152514675876.17843.12443354625160742215.stgit@noble> Message-ID: References: <152514658325.17843.11455067361317157487.stgit@noble> <152514675876.17843.12443354625160742215.stgit@noble> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180502_191133_377378_C006895D X-CRM114-Status: GOOD ( 20.83 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 NO_RELAYS Informational: message was not relayed via SMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Rather than storing the name of a namespace in the > hash table, store it directly in the namespace. > This will allow the hashtable to be changed to use > rhashtable. > > Signed-off-by: NeilBrown Reviewed-by: James Simmons > --- > drivers/staging/lustre/lustre/include/lustre_dlm.h | 5 ++++- > drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 5 +++++ > 2 files changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h > index d668d86423a4..b3532adac31c 100644 > --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h > +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h > @@ -362,6 +362,9 @@ struct ldlm_namespace { > /** Flag indicating if namespace is on client instead of server */ > enum ldlm_side ns_client; > > + /** name of this namespace */ > + char *ns_name; > + > /** Resource hash table for namespace. */ > struct cfs_hash *ns_rs_hash; > > @@ -878,7 +881,7 @@ static inline bool ldlm_has_layout(struct ldlm_lock *lock) > static inline char * > ldlm_ns_name(struct ldlm_namespace *ns) > { > - return ns->ns_rs_hash->hs_name; > + return ns->ns_name; > } > > static inline struct ldlm_namespace * > diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c > index 6c615b6e9bdc..43bbc5fd94cc 100644 > --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c > +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c > @@ -688,6 +688,9 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name, > ns->ns_obd = obd; > ns->ns_appetite = apt; > ns->ns_client = client; > + ns->ns_name = kstrdup(name, GFP_KERNEL); > + if (!ns->ns_name) > + goto out_hash; > > INIT_LIST_HEAD(&ns->ns_list_chain); > INIT_LIST_HEAD(&ns->ns_unused_list); > @@ -730,6 +733,7 @@ struct ldlm_namespace *ldlm_namespace_new(struct obd_device *obd, char *name, > ldlm_namespace_sysfs_unregister(ns); > ldlm_namespace_cleanup(ns, 0); > out_hash: > + kfree(ns->ns_name); > cfs_hash_putref(ns->ns_rs_hash); > out_ns: > kfree(ns); > @@ -993,6 +997,7 @@ void ldlm_namespace_free_post(struct ldlm_namespace *ns) > ldlm_namespace_debugfs_unregister(ns); > ldlm_namespace_sysfs_unregister(ns); > cfs_hash_putref(ns->ns_rs_hash); > + kfree(ns->ns_name); > /* Namespace \a ns should be not on list at this time, otherwise > * this will cause issues related to using freed \a ns in poold > * thread. > > >