mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -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
|
|
@ -765,7 +765,7 @@ lock_retry_remap:
|
|||
}
|
||||
// TODO: Instantiate the hole.
|
||||
// clear_buffer_new(bh);
|
||||
// unmap_underlying_metadata(bh->b_bdev, bh->b_blocknr);
|
||||
// clean_bdev_bh_alias(bh);
|
||||
ntfs_error(vol->sb, "Writing into sparse regions is "
|
||||
"not supported yet. Sorry.");
|
||||
err = -EOPNOTSUPP;
|
||||
|
|
|
|||
|
|
@ -740,8 +740,7 @@ map_buffer_cached:
|
|||
set_buffer_uptodate(bh);
|
||||
if (unlikely(was_hole)) {
|
||||
/* We allocated the buffer. */
|
||||
unmap_underlying_metadata(bh->b_bdev,
|
||||
bh->b_blocknr);
|
||||
clean_bdev_bh_alias(bh);
|
||||
if (bh_end <= pos || bh_pos >= end)
|
||||
mark_buffer_dirty(bh);
|
||||
else
|
||||
|
|
@ -784,7 +783,7 @@ map_buffer_cached:
|
|||
continue;
|
||||
}
|
||||
/* We allocated the buffer. */
|
||||
unmap_underlying_metadata(bh->b_bdev, bh->b_blocknr);
|
||||
clean_bdev_bh_alias(bh);
|
||||
/*
|
||||
* If the buffer is fully outside the write, zero it,
|
||||
* set it uptodate, and mark it dirty so it gets
|
||||
|
|
|
|||
Loading…
Reference in a new issue