nfs: drop unnecessary locking in llseek
authorAndi Kleen <ak@linux.intel.com>
Thu, 15 Sep 2011 23:06:52 +0000 (16:06 -0700)
committerroot <root@serles.lst.de>
Fri, 28 Oct 2011 12:59:00 +0000 (14:59 +0200)
This makes NFS follow the standard generic_file_llseek locking scheme.

Cc: Trond.Myklebust@netapp.com
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/nfs/file.c

index 12623abcf3d4c8e5dc24999265aa3878ebf3a1ba..91c01f0a4c3b1c25be85bc1a673ebbf7186e8df4 100644 (file)
@@ -180,8 +180,6 @@ force_reval:
 
 static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
 {
-       loff_t loff;
-
        dprintk("NFS: llseek file(%s/%s, %lld, %d)\n",
                        filp->f_path.dentry->d_parent->d_name.name,
                        filp->f_path.dentry->d_name.name,
@@ -197,14 +195,9 @@ static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin)
                int retval = nfs_revalidate_file_size(inode, filp);
                if (retval < 0)
                        return (loff_t)retval;
+       }
 
-               /* AK: should drop this lock. Unlikely to be needed. */
-               spin_lock(&inode->i_lock);
-               loff = generic_file_llseek(filp, offset, origin);
-               spin_unlock(&inode->i_lock);
-       } else
-               loff = generic_file_llseek(filp, offset, origin);
-       return loff;
+       return generic_file_llseek(filp, offset, origin);
 }
 
 /*