summaryrefslogtreecommitdiff
path: root/block/bdev.c
diff options
context:
space:
mode:
authorYuezhang Mo <Yuezhang.Mo@sony.com>2022-04-12 12:23:10 +0900
committerNamjae Jeon <linkinjeon@kernel.org>2022-05-23 11:17:30 +0900
commit97d6fb1b48f5e6f6d58028593defe8a23641b0b4 (patch)
tree25ac3bf238f7da9006951e87b6c359a1d04b6f6b /block/bdev.c
parent9b002894b4c252169abc26720452bf3746114b20 (diff)
block: add sync_blockdev_range()
sync_blockdev_range() is to support syncing multiple sectors with as few block device requests as possible, it is helpful to make the block device to give full play to its performance. Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com> Suggested-by: Christoph Hellwig <hch@infradead.org> Reviewed-by: Andy Wu <Andy.Wu@sony.com> Reviewed-by: Aoyama Wataru <wataru.aoyama@sony.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jens Axboe <axboe@kernel.dk> Acked-by: Sungjong Seo <sj1557.seo@samsung.com> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'block/bdev.c')
-rw-r--r--block/bdev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/block/bdev.c b/block/bdev.c
index 13de871fa816..8b549b071bd6 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -200,6 +200,13 @@ int sync_blockdev(struct block_device *bdev)
}
EXPORT_SYMBOL(sync_blockdev);
+int sync_blockdev_range(struct block_device *bdev, loff_t lstart, loff_t lend)
+{
+ return filemap_write_and_wait_range(bdev->bd_inode->i_mapping,
+ lstart, lend);
+}
+EXPORT_SYMBOL(sync_blockdev_range);
+
/*
* Write out and wait upon all dirty data associated with this
* device. Filesystem data as well as the underlying block