Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1585087rwd; Thu, 25 May 2023 15:03:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6KSWrR884fZffcJZgz+t7V7n6lnMw4de9tX0mFe9DAyrZ/jECxGG+SVx+NcnYXDgRbH8V0 X-Received: by 2002:a05:6a20:4289:b0:10d:3134:10d7 with SMTP id o9-20020a056a20428900b0010d313410d7mr9514835pzj.27.1685052204850; Thu, 25 May 2023 15:03:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685052204; cv=none; d=google.com; s=arc-20160816; b=G18sHmkfQUsXbTmuOjw4Sd03Nqk0kzhp9cnstcVSQ1NExP0q/dgoFzpCUQ64KTlVZC 1F992Wjpgoo3kdIaKEySDWh8yAsKKAYWPfe6FNldbeA1qak/J8LCaKSJLnWOTo7MuePS jetQQ8trBCa168SqRPzJoEaB47LBRefi1bA0OmkUrW5G0qTmGF5wgrMyXzI7WgDzq6QY PA5urjuYRPumjGzcSadEidD5WtXLDwx20ZdVrcf92Zggm94STofH4Xd3Nc320KnkSnqZ wG/kHL/v1A1Y5D+xY/QSxSS2LPGCwKjNY6hfEg8j4Sd1qMoRncExxP2L2A2dgzYGOu41 FBcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KkRPMSjK8YKASg8ZAP2GYnCrc/m4pRzmXY3p1j1RS/g=; b=i8ao466faI8QY7157Rm+WA+aLKteRAhQkq2+10C2Yp/8CmKRPWQ/DjKM8BuqlWFQDn f9kVnbohvjXcTMN9KW3HYHOv49+8T+EIUBW5RofUW47k7Uxaix7FWgwNE/ICrjQmFuTI JlNvyyhG0g/NVlsHMrqaNiP6d5Gi3Z/Z5+vmc62sSTEDnvuTEAMdZVBDASQ2PfzT0RB7 6pOUgDOWFbONE/G1Wf5jp9R4jBAKKA9hcej01JR78ar0bAoVWAk4fbPrSJpfsXN2BHRI lyM9jxt0+lqVCih6tLwxWPbxxhoAJMEmyBVG6joY4q/JR6TkA4dTtr9p7Z88vojQX5yZ wQaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=a5Ua3jPQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a6-20020a655c86000000b0053eee37e16asi1934764pgt.522.2023.05.25.15.03.08; Thu, 25 May 2023 15:03:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=a5Ua3jPQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242022AbjEYVtE (ORCPT + 99 others); Thu, 25 May 2023 17:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239784AbjEYVso (ORCPT ); Thu, 25 May 2023 17:48:44 -0400 Received: from out-39.mta1.migadu.com (out-39.mta1.migadu.com [95.215.58.39]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E14D194 for ; Thu, 25 May 2023 14:48:42 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1685051320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KkRPMSjK8YKASg8ZAP2GYnCrc/m4pRzmXY3p1j1RS/g=; b=a5Ua3jPQQwy6N9lQr/+d3LtuAC8WhjKIbI5ddlzl49u+avjnUPNS4kpj/3yy2kyQZsVj0E aYAzQA+vmk12NIuVpAiLMs3h6CFrQTy2Dq1ggwjeiX4cwmKAn+e7lLhPwhJ5pNtRkw9K3N 9d4WZoaUZGUoAYGTRU6FnY85rb5QA7w= From: Kent Overstreet To: linux-kernel@vger.kernel.org, axboe@kernel.dk Cc: Kent Overstreet , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Kent Overstreet Subject: [PATCH 3/7] block: Bring back zero_fill_bio_iter Date: Thu, 25 May 2023 17:48:18 -0400 Message-Id: <20230525214822.2725616-4-kent.overstreet@linux.dev> In-Reply-To: <20230525214822.2725616-1-kent.overstreet@linux.dev> References: <20230525214822.2725616-1-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kent Overstreet This reverts the commit that deleted it; it's used by bcachefs. Signed-off-by: Kent Overstreet Cc: Jens Axboe Cc: linux-block@vger.kernel.org --- block/bio.c | 6 +++--- include/linux/bio.h | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/block/bio.c b/block/bio.c index e74a04ea14..70b5c987bc 100644 --- a/block/bio.c +++ b/block/bio.c @@ -606,15 +606,15 @@ struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask) } EXPORT_SYMBOL(bio_kmalloc); -void zero_fill_bio(struct bio *bio) +void zero_fill_bio_iter(struct bio *bio, struct bvec_iter start) { struct bio_vec bv; struct bvec_iter iter; - bio_for_each_segment(bv, bio, iter) + __bio_for_each_segment(bv, bio, iter, start) memzero_bvec(&bv); } -EXPORT_SYMBOL(zero_fill_bio); +EXPORT_SYMBOL(zero_fill_bio_iter); /** * bio_truncate - truncate the bio to small size of @new_size diff --git a/include/linux/bio.h b/include/linux/bio.h index d766be7152..3536f28c05 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -484,7 +484,12 @@ extern void bio_copy_data_iter(struct bio *dst, struct bvec_iter *dst_iter, extern void bio_copy_data(struct bio *dst, struct bio *src); extern void bio_free_pages(struct bio *bio); void guard_bio_eod(struct bio *bio); -void zero_fill_bio(struct bio *bio); +void zero_fill_bio_iter(struct bio *bio, struct bvec_iter iter); + +static inline void zero_fill_bio(struct bio *bio) +{ + zero_fill_bio_iter(bio, bio->bi_iter); +} static inline void bio_release_pages(struct bio *bio, bool mark_dirty) { -- 2.40.1