ext4: unify the ext4_handle_release_buffer() api
There are two wrapper functions which do exactly the same thing: ext4_journal_release_buffer(), and ext4_handle_release_buffer(). In addition, ext4_xattr_block_set() calls jbd2_journal_release_buffer() directly. Unify all of the code to use ext4_handle_release_buffer(), and get rid of ext4_journal_release_buffer(). Signed-off-by: Amir Goldstein <amir73il@users.sf.net> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
committed by
Theodore Ts'o
parent
ef60789302
commit
537a03103c
@@ -202,13 +202,6 @@ static inline int ext4_handle_has_enough_credits(handle_t *handle, int needed)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ext4_journal_release_buffer(handle_t *handle,
|
|
||||||
struct buffer_head *bh)
|
|
||||||
{
|
|
||||||
if (ext4_handle_valid(handle))
|
|
||||||
jbd2_journal_release_buffer(handle, bh);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline handle_t *ext4_journal_start(struct inode *inode, int nblocks)
|
static inline handle_t *ext4_journal_start(struct inode *inode, int nblocks)
|
||||||
{
|
{
|
||||||
return ext4_journal_start_sb(inode->i_sb, nblocks);
|
return ext4_journal_start_sb(inode->i_sb, nblocks);
|
||||||
|
@@ -499,12 +499,12 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
|
|||||||
return err;
|
return err;
|
||||||
|
|
||||||
exit_inode:
|
exit_inode:
|
||||||
/* ext4_journal_release_buffer(handle, iloc.bh); */
|
/* ext4_handle_release_buffer(handle, iloc.bh); */
|
||||||
brelse(iloc.bh);
|
brelse(iloc.bh);
|
||||||
exit_dindj:
|
exit_dindj:
|
||||||
/* ext4_journal_release_buffer(handle, dind); */
|
/* ext4_handle_release_buffer(handle, dind); */
|
||||||
exit_sbh:
|
exit_sbh:
|
||||||
/* ext4_journal_release_buffer(handle, EXT4_SB(sb)->s_sbh); */
|
/* ext4_handle_release_buffer(handle, EXT4_SB(sb)->s_sbh); */
|
||||||
exit_dind:
|
exit_dind:
|
||||||
brelse(dind);
|
brelse(dind);
|
||||||
exit_bh:
|
exit_bh:
|
||||||
@@ -586,7 +586,7 @@ static int reserve_backup_gdb(handle_t *handle, struct inode *inode,
|
|||||||
/*
|
/*
|
||||||
int j;
|
int j;
|
||||||
for (j = 0; j < i; j++)
|
for (j = 0; j < i; j++)
|
||||||
ext4_journal_release_buffer(handle, primary[j]);
|
ext4_handle_release_buffer(handle, primary[j]);
|
||||||
*/
|
*/
|
||||||
goto exit_bh;
|
goto exit_bh;
|
||||||
}
|
}
|
||||||
|
@@ -735,7 +735,7 @@ ext4_xattr_block_set(handle_t *handle, struct inode *inode,
|
|||||||
int offset = (char *)s->here - bs->bh->b_data;
|
int offset = (char *)s->here - bs->bh->b_data;
|
||||||
|
|
||||||
unlock_buffer(bs->bh);
|
unlock_buffer(bs->bh);
|
||||||
jbd2_journal_release_buffer(handle, bs->bh);
|
ext4_handle_release_buffer(handle, bs->bh);
|
||||||
if (ce) {
|
if (ce) {
|
||||||
mb_cache_entry_release(ce);
|
mb_cache_entry_release(ce);
|
||||||
ce = NULL;
|
ce = NULL;
|
||||||
|
Reference in New Issue
Block a user