All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs-progs: remove btrfs_release_path before btrfs_free_path
@ 2014-09-04  3:09 Gui Hecheng
  2014-09-04  3:09 ` [PATCH] btrfs-progs: remove wrong set_argv0 for restore Gui Hecheng
  0 siblings, 1 reply; 2+ messages in thread
From: Gui Hecheng @ 2014-09-04  3:09 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Gui Hecheng

The btrfs_free_path calls btrfs_release_path internally.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
---
 disk-io.c   | 1 -
 file-item.c | 1 -
 inode-map.c | 2 --
 3 files changed, 4 deletions(-)

diff --git a/disk-io.c b/disk-io.c
index 9e44f10..0f9f374 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -628,7 +628,6 @@ struct btrfs_root *btrfs_read_fs_root_no_cache(struct btrfs_fs_info *fs_info,
 	memcpy(&root->root_key, location, sizeof(*location));
 	ret = 0;
 out:
-	btrfs_release_path(path);
 	btrfs_free_path(path);
 	if (ret) {
 		free(root);
diff --git a/file-item.c b/file-item.c
index 6f3708b..b46d7f1 100644
--- a/file-item.c
+++ b/file-item.c
@@ -306,7 +306,6 @@ found:
 			    csum_size);
 	btrfs_mark_buffer_dirty(path->nodes[0]);
 fail:
-	btrfs_release_path(path);
 	btrfs_free_path(path);
 	return ret;
 }
diff --git a/inode-map.c b/inode-map.c
index 3e138b5..1321bfb 100644
--- a/inode-map.c
+++ b/inode-map.c
@@ -90,12 +90,10 @@ int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
 	// FIXME -ENOSPC
 found:
 	root->last_inode_alloc = *objectid;
-	btrfs_release_path(path);
 	btrfs_free_path(path);
 	BUG_ON(*objectid < search_start);
 	return 0;
 error:
-	btrfs_release_path(path);
 	btrfs_free_path(path);
 	return ret;
 }
-- 
1.8.1.4


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

* [PATCH] btrfs-progs: remove wrong set_argv0 for restore
  2014-09-04  3:09 [PATCH] btrfs-progs: remove btrfs_release_path before btrfs_free_path Gui Hecheng
@ 2014-09-04  3:09 ` Gui Hecheng
  0 siblings, 0 replies; 2+ messages in thread
From: Gui Hecheng @ 2014-09-04  3:09 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Gui Hecheng

Before this patch, you could see the following after exec restore
	# :too few arguments

The tool name "btrfs restore" is missing.

The @set_argv0() function is introduced by:
	commit a184abc70f7b1468e6036ab576f1587ee0574668
	btrfs-progs: move the check_argc_* functions into utils.c
	...
	Also add a new function "set_argv0" to set the correct tool name:
        *btrfs-image*: too few arguments

But @set_argv0() only applies to the independent tools with
the name pattern btrfs-***.
Since restore is now is subcommand under "btrfs",
there is no need to use @set_argv0() before check_argc_* to
repair the prompt tool name before "too few arguments".

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
---
 cmds-restore.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/cmds-restore.c b/cmds-restore.c
index f909429..38a131e 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -1229,7 +1229,6 @@ int cmd_restore(int argc, char **argv)
 		}
 	}
 
-	set_argv0(argv);
 	if (!list_roots && check_argc_min(argc - optind, 2))
 		usage(cmd_restore_usage);
 	else if (list_roots && check_argc_min(argc - optind, 1))
-- 
1.8.1.4


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

end of thread, other threads:[~2014-09-04  3:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-04  3:09 [PATCH] btrfs-progs: remove btrfs_release_path before btrfs_free_path Gui Hecheng
2014-09-04  3:09 ` [PATCH] btrfs-progs: remove wrong set_argv0 for restore Gui Hecheng

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.