summaryrefslogtreecommitdiff
path: root/fs/btrfs/compression.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-07-07 07:33:27 +0200
committerDavid Sterba <dsterba@suse.com>2022-07-25 19:54:47 +0200
commit524bcd1e178da1dccf24d9fc60fb20a35ec45e88 (patch)
tree9331397638556fcb0a32b112b2cdc5294d8c9a9e /fs/btrfs/compression.h
parentc144c63fd33a1fc0e43e0b851a35b09c9460d94d (diff)
btrfs: simplify the pending I/O counting in struct compressed_bio
Instead of counting the sectors just count the bios, with an extra reference held during submission. This significantly simplifies the submission side error handling. This slightly changes completion and error handling of btrfs_submit_compressed_{read,write} because with the old code the compressed_bio could have been completed in submit_compressed_{read,write} only if there was an error during submission for one of the lower bio, whilst with the new code there is a chance for this to happen even for successful submission if the all the lower bios complete before the end of the function is reached. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Boris Burkov <boris@bur.io> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.h')
-rw-r--r--fs/btrfs/compression.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index 5fca7603e928..0e4cbf04fd86 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -30,8 +30,8 @@ static_assert((BTRFS_MAX_COMPRESSED % PAGE_SIZE) == 0);
#define BTRFS_ZLIB_DEFAULT_LEVEL 3
struct compressed_bio {
- /* Number of sectors with unfinished IO (unsubmitted or unfinished) */
- refcount_t pending_sectors;
+ /* Number of outstanding bios */
+ refcount_t pending_ios;
/* Number of compressed pages in the array */
unsigned int nr_pages;