Received: by 2002:a05:6a10:144:0:0:0:0 with SMTP id 4csp1302236pxw; Sat, 9 Apr 2022 19:16:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaCHWHZLzrrPrTbo7nxmEVHZ/vEJQ8/hl6oN8dKPoeMhFrIoyIMAhaXB/gnUhiAGoduUeY X-Received: by 2002:a17:903:18d:b0:156:1262:9714 with SMTP id z13-20020a170903018d00b0015612629714mr26791150plg.20.1649557006409; Sat, 09 Apr 2022 19:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649557006; cv=none; d=google.com; s=arc-20160816; b=RTfNcDjqpyumrPS6yftUVDCZP1PQ1FFSpXdmmWKvMblKsBhFU0+G7BRx95+XGhbw1x dZU3d3wgeNy0XXRqr4uVNBcig35/AmnqBhzS1qtfCNIxLI5Mf8dd1A1tS2iwSr+RrchD m8kyDr4SRzuW4UBKA/lyzAWKeHPD4YR1oEBWMJjpwSMNe4D9Pb87Y1j3x9hob3vuw77m O1qpMpFZG8Lr+tCKevTrkSoXQEnmtqX6aAZOdKhiv75fMJVfj74Q1J+bcnpRSt4QKjIM bu0EIoBMPuw19lb8FFcsIMokRbcGuOAStVyuXR7pMAcscrh/1C2oR6LnFnLdADFjQ2Ka JHrw== 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=xqCE7mrNhx9Kh54A8pTQxucRKOOrbbHmaHFew3/JwbI=; b=tXjNMlffrqLIsUpdjxfz1EFi4vdXLuLlu1kaXFJ0J1Os+3samsO5IPe+OYitGMJ8+L PaLLsKnwWf2RPW5g3Dwn4KaTw/2aOVc5SibExcqpj8zznrVlQ5zcH13IMVkJoxpYIdal SR339nPrcxvPwweDNOQgh1tPrhR9mOv/0gtfQSpmlxJ/dOMnC89n6k74u3mw472gICM6 yXW7NyyA57avAU/ncEBPyo+NY2gL37/jntG5KWFMpxT04rFDIfwomeyJyPtJSY/y/SE+ u/ADZCx5ANuJ4snZDow824dfFguSef1lf35kd+wSFJIbrARwbXNr6N3qUry3F3kqIctv uAIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=eautlETA; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 q18-20020a170902f35200b00153b2d16643si4090920ple.587.2022.04.09.19.16.26; Sat, 09 Apr 2022 19:16:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=eautlETA; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237062AbiDIExA (ORCPT + 99 others); Sat, 9 Apr 2022 00:53:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiDIEw6 (ORCPT ); Sat, 9 Apr 2022 00:52:58 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A77A3186F5; Fri, 8 Apr 2022 21:50:51 -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=xqCE7mrNhx9Kh54A8pTQxucRKOOrbbHmaHFew3/JwbI=; b=eautlETAmAcOF4Rx+ajcsxqxAt K/gc85CxDlYY+s5RX+TP4qAcopFOJMKyRoUbJGCZqLzThYN44a81gHztvDtTQOXXVmstC/BiZza91 +tK8A4YQHg+wud7jKaqcpT5eZw97ewGrhmTU8yf0v/D+yZnMWYW/4nRrMz5fe0RjHIwwo6UCcWnmG q/WhOest1iceY98x52QbO+Ryd19aUS/0aFt0A0VdCFkKu7+7IrcjV/rCpnun6L4B6SbhX7D4hKxqE vkbaC7lWGA+28JjJD9laatsN4l8Gz9BZIOD3BKi8HF53h/Wb9nBnpD0TIdhkMhGAybm9Za6sdmIlK tpLM1eWg==; Received: from 213-147-167-116.nat.highway.webapn.at ([213.147.167.116] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1nd33f-0020RM-19; Sat, 09 Apr 2022 04:50:47 +0000 From: Christoph Hellwig To: Jens Axboe Cc: dm-devel@redhat.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-um@lists.infradead.org, linux-block@vger.kernel.org, drbd-dev@lists.linbit.com, nbd@other.debian.org, ceph-devel@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, jfs-discussion@lists.sourceforge.net, linux-nilfs@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org Subject: use block_device based APIs in block layer consumers v2 Date: Sat, 9 Apr 2022 06:50:16 +0200 Message-Id: <20220409045043.23593-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-ext4@vger.kernel.org Hi Jens, this series cleanups up the block layer API so that APIs consumed by file systems are (almost) only struct block_devic based, so that file systems don't have to poke into block layer internals like the request_queue. I also found a bunch of existing bugs related to partition offsets and discard so these are fixed while going along. Changes since v1: - fix a bisection hazard - minor spelling fixes - reorder hunks between two patches to make the changes more obvious - reorder a patch to be earlier in the series to ease backporting Diffstat: arch/um/drivers/ubd_kern.c | 2 block/blk-core.c | 4 - block/blk-lib.c | 124 ++++++++++++++++++++--------------- block/blk-mq-debugfs.c | 2 block/blk-settings.c | 74 ++++++++++++++++++++ block/blk.h | 14 --- block/fops.c | 2 block/genhd.c | 4 - block/ioctl.c | 48 ++++++++++--- block/partitions/core.c | 12 --- drivers/block/drbd/drbd_main.c | 51 ++++++-------- drivers/block/drbd/drbd_nl.c | 94 +++++++++++--------------- drivers/block/drbd/drbd_receiver.c | 13 +-- drivers/block/loop.c | 15 +--- drivers/block/nbd.c | 5 - drivers/block/null_blk/main.c | 1 drivers/block/rbd.c | 1 drivers/block/rnbd/rnbd-clt.c | 6 - drivers/block/rnbd/rnbd-srv-dev.h | 8 -- drivers/block/rnbd/rnbd-srv.c | 5 - drivers/block/virtio_blk.c | 2 drivers/block/xen-blkback/blkback.c | 15 ++-- drivers/block/xen-blkback/xenbus.c | 9 -- drivers/block/xen-blkfront.c | 7 - drivers/block/zram/zram_drv.c | 1 drivers/md/bcache/alloc.c | 2 drivers/md/bcache/request.c | 4 - drivers/md/bcache/super.c | 3 drivers/md/bcache/sysfs.c | 2 drivers/md/dm-cache-target.c | 9 -- drivers/md/dm-clone-target.c | 9 -- drivers/md/dm-io.c | 2 drivers/md/dm-log-writes.c | 3 drivers/md/dm-raid.c | 9 -- drivers/md/dm-table.c | 25 +------ drivers/md/dm-thin.c | 15 ---- drivers/md/dm.c | 3 drivers/md/md-linear.c | 11 --- drivers/md/md.c | 5 - drivers/md/raid0.c | 7 - drivers/md/raid1.c | 18 ----- drivers/md/raid10.c | 20 ----- drivers/md/raid5-cache.c | 8 +- drivers/md/raid5.c | 14 +-- drivers/mmc/core/queue.c | 3 drivers/mtd/mtd_blkdevs.c | 1 drivers/nvme/host/core.c | 6 - drivers/nvme/target/io-cmd-bdev.c | 2 drivers/nvme/target/zns.c | 3 drivers/s390/block/dasd_fba.c | 1 drivers/scsi/sd.c | 2 drivers/target/target_core_device.c | 20 ++--- drivers/target/target_core_file.c | 10 +- drivers/target/target_core_iblock.c | 17 +--- fs/btrfs/disk-io.c | 3 fs/btrfs/extent-tree.c | 8 +- fs/btrfs/ioctl.c | 12 +-- fs/btrfs/volumes.c | 4 - fs/btrfs/zoned.c | 3 fs/direct-io.c | 32 +-------- fs/exfat/file.c | 5 - fs/exfat/super.c | 10 -- fs/ext4/ioctl.c | 10 -- fs/ext4/mballoc.c | 10 +- fs/ext4/super.c | 10 -- fs/f2fs/f2fs.h | 3 fs/f2fs/file.c | 19 ++--- fs/f2fs/segment.c | 8 -- fs/fat/file.c | 5 - fs/fat/inode.c | 10 -- fs/gfs2/rgrp.c | 7 - fs/iomap/direct-io.c | 3 fs/jbd2/journal.c | 9 -- fs/jfs/ioctl.c | 5 - fs/jfs/super.c | 8 -- fs/nilfs2/ioctl.c | 6 - fs/nilfs2/sufile.c | 4 - fs/nilfs2/the_nilfs.c | 4 - fs/ntfs3/file.c | 6 - fs/ntfs3/super.c | 10 +- fs/ocfs2/ioctl.c | 5 - fs/super.c | 2 fs/xfs/xfs_discard.c | 8 +- fs/xfs/xfs_log_cil.c | 2 fs/xfs/xfs_super.c | 12 +-- fs/zonefs/super.c | 3 include/linux/blkdev.h | 112 +++++++++++-------------------- include/target/target_core_backend.h | 4 - mm/swapfile.c | 31 ++------ 89 files changed, 493 insertions(+), 653 deletions(-)