linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: check/original: Remove unused variable first_key
@ 2018-03-22  9:06 Qu Wenruo
  2018-03-26 13:24 ` David Sterba
  0 siblings, 1 reply; 2+ messages in thread
From: Qu Wenruo @ 2018-03-22  9:06 UTC (permalink / raw)
  To: linux-btrfs

This @first_key variable is introduced in f5c4c4f3b75b
("btrfsck: add code to rebuild extent records"), however it's not only
unused, but also used incorrectly.

It's calling btrfs_item_key_to_cpu() on an node extent buffer.

Anyway, just remove it.

Fixes: f5c4c4f3b75b ("btrfsck: add code to rebuild extent records")
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 check/main.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/check/main.c b/check/main.c
index b476e07ba9e7..891a6d797756 100644
--- a/check/main.c
+++ b/check/main.c
@@ -6103,12 +6103,7 @@ static int run_next_block(struct btrfs_root *root,
 		}
 	} else {
 		int level;
-		struct btrfs_key first_key;
 
-		first_key.objectid = 0;
-
-		if (nritems > 0)
-			btrfs_item_key_to_cpu(buf, &first_key, 0);
 		level = btrfs_header_level(buf);
 		for (i = 0; i < nritems; i++) {
 			struct extent_record tmpl;
-- 
2.16.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs-progs: check/original: Remove unused variable first_key
  2018-03-22  9:06 [PATCH] btrfs-progs: check/original: Remove unused variable first_key Qu Wenruo
@ 2018-03-26 13:24 ` David Sterba
  0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2018-03-26 13:24 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs

On Thu, Mar 22, 2018 at 05:06:24PM +0800, Qu Wenruo wrote:
> This @first_key variable is introduced in f5c4c4f3b75b
> ("btrfsck: add code to rebuild extent records"), however it's not only
> unused, but also used incorrectly.
> 
> It's calling btrfs_item_key_to_cpu() on an node extent buffer.
> 
> Anyway, just remove it.
> 
> Fixes: f5c4c4f3b75b ("btrfsck: add code to rebuild extent records")
> Signed-off-by: Qu Wenruo <wqu@suse.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-26 13:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-22  9:06 [PATCH] btrfs-progs: check/original: Remove unused variable first_key Qu Wenruo
2018-03-26 13:24 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).