On 15/08/2024 06:52, Christoph Hellwig wrote:
On Wed, Aug 14, 2024 at 03:00:06PM +0100, John Garry wrote:
- __blkdev_issue_write_zeroes(bdev, sector, nr_sects, gfp, &bio,
flags);
+ __blkdev_issue_write_zeroes(bdev, sector, nr_sects, gfp, &bio,
flags, limit);
Please fix the overly long line while touching this.
{
+
+ sector_t limit = bio_write_zeroes_limit(bdev);
if (bdev_read_only(bdev))
return -EPERM;
Can you add a comment explaining why the limit is read once for future
readers?
Yes, I was going to do that.
> Also please keep an empty line after the variable declaration
> instead of before it.
ok
BTW, on a slightly related topic, why is bdev_write_zeroes_sectors()
seemingly the only bdev helper which checks bdev_get_queue() return value:
static inline unsigned int bdev_write_zeroes_sectors(struct block_device
*bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
if (q)
return q->limits.max_write_zeroes_sectors;
return 0;
}
According to the comment in bdev_get_queue(), it never is never NULL.