Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3470270pxp; Tue, 8 Mar 2022 15:17:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyISDQA8RK9Bsb7plkDJHght+UgmPstk5um/h1xY/+mzCO86ROo+be6FDoGKx8VLEd09MPe X-Received: by 2002:a17:902:9681:b0:150:288:7440 with SMTP id n1-20020a170902968100b0015002887440mr19361529plp.166.1646781454339; Tue, 08 Mar 2022 15:17:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646781454; cv=none; d=google.com; s=arc-20160816; b=wcMSE9oD+KvRRwLfrd0CZbOUUNtEVmhbC9pRCUuY2FXtWsuY8RsfUKo/42sPr8gWkw b9K1hPYTJ7h3rnUGy2FQw7X7j4Us7gP1/+Nt2v1i1MXu4Dq4iypNaryY2h6Uupq15IS2 tJznd1aBH6dHNiQnU1VrDw8cs0LdwfAPXB0V61futdVgqO5m4/UAJITAEye/6wC4ZNq/ 1yIyhYDRlCgdf0qsFfYVYFJW9GjhXF2hYEJ/l+9+jtoCy6nrnTpByw2G5p4OObGzVdgv e06Qcr6xQdmsA7DkcRcRbxbVQmexO08t1SItPknIgBGCe129hajB52lcozGN+QDRdH+C tbnA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=9tb4TIpuLITxxgZ/5zuJDTRYiPC0WStlucP3wP8AsAg=; b=Qsexoy2YgSrw6B7UeIJutS5NkaE2VCWa108ZldwdPugxnUqdXaZkwGlqgRxHeEfXz3 T6sOoXRUx14wufS3Pl5F7pFbFPjpf5XiEYC/WjH+MZMcQV490eTdIf+0TJsINPYTZTwL dID84fFCwoqgUnart9jzQlYaL/sIWgUt/j8UrbpsU7OXWpzpzOM/CLnE7zG6IysJnglT 7ZR7dMNdlFUyzGeVUi9pasR1/5BK0jeOKZCYRWtbqxjjaloye3LrjmmV6KgvvGGZNv0X gomxgzSHFLVc6IoWja6LAGlnVT5zjC6TZFBKStUXVR4zAve4p031WSMb7NpKayHpZBLr x8qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=kAZwwzrV; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id gl12-20020a17090b120c00b001bd14e01f2csi354785pjb.26.2022.03.08.15.17.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 15:17:34 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=kAZwwzrV; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0538D7EDA2; Tue, 8 Mar 2022 15:12:09 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344422AbiCHGRJ (ORCPT + 99 others); Tue, 8 Mar 2022 01:17:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244567AbiCHGRG (ORCPT ); Tue, 8 Mar 2022 01:17:06 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 790472E6BE; Mon, 7 Mar 2022 22:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=9tb4TIpuLITxxgZ/5zuJDTRYiPC0WStlucP3wP8AsAg=; b=kAZwwzrVV8MatkfAj1oNP7pxT4 Ffr2eKt6CrpedeoZBJZ4LHavIqKry6c4hMXlUI5GeZkr73kZDW9xJHD+XtpP1r2IeKfTgRr38S6GA uTR9RDbQ7/mTQmmy4+ZxGY898ogr5EgfFsq6/mVPHwGq25IwMe7mrDkxX4rlj51AIcZlzYsSN5pBX 6eeuigLJL1a48af6gUUArPm8Hogopt/sA5YhfWjpOe8FmUY5XCHPxouwJwMzkiamlvmhMx3slopdL iMu42zFH8d8gw5QVon9OJHqrt7aFhbsZFRrrt7Gjmv2EG8zUiS/Ij6PJIqkLtIc2EKIXHK3T513PT jdvBNUfg==; Received: from [2001:4bb8:184:7746:6f50:7a98:3141:c37b] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRT8T-002lVK-RU; Tue, 08 Mar 2022 06:15:54 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Coly Li , Mike Snitzer , Song Liu , "Martin K. Petersen" , Josef Bacik , David Sterba , Phillip Lougher , linux-block@vger.kernel.org, dm-devel@redhat.com, linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: cleanup bio_kmalloc v2 Date: Tue, 8 Mar 2022 07:15:46 +0100 Message-Id: <20220308061551.737853-1-hch@lst.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Jens, this series finishes off the bio allocation interface cleanups by dealing with the weirdest member of the famility. bio_kmalloc combines a kmalloc for the bio and bio_vecs with a hidden bio_init call and magic cleanup semantics. This series moves a few callers away from bio_kmalloc and then turns bio_kmalloc into a simple wrapper for a slab allocation of a bio and the inline biovecs. The callers need to manually call bio_init instead with all that entails and the magic that turns bio_put into a kfree goes away as well, allowing for a proper debug check in bio_put that catches accidental use on a bio_init()ed bio. Changes since v1: - update a pre-existing comment per maintainer suggestion Diffstat: block/bio.c | 47 ++++++++++++++----------------------- block/blk-crypto-fallback.c | 14 ++++++----- block/blk-map.c | 42 +++++++++++++++++++++------------ drivers/block/pktcdvd.c | 34 +++++++++++--------------- drivers/md/bcache/debug.c | 10 ++++--- drivers/md/dm-bufio.c | 9 +++---- drivers/md/raid1.c | 12 ++++++--- drivers/md/raid10.c | 21 +++++++++++----- drivers/target/target_core_pscsi.c | 36 ++++------------------------ fs/btrfs/disk-io.c | 8 +++--- fs/btrfs/volumes.c | 11 -------- fs/btrfs/volumes.h | 2 - fs/squashfs/block.c | 14 +++-------- include/linux/bio.h | 2 - 14 files changed, 116 insertions(+), 146 deletions(-)