On Sat, May 26, 2018 at 03:48:31PM +0300, Nikolay Borisov wrote:
> > + ret = log_extent_csums(trans, inode, root, em);
>
> With the following minor diff:
>
> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
> index daf32dc94dc3..34d5b0630824 100644
> --- a/fs/btrfs/tree-log.c
> +++ b/fs/btrfs/tree-log.c
>
> @@ -4064,11 +4064,9 @@ static int extent_cmp(void *priv, struct list_head *a, struct list_head *b)
>
> static int log_extent_csums(struct btrfs_trans_handle *trans,
> struct btrfs_inode *inode,
> - struct btrfs_root *root,
> + struct btrfs_root *log,
> const struct extent_map *em)
> {
> - struct btrfs_fs_info *fs_info = root->fs_info;
> - struct btrfs_root *log = root->log_root;
> u64 csum_offset;
> u64 csum_len;
> LIST_HEAD(ordered_sums);
> @@ -4089,7 +4087,7 @@ static int log_extent_csums(struct btrfs_trans_handle *trans,
> }
>
> /* block start is already adjusted for the file extent offset. */
> - ret = btrfs_lookup_csums_range(fs_info->csum_root,
> + ret = btrfs_lookup_csums_range(trans->fs_info->csum_root,
> em->block_start + csum_offset,
> em->block_start + csum_offset +
> csum_len - 1, &ordered_sums, 0);
> @@ -4125,7 +4123,7 @@ static int log_one_extent(struct btrfs_trans_handle *trans,
> int ret;
> int extent_inserted = 0;
>
> - ret = log_extent_csums(trans, inode, root, em);
> + ret = log_extent_csums(trans, inode, log, em);
> if (ret)
> return ret;
>
> Bloat-o-meter reports:
>
> add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-55 (-55)
> Function old new delta
> btrfs_log_changed_extents.isra 4298 4243 -55
> Total: Before=64999, After=64944, chg -0.08%
>
> I suggest you incorporate it in the patch
The patches are in misc-next now, please send that as a separate patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html