]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
NFS: Remove unnecessary inode lock in nfs_fsync_dir()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 30 Oct 2020 21:57:30 +0000 (17:57 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 12 Nov 2020 15:41:26 +0000 (10:41 -0500)
nfs_inc_stats() is already thread-safe, and there are no other reasons
to hold the inode lock here.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/dir.c

index e56b1bd99537c64ca72a0b92f28c86ed3d9fd2a7..4e011adaf967026b63399683475ebf808196f2a4 100644 (file)
@@ -997,13 +997,9 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence)
 static int nfs_fsync_dir(struct file *filp, loff_t start, loff_t end,
                         int datasync)
 {
-       struct inode *inode = file_inode(filp);
-
        dfprintk(FILE, "NFS: fsync dir(%pD2) datasync %d\n", filp, datasync);
 
-       inode_lock(inode);
-       nfs_inc_stats(inode, NFSIOS_VFSFSYNC);
-       inode_unlock(inode);
+       nfs_inc_stats(file_inode(filp), NFSIOS_VFSFSYNC);
        return 0;
 }