summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2018-11-22 17:16:49 +0100
committerDavid Sterba <dsterba@suse.com>2018-12-17 14:51:40 +0100
commitb3a0dd50c3951ec1b9a12ec39034194022fd8693 (patch)
tree10898fe39a7737103169898b38a753db0b92aded /fs/btrfs/file-item.c
parent31fecccbd7b2174487a6b7361153b60a4eda6108 (diff)
downloadlinux-stable-b3a0dd50c3951ec1b9a12ec39034194022fd8693.tar.gz
linux-stable-b3a0dd50c3951ec1b9a12ec39034194022fd8693.tar.bz2
linux-stable-b3a0dd50c3951ec1b9a12ec39034194022fd8693.zip
btrfs: replace btrfs_io_bio::end_io with a simple helper
The end_io callback implemented as btrfs_io_bio_endio_readpage only calls kfree. Also the callback is set only in case the csum buffer is allocated and not pointing to the inline buffer. We can use that information to drop the indirection and call a helper that will free the csums only in the right case. This shrinks struct btrfs_io_bio by 8 bytes. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r--fs/btrfs/file-item.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 1f2d0a6ab634..920bf3b4b0ef 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -142,14 +142,6 @@ int btrfs_lookup_file_extent(struct btrfs_trans_handle *trans,
return ret;
}
-static void btrfs_io_bio_endio_readpage(struct btrfs_io_bio *bio, int err)
-{
- if (bio->csum != bio->csum_inline) {
- kfree(bio->csum);
- bio->csum = NULL;
- }
-}
-
static blk_status_t __btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio,
u64 logical_offset, u32 *dst, int dio)
{
@@ -184,7 +176,6 @@ static blk_status_t __btrfs_lookup_bio_sums(struct inode *inode, struct bio *bio
btrfs_free_path(path);
return BLK_STS_RESOURCE;
}
- btrfs_bio->end_io = btrfs_io_bio_endio_readpage;
} else {
btrfs_bio->csum = btrfs_bio->csum_inline;
}