btrfs-progs: remove unused flags for btrfs_path
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>
Thu, 21 Aug 2014 02:56:53 +0000 (10:56 +0800)
committerDavid Sterba <dsterba@suse.cz>
Thu, 28 Aug 2014 00:03:18 +0000 (02:03 +0200)
The three flags of @btrfs_path:
btrfs_path {
unsigned int keep_locks:1;
unsigned int skip_locking:1;
unsigned int leave_spinning:1;
}
have little meaning, because the userspace @btrfs_search_slot()
is free of locking and no other routines will decide their behavior
on these. So just remove them.

Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
cmds-restore.c
ctree.h
extent-tree.c

index e09acc4..ff2b3fb 100644 (file)
@@ -566,7 +566,6 @@ static int copy_file(struct btrfs_root *root, int fd, struct btrfs_key *key,
                fprintf(stderr, "Ran out of memory\n");
                return -ENOMEM;
        }
-       path->skip_locking = 1;
 
        ret = btrfs_lookup_inode(NULL, root, path, key, 0);
        if (ret == 0) {
@@ -704,7 +703,6 @@ static int search_dir(struct btrfs_root *root, struct btrfs_key *key,
                fprintf(stderr, "Ran out of memory\n");
                return -ENOMEM;
        }
-       path->skip_locking = 1;
 
        key->offset = 0;
        key->type = BTRFS_DIR_INDEX_KEY;
diff --git a/ctree.h b/ctree.h
index fa73c4a..6fa1ca6 100644 (file)
--- a/ctree.h
+++ b/ctree.h
@@ -548,9 +548,6 @@ struct btrfs_path {
         * and to force calls to keep space in the nodes
         */
        unsigned int search_for_split:1;
-       unsigned int keep_locks:1;
-       unsigned int skip_locking:1;
-       unsigned int leave_spinning:1;
        unsigned int skip_check_block:1;
 };
 
index c46c92b..5443ec8 100644 (file)
@@ -1418,7 +1418,6 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
                return -ENOMEM;
 
        path->reada = 1;
-       path->leave_spinning = 1;
 
        ret = insert_inline_extent_backref(trans, root->fs_info->extent_root,
                                           path, bytenr, num_bytes, parent,
@@ -1440,7 +1439,6 @@ int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
        btrfs_release_path(path);
 
        path->reada = 1;
-       path->leave_spinning = 1;
 
        /* now insert the actual backref */
        ret = insert_extent_backref(trans, root->fs_info->extent_root,
@@ -2195,7 +2193,6 @@ static int __free_extent(struct btrfs_trans_handle *trans,
                return -ENOMEM;
 
        path->reada = 1;
-       path->leave_spinning = 1;
 
        is_data = owner_objectid >= BTRFS_FIRST_FREE_OBJECTID;
        if (is_data)
@@ -2239,7 +2236,6 @@ static int __free_extent(struct btrfs_trans_handle *trans,
                                                    is_data);
                        BUG_ON(ret);
                        btrfs_release_path(path);
-                       path->leave_spinning = 1;
 
                        key.objectid = bytenr;
 
@@ -2304,7 +2300,6 @@ static int __free_extent(struct btrfs_trans_handle *trans,
                BUG_ON(ret < 0);
 
                btrfs_release_path(path);
-               path->leave_spinning = 1;
 
                key.objectid = bytenr;
                key.type = BTRFS_EXTENT_ITEM_KEY;
@@ -2711,7 +2706,6 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
        path = btrfs_alloc_path();
        BUG_ON(!path);
 
-       path->leave_spinning = 1;
        ret = btrfs_insert_empty_item(trans, fs_info->extent_root, path,
                                      ins, size);
        BUG_ON(ret);