diff options
author | Christoph Hellwig <hch@lst.de> | 2021-10-19 08:25:25 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-10-22 16:36:55 +0200 |
commit | 70164eb6ccb76ab679b016b4b60123bf4ec6c162 (patch) | |
tree | 940329ff4f1a63d41c97573a86620e428b5a2dfa /block | |
parent | fs: remove __sync_filesystem (diff) | |
download | linux-70164eb6ccb76ab679b016b4b60123bf4ec6c162.tar.xz linux-70164eb6ccb76ab679b016b4b60123bf4ec6c162.zip |
block: remove __sync_blockdev
Instead offer a new sync_blockdev_nowait helper for the !wait case.
This new helper is exported as it will grow modular callers in a bit.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20211019062530.2174626-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/bdev.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/block/bdev.c b/block/bdev.c index 7e6156203a71..9a33c414f450 100644 --- a/block/bdev.c +++ b/block/bdev.c @@ -185,14 +185,13 @@ int sb_min_blocksize(struct super_block *sb, int size) EXPORT_SYMBOL(sb_min_blocksize); -int __sync_blockdev(struct block_device *bdev, int wait) +int sync_blockdev_nowait(struct block_device *bdev) { if (!bdev) return 0; - if (!wait) - return filemap_flush(bdev->bd_inode->i_mapping); - return filemap_write_and_wait(bdev->bd_inode->i_mapping); + return filemap_flush(bdev->bd_inode->i_mapping); } +EXPORT_SYMBOL_GPL(sync_blockdev_nowait); /* * Write out and wait upon all the dirty data associated with a block @@ -200,7 +199,9 @@ int __sync_blockdev(struct block_device *bdev, int wait) */ int sync_blockdev(struct block_device *bdev) { - return __sync_blockdev(bdev, 1); + if (!bdev) + return 0; + return filemap_write_and_wait(bdev->bd_inode->i_mapping); } EXPORT_SYMBOL(sync_blockdev); |