diff options
author | Nikolay Borisov <nborisov@suse.com> | 2019-02-11 07:04:16 +0300 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2019-02-11 07:04:16 +0300 |
commit | 82dd124c40b8cda710878b88fb0182301c040ffe (patch) | |
tree | ef381c696fc85b6d9c3cf555ca5d6a236c6e39de /fs/ext4/inode.c | |
parent | 53cf978457325d8fb2cdecd7981b31a8229e446e (diff) | |
download | linux-82dd124c40b8cda710878b88fb0182301c040ffe.tar.xz |
ext4: replace opencoded i_writecount usage with inode_is_open_for_write()
There is a function which clearly conveys the objective of checking
i_writecount. Additionally the usage in ext4_mb_initialize_context was
wrong, since a node would have wrongfully been reported as writable if
i_writecount had a negative value (MMAP_DENY_WRITE).
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 34d7e0703cc6..213d1857a7cf 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -391,7 +391,7 @@ void ext4_da_update_reserve_space(struct inode *inode, * inode's preallocations. */ if ((ei->i_reserved_data_blocks == 0) && - (atomic_read(&inode->i_writecount) == 0)) + !inode_is_open_for_write(inode)) ext4_discard_preallocations(inode); } |