staging/lustre/llite: Get rid of ll_lock_dcache/ll_unlock_dcache
authorOleg Drokin <green@linuxhacker.ru>
Mon, 20 Jun 2016 20:55:26 +0000 (16:55 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Jun 2016 21:28:39 +0000 (14:28 -0700)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/dcache.c
drivers/staging/lustre/lustre/llite/llite_internal.h
drivers/staging/lustre/lustre/llite/namei.c

index 9d13d5e933bab18b314c20f23a1ebc8ad9c935da..f002b3a6933dd361bfd9ee2a037b712f47a2b376 100644 (file)
@@ -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,
index 657ebd0a2654cb20a8f8d28d27084cd405f759c3..973dcc7521b39aed61126137bedc737b5c6b8d43 100644 (file)
@@ -1229,16 +1229,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);
index 6414d52f44a34d85f5007ede64883070f229c235..e4df5103cd8399cbe77ce7e78d33888ae7cb8b34 100644 (file)
@@ -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;
 }