On Wed, Nov 24, 2021 at 01:30:30AM -0800, Johannes Thumshirn wrote:
quoted hunk ↗ jump to hunk
REQ_OP_ZONE_APPEND can only work on zoned devices, so it is redundant to
check if the filesystem is zoned when REQ_OP_ZONE_APPEND is set as the
bio's bio_op.
Signed-off-by: Johannes Thumshirn <redacted>
---
fs/btrfs/extent_io.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 96c2e40887772..d5eb31306c448 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3282,8 +3282,7 @@ static int calc_bio_boundaries(struct btrfs_bio_ctrl *bio_ctrl,
else
bio_ctrl->len_to_stripe_boundary = (u32)geom.len;
- if (!btrfs_is_zoned(fs_info) ||
- bio_op(bio_ctrl->bio) != REQ_OP_ZONE_APPEND) {
+ if (bio_op(bio_ctrl->bio) != REQ_OP_ZONE_APPEND) {
As for this style of open coded conditions, I think it's fine in
functions that handle bios or the REQ_OPs anyway, so like here. Removing
redundant conditions is correct too.
bio_ctrl->len_to_oe_boundary = U32_MAX;
return 0;
}