summaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
authorNikolay Borisov <nborisov@suse.com>2018-12-11 09:29:25 +0100
committerJeff Layton <jlayton@kernel.org>2018-12-17 13:19:46 +0100
commit052b8cfa4070caa53125cd589da0cfe744132a94 (patch)
tree1a95f0c151edf1fe69ebea024d2e27db9044da90 /fs/locks.c
parentfs/locks: remove unnecessary white space. (diff)
downloadlinux-052b8cfa4070caa53125cd589da0cfe744132a94.tar.xz
linux-052b8cfa4070caa53125cd589da0cfe744132a94.zip
locks: Use inode_is_open_for_write
Use the aptly named function rather than open coding it. No functional changes. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Jeff Layton <jlayton@kernel.org>
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/locks.c b/fs/locks.c
index b6b43970f461..f0b24d98f36b 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -1766,7 +1766,7 @@ check_conflicting_open(const struct dentry *dentry, const long arg, int flags)
if (flags & FL_LAYOUT)
return 0;
- if ((arg == F_RDLCK) && (atomic_read(&inode->i_writecount) > 0))
+ if ((arg == F_RDLCK) && inode_is_open_for_write(inode))
return -EAGAIN;
if ((arg == F_WRLCK) && ((d_count(dentry) > 1) ||