Re: [PATCH 05/11] block: add a store_limit operations for sysfs entries
- To: John Garry <john.g.garry@oracle.com>
- Cc: Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>, Damien Le Moal <dlemoal@kernel.org>, Ming Lei <ming.lei@redhat.com>, Nilay Shroff <nilay@linux.ibm.com>, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, nbd@other.debian.org, linux-scsi@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, "Martin K . Petersen" <martin.petersen@oracle.com>, Johannes Thumshirn <johannes.thumshirn@wdc.com>
- Subject: Re: [PATCH 05/11] block: add a store_limit operations for sysfs entries
- From: Christoph Hellwig <hch@lst.de>
- Date: Fri, 10 Jan 2025 10:18:59 +0100
- Message-id: <[🔎] 20250110091859.GA8373@lst.de>
- In-reply-to: <[🔎] e7177a33-aebd-4828-87b0-f790b4fb1306@oracle.com>
- References: <[🔎] 20250110054726.1499538-1-hch@lst.de> <[🔎] 20250110054726.1499538-6-hch@lst.de> <[🔎] e7177a33-aebd-4828-87b0-f790b4fb1306@oracle.com>
On Fri, Jan 10, 2025 at 09:15:09AM +0000, John Garry wrote:
>> + int (*store_limit)(struct gendisk *disk, const char *page,
>
> I don't really see why this returns an int, while the queue features
> callback methods return a ssize_t. I know that the res variable in
> queue_attr_store() gets mixed with an int for updating the queue limits,
> but I don't see that as a reason to use int here.
The normal store methods have the annoying calling convention where
they return the parsed string length on success. ->store_limits uses
the simpler and harder to get wrong convention of returning 0 on
success.
Reply to: