Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3589297pxm; Tue, 1 Mar 2022 01:07:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxlyguFbKkKoqLnbPROFYbFdVHCMVlQ4J58yjm1/MkabmD57HWJu0135y1QIIIDm/5Q+HfK X-Received: by 2002:a17:90a:5302:b0:1b9:ba0a:27e5 with SMTP id x2-20020a17090a530200b001b9ba0a27e5mr20526669pjh.91.1646125660661; Tue, 01 Mar 2022 01:07:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646125660; cv=none; d=google.com; s=arc-20160816; b=xwj6A/WYmZzIW0z0ouYe/OOzV2LhRTiy8xlKmKDLm0eGve4qHPh3BQc0YxDfFZz33f 2AumzWjdbLbp4X3NOjEUr6VLP/zcXOb9tuvUKTvMTGUu5l5FQRZDh5t34fX0udkRj6Q5 LYBZJvXyjip1e9i4ru75lcoTNrDVYGln5EnBUENN9uS8gZYIUkRGsTr9dYd+S4qLhwA9 iAeoiIOauPjn+B3jq/SKuYkc1aJcBHjxeTEvCPjc/tSY9oBRHmNZ1jNxt4RheIbXA0Jg ksQZFgpWU6c++MvLAYTbg3Cl+TdxePCT0ie1gMGA9IQuthFg0YEoO3OsShSjUXZbVRKh RtBA== 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=cSZLkORyvzwZrDlYPlFtcZZpc85UNe7lWafDSj9PW3A=; b=wNgHIMDFxWS8ikvd8C1kk1neVPPPcurGej/jwH4Sg1Uddvxsoc0937bLkaeI/il5vz FaqLxafYIp6VrYxa1Vsu9FkkVasdiLrl/TQgU0lmqwwm8zX/M2CQe7XP3O9GMJeUu2EI PLdJYGSejTx0pz3PMNu9IXePI5frCXPbBGdGc9B/k2F9Lr4xesdjmIKOeLkNBezewNrB OczyUUXuh7UwzUK+IOZQy5eLNA73b2bB6i3dx2/32IPZlMYr6oY16dlrsd1bzo7zrn32 P713y0wCS6M443XaymQf6ejfCJ9w6/fd6YOv3CJo4HxgFKM1K2ABfSG1fJyQM4nTw3CW dDSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=bOHrh9z9; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020a170902bd4b00b001516f2cc30esi3714648plx.497.2022.03.01.01.07.24; Tue, 01 Mar 2022 01:07:40 -0800 (PST) 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=@infradead.org header.s=bombadil.20210309 header.b=bOHrh9z9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233497AbiCAIqv (ORCPT + 99 others); Tue, 1 Mar 2022 03:46:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232922AbiCAIqt (ORCPT ); Tue, 1 Mar 2022 03:46:49 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5099688B07; Tue, 1 Mar 2022 00:46: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=cSZLkORyvzwZrDlYPlFtcZZpc85UNe7lWafDSj9PW3A=; b=bOHrh9z9gOP/jl3beLFQx3R3OZ RCetENNwvDJCJVc4y+frLWvMGhyvJ1ETuooTFIVKStmyqeCJre+2cvKNpZE7uEEmoyDp8z91gHGzI Pk9nXVhfx9xskP9BkQB6AEzDZt3rUSKtha0TkUo0lpIURwcvzxfXHdjgMb2dYpc+TCGvZJYmMPmcS oPdH6b37gTVf0HcAcpjuHHUnUHocTQ03mpcRJDWPfGAUVQV+j3W9YPXBOjLAawheeCyFXYeLAwExM fCnVe2YSDVmvKEonBLKr8cGcCFD1ZMDV3Lod6YmmaNQ/Kee+LpAq5G4hgyXjmaMoCODFwMNR1nYsd oamZaitw==; Received: from [2.53.44.23] (helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOy8p-00FfOp-B9; Tue, 01 Mar 2022 08:45:56 +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 Date: Tue, 1 Mar 2022 10:45:47 +0200 Message-Id: <20220301084552.880256-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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 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. 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(-)