Skip to content

Commit

Permalink
ext4: use ext4_reserve_inode_write in ext4_xattr_set_handle
Browse files Browse the repository at this point in the history
ext4_mark_iloc_dirty() says:

 * The caller must have previously called ext4_reserve_inode_write().
 * Give this, we know that the caller already has write access to iloc->bh.

ext4_xattr_set_handle, however, just open-codes it.  May as well use
the helper function for consistency.

No bug here, just tidiness.

(Note: on cleanup path, ext4_reserve_inode_write sets
the bh to NULL if it returns an error, and brelse() of 
a null bh is handled gracefully).

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Eric Sandeen authored and Theodore Ts'o committed Oct 26, 2011
1 parent 909a4cf commit 6654361
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/ext4/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,11 +985,7 @@ ext4_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
no_expand = ext4_test_inode_state(inode, EXT4_STATE_NO_EXPAND);
ext4_set_inode_state(inode, EXT4_STATE_NO_EXPAND);

error = ext4_get_inode_loc(inode, &is.iloc);
if (error)
goto cleanup;

error = ext4_journal_get_write_access(handle, is.iloc.bh);
error = ext4_reserve_inode_write(handle, inode, &is.iloc);
if (error)
goto cleanup;

Expand Down

0 comments on commit 6654361

Please sign in to comment.