locks: Use inode_is_open_for_write
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- fs/locks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/locks.c +1 -1
@@ -1646,7 +1646,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) ||
Signature · 1 line
2.17.1
Jeff Layton
maintainerQuoted 13 lines · Nikolay Borisov
Use the aptly named function rather than open coding it. No functional changes.
Signed-off-by Nikolay Borisov <[email protected]>--- fs/locks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/locks.c +0
-0
fs/locks.c check_conflicting_open(const struct dentry *dentry, const long arg, int flags) · line 1652
Quoted 8 lines
fs/locks.c +1
-1@@ -1646,7 +1646,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) ||
Thanks, merged into locks-next. This should make v4.21.
Signature · 1 line
Jeff Layton <[email protected]>