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 /fs/buffer.c | |
parent | 69a9bea146b185be8ec50e80eaecd8e487e689f8 (diff) | |
download | lwn-e64855c6cfaa0a80c1b71c5f647cb792dc436668.tar.gz lwn-e64855c6cfaa0a80c1b71c5f647cb792dc436668.zip |
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 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index f8beca55240a..912d70169fca 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1821,8 +1821,7 @@ int __block_write_full_page(struct inode *inode, struct page *page, if (buffer_new(bh)) { /* blockdev mappings never come here */ clear_buffer_new(bh); - unmap_underlying_metadata(bh->b_bdev, - bh->b_blocknr); + clean_bdev_bh_alias(bh); } } bh = bh->b_this_page; @@ -2068,8 +2067,7 @@ int __block_write_begin_int(struct page *page, loff_t pos, unsigned len, } if (buffer_new(bh)) { - unmap_underlying_metadata(bh->b_bdev, - bh->b_blocknr); + clean_bdev_bh_alias(bh); if (PageUptodate(page)) { clear_buffer_new(bh); set_buffer_uptodate(bh); @@ -2709,7 +2707,7 @@ int nobh_write_begin(struct address_space *mapping, if (!buffer_mapped(bh)) is_mapped_to_disk = 0; if (buffer_new(bh)) - unmap_underlying_metadata(bh->b_bdev, bh->b_blocknr); + clean_bdev_bh_alias(bh); if (PageUptodate(page)) { set_buffer_uptodate(bh); continue; |