All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Nikolay Borisov <nborisov@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 4/8] btrfs-progs: Remove root argument from btrfs_truncate_item
Date: Tue, 14 Sep 2021 09:02:48 +0800	[thread overview]
Message-ID: <dd4e6c86-e5fe-adf4-326d-3d9500cd7187@gmx.com> (raw)
In-Reply-To: <20210913131729.37897-5-nborisov@suse.com>



On 2021/9/13 下午9:17, Nikolay Borisov wrote:
> This function lies in the kernel-shared directory and is supposed to be
> close to 1:1 copy with its kernel counterpart, yet it takes one extra
> argument - root. But this is now unused to simply remove it.
>
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>   kernel-shared/ctree.c       | 3 +--
>   kernel-shared/ctree.h       | 3 +--
>   kernel-shared/dir-item.c    | 2 +-
>   kernel-shared/extent-tree.c | 2 +-
>   kernel-shared/file-item.c   | 4 ++--
>   kernel-shared/inode-item.c  | 4 ++--
>   6 files changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/kernel-shared/ctree.c b/kernel-shared/ctree.c
> index 77766c2a7931..78f94c6cd42f 100644
> --- a/kernel-shared/ctree.c
> +++ b/kernel-shared/ctree.c
> @@ -2545,8 +2545,7 @@ int btrfs_split_item(struct btrfs_trans_handle *trans,
>   	return ret;
>   }
>
> -int btrfs_truncate_item(struct btrfs_root *root, struct btrfs_path *path,
> -			u32 new_size, int from_end)
> +int btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end)
>   {
>   	int ret = 0;
>   	int slot;
> diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
> index a17bf50e29b4..91a85796a678 100644
> --- a/kernel-shared/ctree.h
> +++ b/kernel-shared/ctree.h
> @@ -2670,8 +2670,7 @@ int btrfs_create_root(struct btrfs_trans_handle *trans,
>   		      struct btrfs_fs_info *fs_info, u64 objectid);
>   int btrfs_extend_item(struct btrfs_root *root, struct btrfs_path *path,
>   		u32 data_size);
> -int btrfs_truncate_item(struct btrfs_root *root, struct btrfs_path *path,
> -			u32 new_size, int from_end);
> +int btrfs_truncate_item(struct btrfs_path *path, u32 new_size, int from_end);
>   int btrfs_split_item(struct btrfs_trans_handle *trans,
>   		     struct btrfs_root *root,
>   		     struct btrfs_path *path,
> diff --git a/kernel-shared/dir-item.c b/kernel-shared/dir-item.c
> index 7dc606c132b5..590b79a929d3 100644
> --- a/kernel-shared/dir-item.c
> +++ b/kernel-shared/dir-item.c
> @@ -284,7 +284,7 @@ int btrfs_delete_one_dir_name(struct btrfs_trans_handle *trans,
>   		start = btrfs_item_ptr_offset(leaf, path->slots[0]);
>   		memmove_extent_buffer(leaf, ptr, ptr + sub_item_len,
>   			item_len - (ptr + sub_item_len - start));
> -		btrfs_truncate_item(root, path, item_len - sub_item_len, 1);
> +		btrfs_truncate_item(path, item_len - sub_item_len, 1);
>   	}
>   	return ret;
>   }
> diff --git a/kernel-shared/extent-tree.c b/kernel-shared/extent-tree.c
> index 056a9256b9a4..a8e0c1e60e2e 100644
> --- a/kernel-shared/extent-tree.c
> +++ b/kernel-shared/extent-tree.c
> @@ -1166,7 +1166,7 @@ static int update_inline_extent_backref(struct btrfs_trans_handle *trans,
>   			memmove_extent_buffer(leaf, ptr, ptr + size,
>   					      end - ptr - size);
>   		item_size -= size;
> -		ret = btrfs_truncate_item(root, path, item_size, 1);
> +		ret = btrfs_truncate_item(path, item_size, 1);
>   		BUG_ON(ret);
>   	}
>   	btrfs_mark_buffer_dirty(leaf);
> diff --git a/kernel-shared/file-item.c b/kernel-shared/file-item.c
> index 7e16b747e36c..c910e27e5a5d 100644
> --- a/kernel-shared/file-item.c
> +++ b/kernel-shared/file-item.c
> @@ -362,7 +362,7 @@ static noinline int truncate_one_csum(struct btrfs_root *root,
>   		 */
>   		u32 new_size = (bytenr - key->offset) / blocksize;
>   		new_size *= csum_size;
> -		ret = btrfs_truncate_item(root, path, new_size, 1);
> +		ret = btrfs_truncate_item(path, new_size, 1);
>   		BUG_ON(ret);
>   	} else if (key->offset >= bytenr && csum_end > end_byte &&
>   		   end_byte > key->offset) {
> @@ -375,7 +375,7 @@ static noinline int truncate_one_csum(struct btrfs_root *root,
>   		u32 new_size = (csum_end - end_byte) / blocksize;
>   		new_size *= csum_size;
>
> -		ret = btrfs_truncate_item(root, path, new_size, 0);
> +		ret = btrfs_truncate_item(path, new_size, 0);
>   		BUG_ON(ret);
>
>   		key->offset = end_byte;
> diff --git a/kernel-shared/inode-item.c b/kernel-shared/inode-item.c
> index 4e009746de0e..67173eb141d8 100644
> --- a/kernel-shared/inode-item.c
> +++ b/kernel-shared/inode-item.c
> @@ -311,7 +311,7 @@ int btrfs_del_inode_extref(struct btrfs_trans_handle *trans,
>   	memmove_extent_buffer(leaf, ptr, ptr + del_len,
>   			      item_size - (ptr + del_len - item_start));
>
> -	btrfs_truncate_item(root, path, item_size - del_len, 1);
> +	btrfs_truncate_item(path, item_size - del_len, 1);
>
>   out:
>   	btrfs_free_path(path);
> @@ -432,7 +432,7 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans,
>   	item_start = btrfs_item_ptr_offset(leaf, path->slots[0]);
>   	memmove_extent_buffer(leaf, ptr, ptr + sub_item_len,
>   			      item_size - (ptr + sub_item_len - item_start));
> -	btrfs_truncate_item(root, path, item_size - sub_item_len, 1);
> +	btrfs_truncate_item(path, item_size - sub_item_len, 1);
>   	btrfs_mark_buffer_dirty(path->nodes[0]);
>   out:
>   	btrfs_free_path(path);
>

  reply	other threads:[~2021-09-14  1:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-13 13:17 [PATCH 0/8] Implement progs support for removing received uuid on RW vols Nikolay Borisov
2021-09-13 13:17 ` [PATCH 1/8] btrfs-progs: Add btrfs_is_empty_uuid Nikolay Borisov
2021-09-14  0:58   ` Qu Wenruo
2021-09-13 13:17 ` [PATCH 2/8] btrfs-progs: Remove root argument from btrfs_fixup_low_keys Nikolay Borisov
2021-09-14  1:01   ` Qu Wenruo
2021-09-13 13:17 ` [PATCH 3/8] btrfs-progs: Remove fs_info argument from leaf_data_end Nikolay Borisov
2021-09-14  1:02   ` Qu Wenruo
2021-09-13 13:17 ` [PATCH 4/8] btrfs-progs: Remove root argument from btrfs_truncate_item Nikolay Borisov
2021-09-14  1:02   ` Qu Wenruo [this message]
2021-09-13 13:17 ` [PATCH 5/8] btrfs-progs: Add btrfs_uuid_tree_remove Nikolay Borisov
2021-09-14  1:07   ` Qu Wenruo
2021-09-14  4:49     ` Nikolay Borisov
2021-09-14  4:57       ` Qu Wenruo
2021-09-13 13:17 ` [PATCH 6/8] btrfs-progs: check/original: Implement removing received data for RW subvols Nikolay Borisov
2021-09-13 13:17 ` [PATCH 7/8] btrfs-progs: check/lowmem: Implement received info clearing for RW volumes Nikolay Borisov
2021-09-13 13:17 ` [PATCH 8/8] btrfs-progs: tests: Add test for received information removal Nikolay Borisov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd4e6c86-e5fe-adf4-326d-3d9500cd7187@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.