Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1032357pxb; Wed, 6 Apr 2022 07:09:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxveaAQnq8K9dnSVdw+OKpsJufYRj6MbfJPu0iWTp726LRw6s84tUy87w9ERTiI+bkS7HsB X-Received: by 2002:a17:90a:4897:b0:1c7:5fce:cbcd with SMTP id b23-20020a17090a489700b001c75fcecbcdmr10234262pjh.45.1649254144237; Wed, 06 Apr 2022 07:09:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649254144; cv=none; d=google.com; s=arc-20160816; b=bPaBtpitSLCtPSL9Q7bQKBAUVnTugwX8L5tBf5UiVbkw/X5ozK41+sOr1rWaeLksag aq83/nXQij7hJIvyZ+eiZfDwOJ6SPSVY+eGt3hrZyq9jOT+koer8lxK61Z9Ev3xOKE99 ysdoj+f7KcFw/Dvpsdda9OyO94VE71y07Hl+WTcVIbQxAxDPVytwcXrILMtWXAkrBcNN 06/EfIuttg95BNeON/7mk2AwmBuLhXYS7Z3LnumO2v7zwT1YqNQxsa+Gh5zSj42tOXY7 7R1D90Faq2QMA9Wh4CW9j9jouqO4VYpKrod6seyA765bG0dojjNq/GlYY4xjY7IjsVpb lF5w== 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=3yxxX62Zo/mR0Xi79MnBUJxnWH3rNCgddJGJ/Fluyic=; b=bAvZM1CMTI/dV/kf5/WAV+bOP/5pcsmToCY1eDN7AgIptBcpVIk3OroJZLc2x3nAp7 VEc+W0vkaRIgEG5spbEVB9MGybSHJGUiS5cdSTiLhvef+8erqOY4JP7xyRC6TCsJou6M K1qqRwjTUrjn9bqpD3GbNXXVooOcVLIANPrxTThGRXDsVVFIspvTR8B4tjUrkj25q5P8 hra3tRl+8WD7zQSYkCJaeGBOmczltgUN9N+FPsYBtcxFcGJxgPcreNpdT2YpuaQzL5ol OQ5KPdSAyVoXK4+eO4gUGYoXJ39eMTPAi3FdTBCAJuKvTC4kFOTMQoqBPelJHGEf/X/f 14zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xPwhKOzK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id u6-20020a17090341c600b00156e028729fsi3224149ple.263.2022.04.06.07.09.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 07:09:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=xPwhKOzK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 E526852621B; Wed, 6 Apr 2022 04:57:07 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241365AbiDFJbq (ORCPT + 99 others); Wed, 6 Apr 2022 05:31:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1579179AbiDFJUU (ORCPT ); Wed, 6 Apr 2022 05:20:20 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 861CB493CE3; Tue, 5 Apr 2022 23:12:40 -0700 (PDT) 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=3yxxX62Zo/mR0Xi79MnBUJxnWH3rNCgddJGJ/Fluyic=; b=xPwhKOzKRifzeLf33Ougm7j3R2 9OOZnWBIUW9ywRPXYzADpSxAOJd+lc7Nw7PFDUE6dLbDnqAbJxYbqHABvtJLLVue+sw0/BD7jLpON W1PzcvOTfGWKPcyWyiJoa8fKNjy8rHR6OcLI6ZFYu12/xuetEqKA/rpKsNxdu9lQHQeOr5ydVzOgP Fr2RmExYOtvEtC783BVBrdtMNJLUMzEAMvbjwEGB3Vvz1513LvLpfZ5YHpp06ZknvjB+H6bXsW8d7 XHKUN342G7HYiwT3OxHnACoiLWGPpO9UWWSV0Px73qlxnLWFAMaudqzlG4JJxazpkO+xYsHCirA9E Frp+ZxqA==; Received: from 213-225-3-188.nat.highway.a1.net ([213.225.3.188] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nbyu6-003zG4-UT; Wed, 06 Apr 2022 06:12:31 +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 v3 Date: Wed, 6 Apr 2022 08:12:23 +0200 Message-Id: <20220406061228.410163-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 v2: - rebased to 5.18-rc1 - fix bio freeing in squashfs 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(-)