Re: [PATCH v9 01/41] block: add bio_add_zone_append_page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 30, 2020 at 09:40:08PM -0600, Jens Axboe wrote:
On 10/30/20 7:51 AM, Naohiro Aota wrote:
From: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>

Add bio_add_zone_append_page(), a wrapper around bio_add_hw_page() which
is intended to be used by file systems that directly add pages to a bio
instead of using bio_iov_iter_get_pages().

Not sure what this is for, since I'm only on one patch in the series...

I'm sorry for the missing context. This patch is for this series.

https://lore.kernel.org/linux-btrfs/cover.1604065156.git.naohiro.aota@xxxxxxx/T/

This patch uses bio_add_zone_append_page in place of bio_add_page for zoned
device.

https://lore.kernel.org/linux-btrfs/cover.1604065156.git.naohiro.aota@xxxxxxx/T/#m88184d5dd11ac30c0878582898cd9d6f7cbc21fc


+/**
+ * bio_add_zone_append_page - attempt to add page to zone-append bio
+ * @bio: destination bio
+ * @page: page to add
+ * @len: vec entry length
+ * @offset: vec entry offset
+ *
+ * Attempt to add a page to the bio_vec maplist of a bio that will be submitted
+ * for a zone-append request. This can fail for a number of reasons, such as the
+ * bio being full or the target block device is not a zoned block device or
+ * other limitations of the target block device. The target block device must
+ * allow bio's up to PAGE_SIZE, so it is always possible to add a single page
+ * to an empty bio.
+ */

This should include a

Return value:

section, explaining how it returns number of bytes added (and why 0 is thus
a failure case).

+int bio_add_zone_append_page(struct bio *bio, struct page *page,
+			     unsigned int len, unsigned int offset)

Should this return unsigned int? If not, how would it work if someone
asked for INT_MAX + 4k.

--
Jens Axboe




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux