Skip to content

Commit

Permalink
btrfs: avoid superfluous calls to free_extent_map() in btrfs_encoded_…
Browse files Browse the repository at this point in the history
…read()

Change the control flow of btrfs_encoded_read() so that it doesn't call
free_extent_map() when we know that this has already been done.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Mark Harmstone <maharmstone@fb.com>
Suggested-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Mark Harmstone authored and David Sterba committed Nov 11, 2024
1 parent e36d114 commit 08fdca9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -9324,7 +9324,7 @@ ssize_t btrfs_encoded_read(struct kiocb *iocb, struct iov_iter *iter,
ret = btrfs_encoded_read_inline(iocb, iter, start, lockend,
cached_state, extent_start,
count, encoded, &unlocked);
goto out_em;
goto out_unlock_extent;
}

/*
Expand Down Expand Up @@ -9384,7 +9384,7 @@ ssize_t btrfs_encoded_read(struct kiocb *iocb, struct iov_iter *iter,
ret = -EFAULT;
} else {
ret = -EIOCBQUEUED;
goto out_em;
goto out_unlock_extent;
}

out_em:
Expand Down

0 comments on commit 08fdca9

Please sign in to comment.