Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6101199rwr; Tue, 9 May 2023 10:11:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ntiAUVhUi01Lqr+A9gDc0NBq3lUQzu6xxRiHx5yr6ORGyWK9t3wfE408uOJZVhM00aL/8 X-Received: by 2002:a05:6a20:3ca1:b0:100:a201:83ce with SMTP id b33-20020a056a203ca100b00100a20183cemr9077939pzj.9.1683652293531; Tue, 09 May 2023 10:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683652293; cv=none; d=google.com; s=arc-20160816; b=movATC4WTBa50DbA2ZQy4Exyc0tveZbvdyosfMypG2DbRLrnwAhf/SBiVpB+JuZmiy UsT2PMX3DIu2e7O6ELnoCVDhqn5otiKFI9xBKCsUFussrOOeh0ZHSZulSzOsM0qNoZNx 5djwG8cHiTgcqr5ZKe/fNzHcRi8zR3p8aKq6DWmOIf2zn8EjRsvn7zJPxHFbrhpMjH0e XXVsNlTf9SrduxwX3QjjHmac0N65kZ0nCxY93YV1G/NmUvWQPDHQdRiDGLuAs+/5AUwD 9FOd1K38FIpvb1vvoit3dGsJ9UvFXv8PqkSQy91/PF5Fqej7CCTBXLeNKZ2OE/BI4mP2 x9Fg== 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=PoXN3mOh3H9kIV+N4ohN+S/na8OWw0jPQKlxLbscgAQaXDX5CrVcKPxdirlPxx5zs+ 0f6JoXJObUHKXgnk2GC8Fr2z2OtH7LF5gbHHlX1eMp56HmbeScfI4fAwMyLTRHYdrmjV zXp51WTzyIdowxedsE3vEDIFi3Y/wuhj/+W3+0n9tVvUwe2HCae5f7MjpMW+Vt5TtlqZ 7BE9E8RpnatoN0CSxjdtlvPJbe5gUd3yjpvWoFv91a4O9rgO2ctlSvMF8h+UHgQSj324 iYWpD0St7q7Paupp06HYt0FCk2uDOcSEE8pJrMlF7HSkhC6aYF30GD8GiWIpvUXa14xW xQGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="e6zAL/14"; 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 z7-20020a633307000000b0052c73483bbfsi1800962pgz.830.2023.05.09.10.11.21; Tue, 09 May 2023 10:11:33 -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="e6zAL/14"; 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 S234912AbjEIQ62 (ORCPT + 99 others); Tue, 9 May 2023 12:58:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234909AbjEIQ6C (ORCPT ); Tue, 9 May 2023 12:58:02 -0400 Received: from out-26.mta1.migadu.com (out-26.mta1.migadu.com [95.215.58.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9638468C for ; Tue, 9 May 2023 09:57:22 -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=1683651441; 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=e6zAL/14FO+1bslJPm07XIKa8FmztDcUWzG/+82TKmWU9JdQ37Lsk8HCZIAl/Ey4JWSA0n 3q9fReqLqSzv4BR/RUqz0QCO9NZZ9AIGDUd0kpAPw/7gjDB2t0CqgqTg8LW8BwDa7lZsi7 whDk5K1hE3oyJt+KNlYcAOFU9ZDzXmk= From: Kent Overstreet To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org Cc: Kent Overstreet , Kent Overstreet , Jens Axboe , linux-block@vger.kernel.org Subject: [PATCH 11/32] block: Bring back zero_fill_bio_iter Date: Tue, 9 May 2023 12:56:36 -0400 Message-Id: <20230509165657.1735798-12-kent.overstreet@linux.dev> In-Reply-To: <20230509165657.1735798-1-kent.overstreet@linux.dev> References: <20230509165657.1735798-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=ham 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