* [PATCH] locks: Use inode_is_open_for_write
@ 2018-12-11 8:29 Nikolay Borisov
2018-12-17 12:21 ` Jeff Layton
0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Borisov @ 2018-12-11 8:29 UTC (permalink / raw)
To: jlayton; +Cc: bfields, viro, linux-fsdevel, Nikolay Borisov
Use the aptly named function rather than open coding it. No functional
changes.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/locks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/locks.c b/fs/locks.c
index 2ecb4db8c840..16ea7d89a67d 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -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) ||
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] locks: Use inode_is_open_for_write
2018-12-11 8:29 [PATCH] locks: Use inode_is_open_for_write Nikolay Borisov
@ 2018-12-17 12:21 ` Jeff Layton
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Layton @ 2018-12-17 12:21 UTC (permalink / raw)
To: Nikolay Borisov; +Cc: bfields, viro, linux-fsdevel
On Tue, 2018-12-11 at 10:29 +0200, Nikolay Borisov wrote:
> Use the aptly named function rather than open coding it. No functional
> changes.
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
> fs/locks.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/locks.c b/fs/locks.c
> index 2ecb4db8c840..16ea7d89a67d 100644
> --- a/fs/locks.c
> +++ b/fs/locks.c
> @@ -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.
--
Jeff Layton <jlayton@kernel.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-17 12:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-11 8:29 [PATCH] locks: Use inode_is_open_for_write Nikolay Borisov
2018-12-17 12:21 ` Jeff Layton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).