diff options
author | Christoph Hellwig <hch@lst.de> | 2022-04-15 06:52:46 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-04-18 03:49:59 +0200 |
commit | 2aba0d19f4d8c8929b4b3b94a9cfde2aa20e6ee2 (patch) | |
tree | c5475182b81db9910baea589ae8d659ab94cf99a /fs/zonefs | |
parent | block: add a bdev_stable_writes helper (diff) | |
download | linux-2aba0d19f4d8c8929b4b3b94a9cfde2aa20e6ee2.tar.xz linux-2aba0d19f4d8c8929b4b3b94a9cfde2aa20e6ee2.zip |
block: add a bdev_max_zone_append_sectors helper
Add a helper to check the max supported sectors for zone append based on
the block_device instead of having to poke into the block layer internal
request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Link: https://lore.kernel.org/r/20220415045258.199825-16-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/zonefs')
-rw-r--r-- | fs/zonefs/super.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 3614c7834007..7a63807b736c 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from) struct inode *inode = file_inode(iocb->ki_filp); struct zonefs_inode_info *zi = ZONEFS_I(inode); struct block_device *bdev = inode->i_sb->s_bdev; - unsigned int max; + unsigned int max = bdev_max_zone_append_sectors(bdev); struct bio *bio; ssize_t size; int nr_pages; ssize_t ret; - max = queue_max_zone_append_sectors(bdev_get_queue(bdev)); max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize); iov_iter_truncate(from, max); |