summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/compression.c
diff options
context:
space:
mode:
authorNikolay Borisov2019-03-20 20:53:16 +0100
committerDavid Sterba2019-04-29 19:02:24 +0200
commit6a8d2136ca3f0ed597d9f3dffa3821dd6bc7b11a (patch)
treeb04ab7976a816d4eff807b59edc90571e2b4b5d5 /fs/btrfs/compression.c
parentbtrfs: extent_io: Handle errors better in extent_writepages() (diff)
downloadkernel-qcow2-linux-6a8d2136ca3f0ed597d9f3dffa3821dd6bc7b11a.tar.gz
kernel-qcow2-linux-6a8d2136ca3f0ed597d9f3dffa3821dd6bc7b11a.tar.xz
kernel-qcow2-linux-6a8d2136ca3f0ed597d9f3dffa3821dd6bc7b11a.zip
btrfs: Use less confusing condition for uptodate parameter to btrfs_writepage_endio_finish_ordered
The uptodate parameter of btrfs_writepage_endio_finish_ordered is used to signal whether an error has occured while writing the given page. 0 signals an error, which is propagated to callees and 1 signifies success. In end_compressed_bio_write the ->bi_status is checked and based on it either BLK_STS_OK (0) or BLK_STS_NOTSUPP (1) are used. While from functional point of view this is ok it's a for the poor reader of the code, since the block layer values are conflated with the semantics of the parameter. Just use plain 0 or 1. No functional changes. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r--fs/btrfs/compression.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 4f2a8ae0aa42..1463e14af2fb 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -251,7 +251,7 @@ static void end_compressed_bio_write(struct bio *bio)
cb->compressed_pages[0]->mapping = cb->inode->i_mapping;
btrfs_writepage_endio_finish_ordered(cb->compressed_pages[0],
cb->start, cb->start + cb->len - 1,
- bio->bi_status ? BLK_STS_OK : BLK_STS_NOTSUPP);
+ bio->bi_status == BLK_STS_OK);
cb->compressed_pages[0]->mapping = NULL;
end_compressed_writeback(inode, cb);