Message ID | 20241031115210.1965033-1-maharmstone@fb.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: avoid superfluous calls to free_extent_map() in btrfs_encoded_read() | expand |
On Thu, Oct 31, 2024 at 11:52:05AM +0000, Mark Harmstone wrote: > 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. > > Signed-off-by: Mark Harmstone <maharmstone@fb.com> > Suggested-by: Anand Jain <anand.jain@oracle.com> Added to for-next, thanks.
On 31/10/24 19:52, Mark Harmstone wrote: > 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. > > Signed-off-by: Mark Harmstone <maharmstone@fb.com> > Suggested-by: Anand Jain <anand.jain@oracle.com> Sorry for the late rb. Reviewed-by: Anand Jain <anand.jain@oracle.com> > --- > fs/btrfs/inode.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c > index 40f278821144..fc21e8519efe 100644 > --- a/fs/btrfs/inode.c > +++ b/fs/btrfs/inode.c > @@ -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; > } > > /* > @@ -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:
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 40f278821144..fc21e8519efe 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -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; } /* @@ -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:
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. Signed-off-by: Mark Harmstone <maharmstone@fb.com> Suggested-by: Anand Jain <anand.jain@oracle.com> --- fs/btrfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)