Whamcloud - gitweb
LU-6142 llite: ll_lookup_finish_locks clean up 30/40830/3
authorMr NeilBrown <neilb@suse.de>
Thu, 15 Oct 2020 04:10:50 +0000 (15:10 +1100)
committerOleg Drokin <green@whamcloud.com>
Fri, 26 Feb 2021 22:10:44 +0000 (22:10 +0000)
The 'inode' var can be used rather than dereferencing dentry->d_inode
a second time.
Also re-indent the function.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I16fb5480f7e2a8192a82e0c821597e14aad00b40
Reviewed-on: https://review.whamcloud.com/40830
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/dcache.c

index 8de420f..caaacbd 100644 (file)
@@ -258,25 +258,21 @@ int ll_revalidate_it_finish(struct ptlrpc_request *request,
 
 void ll_lookup_finish_locks(struct lookup_intent *it, struct dentry *dentry)
 {
-        LASSERT(it != NULL);
-        LASSERT(dentry != NULL);
+       LASSERT(it != NULL);
+       LASSERT(dentry != NULL);
 
        if (it->it_lock_mode && dentry->d_inode != NULL) {
-                struct inode *inode = dentry->d_inode;
-                struct ll_sb_info *sbi = ll_i2sbi(dentry->d_inode);
+               struct inode *inode = dentry->d_inode;
+               struct ll_sb_info *sbi = ll_i2sbi(inode);
 
                CDEBUG(D_DLMTRACE, "setting l_data to inode "DFID"(%p)\n",
                       PFID(ll_inode2fid(inode)), inode);
-                ll_set_lock_data(sbi->ll_md_exp, inode, it, NULL);
-        }
-
-        /* drop lookup or getattr locks immediately */
-        if (it->it_op == IT_LOOKUP || it->it_op == IT_GETATTR) {
-                /* on 2.6 there are situation when several lookups and
-                 * revalidations may be requested during single operation.
-                 * therefore, we don't release intent here -bzzz */
-                ll_intent_drop_lock(it);
-        }
+               ll_set_lock_data(sbi->ll_md_exp, inode, it, NULL);
+       }
+
+       /* drop lookup or getattr locks immediately */
+       if (it->it_op == IT_LOOKUP || it->it_op == IT_GETATTR)
+               ll_intent_drop_lock(it);
 }
 
 static int ll_revalidate_dentry(struct dentry *dentry,