[PATCH 2/2] btrfs-progs: show: allow fi show -u for FS_TREE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allow "fi show -u" for uuid of top-level subvolume too for consistency.

Signed-off-by: Tomohiro Misono <misono.tomohiro@xxxxxxxxxxxxxx>
---
 btrfs-list.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/btrfs-list.c b/btrfs-list.c
index b6d7658..91fdab8 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -1594,9 +1594,15 @@ int btrfs_get_subvol(int fd, struct root_info *the_ri)
 		ri = rb_entry(rbn, struct root_info, rb_node);
 		rr = resolve_root(&rl, ri, root_id);
 		if (rr == -ENOENT) {
-			ret = -ENOENT;
-			rbn = rb_next(rbn);
-			continue;
+			if (ri->root_id == BTRFS_FS_TREE_OBJECTID) {
+				ri->path = strdup("/");
+				ri->name = strdup("<FS_TREE>");
+				ri->full_path = strdup("/");
+			} else {
+				ret = -ENOENT;
+				rbn = rb_next(rbn);
+				continue;
+			}
 		}
 
 		if (!comp_entry_with_rootid(the_ri, ri, 0) ||
-- 
2.9.5

--
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




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux