btrfs-progs: rename lookup_ino_rootid
authorDavid Sterba <dsterba@suse.com>
Mon, 31 Oct 2016 09:34:37 +0000 (10:34 +0100)
committerDavid Sterba <dsterba@suse.com>
Wed, 9 Nov 2016 12:47:28 +0000 (13:47 +0100)
It does not resolve the inode number but path where fd has been opened.

Signed-off-by: David Sterba <dsterba@suse.com>
cmds-fi-du.c
cmds-inspect.c
cmds-qgroup.c
utils.c
utils.h

index 895c242..bf637f8 100644 (file)
@@ -459,7 +459,7 @@ static int du_add_file(const char *filename, int dirfd,
                goto out;
        }
 
-       ret = lookup_ino_rootid(fd, &subvol);
+       ret = lookup_path_rootid(fd, &subvol);
        if (ret)
                goto out_close;
 
index 6d4e2b8..5e58a28 100644 (file)
@@ -326,7 +326,7 @@ static int cmd_inspect_rootid(int argc, char **argv)
                goto out;
        }
 
-       ret = lookup_ino_rootid(fd, &rootid);
+       ret = lookup_path_rootid(fd, &rootid);
        if (ret) {
                error("failed to lookup root id: %s", strerror(-ret));
                goto out;
index 7c5532c..bc15077 100644 (file)
@@ -366,7 +366,7 @@ static int cmd_qgroup_show(int argc, char **argv)
        }
 
        if (filter_flag) {
-               ret = lookup_ino_rootid(fd, &qgroupid);
+               ret = lookup_path_rootid(fd, &qgroupid);
                if (ret < 0) {
                        error("cannot resolve rootid for %s: %s",
                                        path, strerror(-ret));
diff --git a/utils.c b/utils.c
index 3f54245..3e1eb45 100644 (file)
--- a/utils.c
+++ b/utils.c
@@ -2927,7 +2927,7 @@ path:
        fd = open(p, O_RDONLY);
        if (fd < 0)
                goto err;
-       ret = lookup_ino_rootid(fd, &id);
+       ret = lookup_path_rootid(fd, &id);
        if (ret)
                error("failed to lookup root id: %s", strerror(-ret));
        close(fd);
@@ -3609,7 +3609,7 @@ int ask_user(const char *question)
  * - BTRFS_EMPTY_SUBVOL_DIR_OBJECTID (directory with ino == 2) the result is
  *   undefined and function returns -1
  */
-int lookup_ino_rootid(int fd, u64 *rootid)
+int lookup_path_rootid(int fd, u64 *rootid)
 {
        struct btrfs_ioctl_ino_lookup_args args;
        int ret;
diff --git a/utils.h b/utils.h
index 1a2dbcd..366ca29 100644 (file)
--- a/utils.h
+++ b/utils.h
@@ -209,7 +209,7 @@ int is_vol_small(const char *file);
 int csum_tree_block(struct btrfs_root *root, struct extent_buffer *buf,
                           int verify);
 int ask_user(const char *question);
-int lookup_ino_rootid(int fd, u64 *rootid);
+int lookup_path_rootid(int fd, u64 *rootid);
 int btrfs_scan_devices(void);
 int get_btrfs_mount(const char *dev, char *mp, size_t mp_size);
 int find_mount_root(const char *path, char **mount_root);