afs: refactor afs_linux_dentry_revalidate
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 23 Jan 2015 00:36:59 +0000 (19:36 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Wed, 4 Feb 2015 21:06:09 +0000 (16:06 -0500)
No functional change.   Separate the

  if (locked && vcp->mvstat == 1) { ... }

conditional into

  if (locked) {
    if (vcp->mvstat == 1) { ... }
  }

in preparation for another change.

Change-Id: I1fe42ed7771882ce365d9359a4e6187c283592a8
Reviewed-on: http://gerrit.openafs.org/11692
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/afs/LINUX/osi_vnodeops.c

index 70f2fb3..de2af82 100644 (file)
@@ -1171,29 +1171,31 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags)
            locked = 1;
        }
 
-       if (locked && vcp->mvstat == 1) {         /* mount point */
-           if (vcp->mvid && (vcp->f.states & CMValid)) {
-               int tryEvalOnly = 0;
-               int code = 0;
-               struct vrequest *treq = NULL;
-
-               code = afs_CreateReq(&treq, credp);
-               if (code) {
-                   dput(parent);
-                   goto bad_dentry;
-               }
-               if ((strcmp(dp->d_name.name, ".directory") == 0)) {
-                   tryEvalOnly = 1;
-               }
-               if (tryEvalOnly)
-                   code = afs_TryEvalFakeStat(&vcp, &fakestate, treq);
-               else
-                   code = afs_EvalFakeStat(&vcp, &fakestate, treq);
-               afs_DestroyReq(treq);
-               if ((tryEvalOnly && vcp->mvstat == 1) || code) {
-                   /* a mount point, not yet replaced by its directory */
-                   dput(parent);
-                   goto bad_dentry;
+       if (locked) {
+           if (vcp->mvstat == 1) {         /* mount point */
+               if (vcp->mvid && (vcp->f.states & CMValid)) {
+                   int tryEvalOnly = 0;
+                   int code = 0;
+                   struct vrequest *treq = NULL;
+
+                   code = afs_CreateReq(&treq, credp);
+                   if (code) {
+                       dput(parent);
+                       goto bad_dentry;
+                   }
+                   if ((strcmp(dp->d_name.name, ".directory") == 0)) {
+                       tryEvalOnly = 1;
+                   }
+                   if (tryEvalOnly)
+                       code = afs_TryEvalFakeStat(&vcp, &fakestate, treq);
+                   else
+                       code = afs_EvalFakeStat(&vcp, &fakestate, treq);
+                   afs_DestroyReq(treq);
+                   if ((tryEvalOnly && vcp->mvstat == 1) || code) {
+                       /* a mount point, not yet replaced by its directory */
+                       dput(parent);
+                       goto bad_dentry;
+                   }
                }
            }
        }