All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>
Cc: Damien Le Moal <damien.lemoal@wdc.com>,
	Naohiro Aota <naohiro.aota@wdc.com>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>,
	Qu Wenruo <wqu@suse.com>, Jens Axboe <axboe@kernel.dk>,
	"Darrick J. Wong" <djwong@kernel.org>,
	linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: consolidate btrfs checksumming, repair and bio splitting v2
Date: Sun, 20 Nov 2022 13:47:15 +0100	[thread overview]
Message-ID: <20221120124734.18634-1-hch@lst.de> (raw)

Hi all,

this series moves a large amount of duplicate code below btrfs_submit_bio
into what I call the 'storage' layer.  Instead of duplicating code to
checksum, check checksums and repair and split bios in all the caller
of btrfs_submit_bio (buffered I/O, direct I/O, compressed I/O, encoded
I/O), the work is done one in a central place, often more optiomal and
without slight changes in behavior.  Once that is done the upper layers
also don't need to split the bios for extent boundaries, as the storage
layer can do that itself, including splitting the bios for the zone
append limits for zoned I/O.

The split work is inspired by an earlier series from Qu, from which it
also reuses a few patches.

The rebasing against the latest misc-next was a bit painful due to the
various large cleanups, but very little logic changed, so I've kept the
review tags for now, but I'd appreciated another careful round of eyes.

A git tree is also available:

    git://git.infradead.org/users/hch/misc.git btrfs-bio-split

Gitweb:

    http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/btrfs-bio-split

Changes since v1:
 - rebased to latest btrfs/misc-next
 - added a new patch to remove the fs_info argument to btrfs_submit_bio
 - clean up the repair_one_sector calling convention a bit
 - don't move file_offset for ONE_ORDERED bios in btrfs_split_bio
 - temporarily use btrfs_zoned_get_device in alloc_compressed_bio
 - minor refactoring of some of the checksum helpers
 - split up a few patches
 - drop a few of the blk_status_t to int conversion for now
 - various whitespace fixes

Diffstat:
 block/blk-merge.c         |    3 
 fs/btrfs/bio.c            |  547 ++++++++++++++++++++++++++++++++++++----
 fs/btrfs/bio.h            |   67 +---
 fs/btrfs/btrfs_inode.h    |   22 -
 fs/btrfs/compression.c    |  273 +++-----------------
 fs/btrfs/compression.h    |    3 
 fs/btrfs/disk-io.c        |  199 +-------------
 fs/btrfs/disk-io.h        |   11 
 fs/btrfs/extent-io-tree.h |    1 
 fs/btrfs/extent_io.c      |  554 +++--------------------------------------
 fs/btrfs/extent_io.h      |   31 --
 fs/btrfs/file-item.c      |   74 +----
 fs/btrfs/file-item.h      |    8 
 fs/btrfs/fs.h             |    5 
 fs/btrfs/inode.c          |  621 ++++++----------------------------------------
 fs/btrfs/volumes.c        |  115 ++------
 fs/btrfs/volumes.h        |   18 -
 fs/btrfs/zoned.c          |   85 ++----
 fs/btrfs/zoned.h          |   16 -
 fs/iomap/direct-io.c      |   10 
 include/linux/bio.h       |    4 
 include/linux/iomap.h     |    1 
 22 files changed, 817 insertions(+), 1851 deletions(-)

             reply	other threads:[~2022-11-20 12:47 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-20 12:47 Christoph Hellwig [this message]
2022-11-20 12:47 ` [PATCH 01/19] block: export bio_split_rw Christoph Hellwig
2022-11-23 22:44   ` Chaitanya Kulkarni
2022-11-20 12:47 ` [PATCH 02/19] btrfs: handle checksum validation and repair at the storage layer Christoph Hellwig
2022-12-06 11:04   ` Johannes Thumshirn
2022-12-12 22:13   ` David Sterba
2022-12-13  5:53     ` Christoph Hellwig
2022-11-20 12:47 ` [PATCH 03/19] btrfs: remove the submit_bio_start helpers Christoph Hellwig
2022-12-06 11:13   ` Johannes Thumshirn
2022-11-20 12:47 ` [PATCH 04/19] btrfs: simplify the btrfs_csum_one_bio calling convention Christoph Hellwig
2022-12-06 11:16   ` Johannes Thumshirn
2022-11-20 12:47 ` [PATCH 05/19] btrfs: handle checksum generation in the storage layer Christoph Hellwig
2022-12-06 11:21   ` Johannes Thumshirn
2022-11-20 12:47 ` [PATCH 06/19] btrfs: handle recording of zoned writes " Christoph Hellwig
2022-11-20 12:47 ` [PATCH 07/19] btrfs: support cloned bios in btree_csum_one_bio Christoph Hellwig
2022-12-06 11:23   ` Johannes Thumshirn
2022-11-20 12:47 ` [PATCH 08/19] btrfs: allow btrfs_submit_bio to split bios Christoph Hellwig
2022-11-20 12:47 ` [PATCH 09/19] btrfs: pass the iomap bio to btrfs_submit_bio Christoph Hellwig
2022-12-06 11:27   ` Johannes Thumshirn
2022-11-20 12:47 ` [PATCH 10/19] btrfs: remove stripe boundary calculation for buffered I/O Christoph Hellwig
2022-12-06 11:29   ` Johannes Thumshirn
2022-11-20 12:47 ` [PATCH 11/19] btrfs: remove stripe boundary calculation for compressed I/O Christoph Hellwig
2022-11-20 12:47 ` [PATCH 12/19] btrfs: remove stripe boundary calculation for encoded I/O Christoph Hellwig
2022-11-20 12:47 ` [PATCH 13/19] btrfs: remove struct btrfs_io_geometry Christoph Hellwig
2022-12-06 11:41   ` Johannes Thumshirn
2022-11-20 12:47 ` [PATCH 14/19] btrfs: remove submit_encoded_read_bio Christoph Hellwig
2022-11-20 12:47 ` [PATCH 15/19] btrfs: remove the fs_info argument to btrfs_submit_bio Christoph Hellwig
2022-12-06 11:42   ` Johannes Thumshirn
2022-11-20 12:47 ` [PATCH 16/19] btrfs: remove now spurious bio submission helpers Christoph Hellwig
2022-11-20 12:47 ` [PATCH 17/19] btrfs: calculate file system wide queue limit for zoned mode Christoph Hellwig
2022-12-06 11:46   ` Johannes Thumshirn
2022-11-20 12:47 ` [PATCH 18/19] btrfs: split zone append bios in btrfs_submit_bio Christoph Hellwig
2022-12-06 11:51   ` Johannes Thumshirn
2022-11-20 12:47 ` [PATCH 19/19] iomap: remove IOMAP_F_ZONE_APPEND Christoph Hellwig
2022-11-21 17:07   ` Darrick J. Wong
2022-11-23 22:44   ` Chaitanya Kulkarni
2022-12-12 18:46 ` consolidate btrfs checksumming, repair and bio splitting v2 Josef Bacik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221120124734.18634-1-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=clm@fb.com \
    --cc=damien.lemoal@wdc.com \
    --cc=djwong@kernel.org \
    --cc=dsterba@suse.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=naohiro.aota@wdc.com \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.