linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Drokin <green@linuxhacker.ru>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org,
	Andreas Dilger <andreas.dilger@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lustre Development List <lustre-devel@lists.lustre.org>,
	Oleg Drokin <green@linuxhacker.ru>
Subject: [PATCH 03/28] staging/lustre/llite: Get rid of ll_lock_dcache/ll_unlock_dcache
Date: Sun, 19 Jun 2016 22:07:18 -0400	[thread overview]
Message-ID: <1466388463-1817551-4-git-send-email-green@linuxhacker.ru> (raw)
In-Reply-To: <1466388463-1817551-1-git-send-email-green@linuxhacker.ru>

These are just doing spin_lock/unlock on inode's i_lock,
so just do the spinlock directly to make the code more clear

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
 drivers/staging/lustre/lustre/llite/dcache.c         |  4 ++--
 drivers/staging/lustre/lustre/llite/llite_internal.h | 10 ----------
 drivers/staging/lustre/lustre/llite/namei.c          |  8 ++++----
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c
index 9d13d5e..f002b3a 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -249,7 +249,7 @@ void ll_invalidate_aliases(struct inode *inode)
 	CDEBUG(D_INODE, "marking dentries for ino "DFID"(%p) invalid\n",
 	       PFID(ll_inode2fid(inode)), inode);
 
-	ll_lock_dcache(inode);
+	spin_lock(&inode->i_lock);
 	hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
 		CDEBUG(D_DENTRY, "dentry in drop %pd (%p) parent %p inode %p flags %d\n",
 		       dentry, dentry, dentry->d_parent,
@@ -257,7 +257,7 @@ void ll_invalidate_aliases(struct inode *inode)
 
 		d_lustre_invalidate(dentry, 0);
 	}
-	ll_unlock_dcache(inode);
+	spin_unlock(&inode->i_lock);
 }
 
 int ll_revalidate_it_finish(struct ptlrpc_request *request,
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 74cd241..098155f 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -1313,16 +1313,6 @@ static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode,
 		*bits = it->d.lustre.it_lock_bits;
 }
 
-static inline void ll_lock_dcache(struct inode *inode)
-{
-	spin_lock(&inode->i_lock);
-}
-
-static inline void ll_unlock_dcache(struct inode *inode)
-{
-	spin_unlock(&inode->i_lock);
-}
-
 static inline int d_lustre_invalid(const struct dentry *dentry)
 {
 	struct ll_dentry_data *lld = ll_d2d(dentry);
diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c
index 6414d52..e4df510 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -140,7 +140,7 @@ static void ll_invalidate_negative_children(struct inode *dir)
 {
 	struct dentry *dentry, *tmp_subdir;
 
-	ll_lock_dcache(dir);
+	spin_lock(&dir->i_lock);
 	hlist_for_each_entry(dentry, &dir->i_dentry, d_u.d_alias) {
 		spin_lock(&dentry->d_lock);
 		if (!list_empty(&dentry->d_subdirs)) {
@@ -155,7 +155,7 @@ static void ll_invalidate_negative_children(struct inode *dir)
 		}
 		spin_unlock(&dentry->d_lock);
 	}
-	ll_unlock_dcache(dir);
+	spin_unlock(&dir->i_lock);
 }
 
 int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc,
@@ -317,7 +317,7 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry)
 	discon_alias = NULL;
 	invalid_alias = NULL;
 
-	ll_lock_dcache(inode);
+	spin_lock(&inode->i_lock);
 	hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
 		LASSERT(alias != dentry);
 
@@ -342,7 +342,7 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry)
 		dget_dlock(alias);
 		spin_unlock(&alias->d_lock);
 	}
-	ll_unlock_dcache(inode);
+	spin_unlock(&inode->i_lock);
 
 	return alias;
 }
-- 
2.7.4

  parent reply	other threads:[~2016-06-20  3:04 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20  2:07 [PATCH 00/28] Lustre fixes Oleg Drokin
2016-06-20  2:07 ` [PATCH 01/28] staging/lustre/llite: allocate and free client cache asynchronously Oleg Drokin
2016-06-20  2:07 ` [PATCH 02/28] staging/lustre/llite: correct request handling after ll_lookup_it() Oleg Drokin
2016-06-20  2:07 ` Oleg Drokin [this message]
2016-06-20  2:07 ` [PATCH 04/28] staging/lustre/llite: lock i_lock before __d_drop() Oleg Drokin
2016-06-20  2:07 ` [PATCH 05/28] staging/lustre/osc: osc_lock_weight endless loop fix Oleg Drokin
2016-06-20  2:07 ` [PATCH 06/28] staging/lustre/osc: Fix reverted condition in osc_lock_weight Oleg Drokin
2016-06-20  2:07 ` [PATCH 07/28] staging/lustre/ptlrpc: reorganize ptlrpc_request Oleg Drokin
2016-06-20  2:07 ` [PATCH 08/28] staging/lustre/ptlrpc: missing wakeup for ptlrpc_check_set Oleg Drokin
2016-06-20  2:07 ` [PATCH 09/28] staging/lustre/ptlrpc: Early Reply vs Reply MDunlink Oleg Drokin
2016-06-20  2:07 ` [PATCH 10/28] staging/lustre/ptlrpc: Remove __ptlrpc_request_bufs_pack Oleg Drokin
2016-06-20  2:07 ` [PATCH 11/28] staging/lustre/ptlrpc: lost bulk leads to a hang Oleg Drokin
2016-06-20  2:07 ` [PATCH 12/28] staging/lustre/llite: take trunc_sem only at vvp layer Oleg Drokin
2016-06-20  2:07 ` [PATCH 13/28] staging/lustre: LDLM_DEBUG() shouldn't be passed \n Oleg Drokin
2016-06-20  2:07 ` [PATCH 14/28] staging/lustre: Add newline to LU_OBJECT_DEBUG() message Oleg Drokin
2016-06-20  2:07 ` [PATCH 15/28] staging/lustre/llite: flatten struct lookup_intent Oleg Drokin
2016-06-20  2:07 ` [PATCH 16/28] staging/lustre: Inline Lustre intent disposition functions Oleg Drokin
2016-06-20  2:07 ` [PATCH 17/28] staging/lustre/llite: change it_data to it_request Oleg Drokin
2016-06-20  2:07 ` [PATCH 18/28] staging/lustre/ldlm: const qualify struct lustre_handle * params Oleg Drokin
2016-06-20  2:07 ` [PATCH 19/28] staging/lustre/llite: ensure obd is effective in onu_upcall Oleg Drokin
2016-06-20  2:07 ` [PATCH 20/28] staging/lustre/mdc: Zero atime in close RPC Oleg Drokin
2016-06-20  2:07 ` [PATCH 21/28] staging/lustre/o2ib: Don't access NULL NI on failure path Oleg Drokin
2016-06-20  2:07 ` [PATCH 22/28] staging/lustre/llite: don't panic when fid is insane Oleg Drokin
2016-06-20  2:07 ` [PATCH 23/28] staging/lustre/llite: Restore proper opencache operations Oleg Drokin
2016-06-20  2:07 ` [PATCH 24/28] staging/lustre/llite: ll_revalidate_dentry update Oleg Drokin
2016-06-20  2:07 ` [PATCH 25/28] staging/lustre/llite: IOC_MDC_GETFILEINFO returns the wrong ino Oleg Drokin
2016-06-20  2:07 ` [PATCH 26/28] staging/lustre/osc: fix signed one bit field Oleg Drokin
2016-06-20  2:07 ` [PATCH 27/28] staging/lustre: Add documentation for unstable_stats in sysfs Oleg Drokin
2016-06-20  2:07 ` [PATCH 28/28] staging/lustre/osc: glimpse lock should match only with granted locks Oleg Drokin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466388463-1817551-4-git-send-email-green@linuxhacker.ru \
    --to=green@linuxhacker.ru \
    --cc=andreas.dilger@intel.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lustre-devel@lists.lustre.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).