summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Coddington <bcodding@redhat.com>2015-10-15 09:07:07 -0400
committerJeff Layton <jeff.layton@primarydata.com>2015-10-15 09:07:07 -0400
commit6ca7d910121af4dd8c83294b50546f4664b2a932 (patch)
treebac8a64fee7efe4a53c5afce7222a89d744db627
parent128a37852234c1bd68eee4e7447f5362778009b8 (diff)
downloadlinux-6ca7d910121af4dd8c83294b50546f4664b2a932.tar.bz2
locks: Use more file_inode and fix a comment
Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
-rw-r--r--fs/locks.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/locks.c b/fs/locks.c
index 316e474c5fdb..c74c9df419bc 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1718,8 +1718,7 @@ static int generic_delete_lease(struct file *filp, void *owner)
{
int error = -EAGAIN;
struct file_lock *fl, *victim = NULL;
- struct dentry *dentry = filp->f_path.dentry;
- struct inode *inode = dentry->d_inode;
+ struct inode *inode = file_inode(filp);
struct file_lock_context *ctx;
LIST_HEAD(dispose);
@@ -1759,8 +1758,7 @@ static int generic_delete_lease(struct file *filp, void *owner)
int generic_setlease(struct file *filp, long arg, struct file_lock **flp,
void **priv)
{
- struct dentry *dentry = filp->f_path.dentry;
- struct inode *inode = dentry->d_inode;
+ struct inode *inode = file_inode(filp);
int error;
if ((!uid_eq(current_fsuid(), inode->i_uid)) && !capable(CAP_LEASE))
@@ -2115,7 +2113,7 @@ static int do_lock_file_wait(struct file *filp, unsigned int cmd,
return error;
}
-/* Ensure that fl->fl_filp has compatible f_mode for F_SETLK calls */
+/* Ensure that fl->fl_file has compatible f_mode for F_SETLK calls */
static int
check_fmode_for_setlk(struct file_lock *fl)
{