mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
fs: Add helper to clean bdev aliases under a bh and use it
Add a helper function that clears buffer heads from a block device aliasing passed bh. Use this helper function from filesystems instead of the original unmap_underlying_metadata() to save some boiler plate code and also have a better name for the functionalily since it is not unmapping anything for a *long* time. Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
parent
69a9bea146
commit
e64855c6cf
10 changed files with 16 additions and 19 deletions
|
|
@ -307,8 +307,7 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg,
|
|||
(unsigned long long)(pos + newb), pos);
|
||||
|
||||
bh->b_blocknr = newb + pos;
|
||||
unmap_underlying_metadata(bh->b_bdev,
|
||||
bh->b_blocknr);
|
||||
clean_bdev_bh_alias(bh);
|
||||
mark_buffer_dirty(bh);
|
||||
++j;
|
||||
bh = bh->b_this_page;
|
||||
|
|
|
|||
|
|
@ -1070,8 +1070,7 @@ static int ufs_alloc_lastblock(struct inode *inode, loff_t size)
|
|||
|
||||
if (buffer_new(bh)) {
|
||||
clear_buffer_new(bh);
|
||||
unmap_underlying_metadata(bh->b_bdev,
|
||||
bh->b_blocknr);
|
||||
clean_bdev_bh_alias(bh);
|
||||
/*
|
||||
* we do not zeroize fragment, because of
|
||||
* if it maped to hole, it already contains zeroes
|
||||
|
|
|
|||
Loading…
Reference in a new issue