summaryrefslogtreecommitdiff
path: root/fs/btrfs/compression.h
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2021-09-27 10:21:55 +0300
committerDavid Sterba <dsterba@suse.com>2021-10-26 20:08:04 +0300
commit91507240482ef7a0121efb858c64e3c456b4d1ba (patch)
tree2eef984201058f01766952ec037a1d1add22b3cb /fs/btrfs/compression.h
parentf472c28f2e883c3d2781ea6aaaca204e34e93b63 (diff)
downloadlinux-91507240482ef7a0121efb858c64e3c456b4d1ba.tar.xz
btrfs: determine stripe boundary at bio allocation time in btrfs_submit_compressed_write
Currently btrfs_submit_compressed_write() will check btrfs_bio_fits_in_stripe() each time a new page is going to be added. Even if compressed extent is small, we don't really need to do that for every page. Align the behavior to extent_io.c, by determining the stripe boundary when allocating a bio. Unlike extent_io.c, in compressed.c we don't need to bother things like different bio flags, thus no need to re-use bio_ctrl. Here we just manually introduce new local variable, next_stripe_start, and use that value returned from alloc_compressed_bio() to calculate the stripe boundary. Then each time we add some page range into the bio, we check if we reached the boundary. And if reached, submit it. Also, since we have @cur_disk_bytenr to determine whether we're the last bio, we don't need a explicit last_bio: tag for error handling any more. And since we use @cur_disk_bytenr to wait, there is no need for pending_bios, also remove it to save some memory of compressed_bio. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.h')
-rw-r--r--fs/btrfs/compression.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index 28a558433120..56eef0821e3e 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -28,9 +28,6 @@ struct btrfs_inode;
#define BTRFS_ZLIB_DEFAULT_LEVEL 3
struct compressed_bio {
- /* Number of bios pending for this compressed extent */
- atomic_t pending_bios;
-
/* Number of sectors with unfinished IO (unsubmitted or unfinished) */
refcount_t pending_sectors;