Commit a9913d7e authored by Nikitas Angelinas's avatar Nikitas Angelinas Committed by Jan Kara

reiserfs: replace open-coded atomic_dec_and_mutex_lock()

Replace the open-coded logic of atomic_dec_and_mutex_lock() in
reiserfs_file_release().

Link: https://lore.kernel.org/r/20191103094431.GA18576-nikitas.angelinas@gmail.comSigned-off-by: default avatarNikitas Angelinas <nikitas.angelinas@gmail.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent e705f4b8
......@@ -38,16 +38,10 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
BUG_ON(!S_ISREG(inode->i_mode));
if (atomic_add_unless(&REISERFS_I(inode)->openers, -1, 1))
if (!atomic_dec_and_mutex_lock(&REISERFS_I(inode)->openers,
&REISERFS_I(inode)->tailpack))
return 0;
mutex_lock(&REISERFS_I(inode)->tailpack);
if (!atomic_dec_and_test(&REISERFS_I(inode)->openers)) {
mutex_unlock(&REISERFS_I(inode)->tailpack);
return 0;
}
/* fast out for when nothing needs to be done */
if ((!(REISERFS_I(inode)->i_flags & i_pack_on_close_mask) ||
!tail_has_to_be_packed(inode)) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment