Skip to content

Commit

Permalink
nfs: drop unnecessary locking in llseek
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andi Kleen authored and root committed Oct 28, 2011
1 parent 4cce0e2 commit 79835a7
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions fs/nfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ static int nfs_revalidate_file_size(struct inode *inode, struct file *filp)

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,
Expand All @@ -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);
}

/*
Expand Down

0 comments on commit 79835a7

Please sign in to comment.