* [PATCH] fanotify: Use inode_is_open_for_write
@ 2018-12-11 8:27 Nikolay Borisov
2018-12-11 9:56 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Borisov @ 2018-12-11 8:27 UTC (permalink / raw)
To: jack; +Cc: linux-fsdevel, Nikolay Borisov
Use the aptly named function rather than opencoding i_writecount check.
No functional changes.
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
fs/notify/fanotify/fanotify_user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index e03be5071362..98b0769e4cf2 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -669,7 +669,7 @@ static int fanotify_add_inode_mark(struct fsnotify_group *group,
*/
if ((flags & FAN_MARK_IGNORED_MASK) &&
!(flags & FAN_MARK_IGNORED_SURV_MODIFY) &&
- (atomic_read(&inode->i_writecount) > 0))
+ inode_is_open_for_write(inode))
return 0;
return fanotify_add_mark(group, &inode->i_fsnotify_marks,
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fanotify: Use inode_is_open_for_write
2018-12-11 8:27 [PATCH] fanotify: Use inode_is_open_for_write Nikolay Borisov
@ 2018-12-11 9:56 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2018-12-11 9:56 UTC (permalink / raw)
To: Nikolay Borisov; +Cc: jack, linux-fsdevel
On Tue 11-12-18 10:27:23, Nikolay Borisov wrote:
> Use the aptly named function rather than opencoding i_writecount check.
> No functional changes.
>
> Reviewed-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Thanks! Added to my tree.
Honza
> ---
> fs/notify/fanotify/fanotify_user.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
> index e03be5071362..98b0769e4cf2 100644
> --- a/fs/notify/fanotify/fanotify_user.c
> +++ b/fs/notify/fanotify/fanotify_user.c
> @@ -669,7 +669,7 @@ static int fanotify_add_inode_mark(struct fsnotify_group *group,
> */
> if ((flags & FAN_MARK_IGNORED_MASK) &&
> !(flags & FAN_MARK_IGNORED_SURV_MODIFY) &&
> - (atomic_read(&inode->i_writecount) > 0))
> + inode_is_open_for_write(inode))
> return 0;
>
> return fanotify_add_mark(group, &inode->i_fsnotify_marks,
> --
> 2.17.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-11 9:56 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:27 [PATCH] fanotify: Use inode_is_open_for_write Nikolay Borisov
2018-12-11 9:56 ` Jan Kara
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).