NFSD: discard fh_locked flag and fh_lock/fh_unlock
[sfrench/cifs-2.6.git] / fs / nfsd / vfs.c
index 8d5aa2faabf734b4cb93c811dd3c227b8d2c9a1c..9f486b788ed09fdd007ca342bc4f4e9fe34273cb 100644 (file)
@@ -1265,13 +1265,6 @@ nfsd_create_locked(struct svc_rqst *rqstp, struct svc_fh *fhp,
        dirp = d_inode(dentry);
 
        dchild = dget(resfhp->fh_dentry);
-       if (!fhp->fh_locked) {
-               WARN_ONCE(1, "nfsd_create: parent %pd2 not locked!\n",
-                               dentry);
-               err = nfserr_io;
-               goto out;
-       }
-
        err = nfsd_permission(rqstp, fhp->fh_export, dentry, NFSD_MAY_CREATE);
        if (err)
                goto out;
@@ -1634,10 +1627,7 @@ retry:
                goto out;
        }
 
-       /* cannot use fh_lock as we need deadlock protective ordering
-        * so do it by hand */
        trap = lock_rename(tdentry, fdentry);
-       ffhp->fh_locked = tfhp->fh_locked = true;
        fh_fill_pre_attrs(ffhp);
        fh_fill_pre_attrs(tfhp);
 
@@ -1693,17 +1683,12 @@ retry:
        dput(odentry);
  out_nfserr:
        err = nfserrno(host_err);
-       /*
-        * We cannot rely on fh_unlock on the two filehandles,
-        * as that would do the wrong thing if the two directories
-        * were the same, so again we do it by hand.
-        */
+
        if (!close_cached) {
                fh_fill_post_attrs(ffhp);
                fh_fill_post_attrs(tfhp);
        }
        unlock_rename(tdentry, fdentry);
-       ffhp->fh_locked = tfhp->fh_locked = false;
        fh_drop_write(ffhp);
 
        /*