From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCF59C4332F for ; Wed, 3 Nov 2021 02:23:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AF73661051 for ; Wed, 3 Nov 2021 02:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231250AbhKCC00 (ORCPT ); Tue, 2 Nov 2021 22:26:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbhKCC0Y (ORCPT ); Tue, 2 Nov 2021 22:26:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15076C061714; Tue, 2 Nov 2021 19:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5zRgZ6/y0k3uMlXT0720QEVqvpr6GZYnv9MDOweyttY=; b=UsfmVHtYxZJzEvxzAeezzifOAD h63h0LwXGLtcenDkzokC4jxWvaGiBb2S+SpLOvYQ/GH9PWEIuA5bXUvnz548cXT1NeDE0Xo7Dog4M gCtuKOM+PAKYbjO2KtQldoOiRaN8y3q+6j2H3XHdAw8Hl4QShz6QqgLpL5yYhafItoEe9EMpy302q kERgPVsh7nX9rxpHfcGsD6CWciCsOiJy3roDZkOQREy+bQSLC7GaMT2anyfOxihWNkUIj/1EiEkGq opkzjZ/ImfeAPeKy6uZe566+hAfEPOpEYJD0QgW66VS3ZNQik99jgNtCl699biW+ygOOJuVG5cAu8 bzf1Tqdw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mi5ue-004uNI-4n; Wed, 03 Nov 2021 02:22:35 +0000 Date: Wed, 3 Nov 2021 02:22:04 +0000 From: Matthew Wilcox To: "wangjianjian (C)" Cc: "Darrick J. Wong" , "linux-xfs@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-block@vger.kernel.org" , Jens Axboe , Christoph Hellwig Subject: Re: [PATCH 02/21] block: Add bio_add_folio() Message-ID: References: <20211101203929.954622-1-willy@infradead.org> <20211101203929.954622-3-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 03, 2021 at 01:25:57AM +0000, wangjianjian (C) wrote: > diff --git a/block/bio.c b/block/bio.c > index 15ab0d6d1c06..0e911c4fb9f2 100644 > --- a/block/bio.c > +++ b/block/bio.c > @@ -1033,6 +1033,28 @@ int bio_add_page(struct bio *bio, struct page *page, } EXPORT_SYMBOL(bio_add_page); > > +/** > + * bio_add_folio - Attempt to add part of a folio to a bio. > + * @bio: BIO to add to. > + * @folio: Folio to add. > + * @len: How many bytes from the folio to add. > + * @off: First byte in this folio to add. > + * > + * Filesystems that use folios can call this function instead of > +calling > + * bio_add_page() for each page in the folio. If @off is bigger than > + * PAGE_SIZE, this function can create a bio_vec that starts in a page > + * after the bv_page. BIOs do not support folios that are 4GiB or larger. > + * > + * Return: Whether the addition was successful. > + */ > +bool bio_add_folio(struct bio *bio, struct folio *folio, size_t len, > + size_t off) > +{ > + if (len > UINT_MAX || off > UINT_MAX) > + return 0; > + return bio_add_page(bio, &folio->page, len, off) > 0; } > + > > > Newline. I think it's your mail system that's mangled it. Here's how it looked to the rest of the world: https://lore.kernel.org/linux-xfs/20211101203929.954622-3-willy@infradead.org/