diff options
author | Jan Kara <jack@suse.cz> | 2016-11-04 18:08:15 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-11-04 14:34:47 -0600 |
commit | e64855c6cfaa0a80c1b71c5f647cb792dc436668 (patch) | |
tree | 751d56f17914506a5e54a380f9a4d4519cadfa18 /include/linux/buffer_head.h | |
parent | 69a9bea146b185be8ec50e80eaecd8e487e689f8 (diff) |
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 <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/buffer_head.h')
-rw-r--r-- | include/linux/buffer_head.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 9c9c73ce7d4f..d1ab91fc6d43 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -171,6 +171,10 @@ int sync_mapping_buffers(struct address_space *mapping); void unmap_underlying_metadata(struct block_device *bdev, sector_t block); void clean_bdev_aliases(struct block_device *bdev, sector_t block, sector_t len); +static inline void clean_bdev_bh_alias(struct buffer_head *bh) +{ + clean_bdev_aliases(bh->b_bdev, bh->b_blocknr, 1); +} void mark_buffer_async_write(struct buffer_head *bh); void __wait_on_buffer(struct buffer_head *); |