]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: use bool type for btrfs_path members used as booleans
authorFilipe Manana <fdmanana@suse.com>
Fri, 14 Nov 2025 16:00:04 +0000 (16:00 +0000)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:42:25 +0000 (22:42 +0100)
Many fields of struct btrfs_path are used as booleans but their type is
an unsigned int (of one 1 bit width to save space). Change the type to
bool keeping the :1 suffix so that they combine with the previous u8
fields in order to save space. This makes the code more clear by using
explicit true/false and more in line with the preferred style, preserving
the size of the structure.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
20 files changed:
fs/btrfs/backref.c
fs/btrfs/block-group.c
fs/btrfs/ctree.c
fs/btrfs/ctree.h
fs/btrfs/defrag.c
fs/btrfs/dev-replace.c
fs/btrfs/extent-tree.c
fs/btrfs/file-item.c
fs/btrfs/free-space-cache.c
fs/btrfs/free-space-tree.c
fs/btrfs/inode-item.c
fs/btrfs/inode.c
fs/btrfs/qgroup.c
fs/btrfs/raid-stripe-tree.c
fs/btrfs/relocation.c
fs/btrfs/scrub.c
fs/btrfs/send.c
fs/btrfs/tree-log.c
fs/btrfs/volumes.c
fs/btrfs/xattr.c

index eff2d388a706dda1b31264d8199839d4638c7f11..78da47a3d00e6d31ad3b22b9fe7542d8ea02e6ae 100644 (file)
@@ -1408,12 +1408,12 @@ static int find_parent_nodes(struct btrfs_backref_walk_ctx *ctx,
        if (!path)
                return -ENOMEM;
        if (!ctx->trans) {
-               path->search_commit_root = 1;
-               path->skip_locking = 1;
+               path->search_commit_root = true;
+               path->skip_locking = true;
        }
 
        if (ctx->time_seq == BTRFS_SEQ_LAST)
-               path->skip_locking = 1;
+               path->skip_locking = true;
 
 again:
        head = NULL;
@@ -1560,7 +1560,7 @@ again:
 
        btrfs_release_path(path);
 
-       ret = add_missing_keys(ctx->fs_info, &preftrees, path->skip_locking == 0);
+       ret = add_missing_keys(ctx->fs_info, &preftrees, !path->skip_locking);
        if (ret)
                goto out;
 
@@ -2825,8 +2825,8 @@ struct btrfs_backref_iter *btrfs_backref_iter_alloc(struct btrfs_fs_info *fs_inf
        }
 
        /* Current backref iterator only supports iteration in commit root */
-       ret->path->search_commit_root = 1;
-       ret->path->skip_locking = 1;
+       ret->path->search_commit_root = true;
+       ret->path->skip_locking = true;
        ret->fs_info = fs_info;
 
        return ret;
@@ -3299,8 +3299,8 @@ static int handle_indirect_tree_backref(struct btrfs_trans_handle *trans,
        level = cur->level + 1;
 
        /* Search the tree to find parent blocks referring to the block */
-       path->search_commit_root = 1;
-       path->skip_locking = 1;
+       path->search_commit_root = true;
+       path->skip_locking = true;
        path->lowest_level = level;
        ret = btrfs_search_slot(NULL, root, tree_key, path, 0, 0);
        path->lowest_level = 0;
index b964eacc1610247647cd1a91c8807405608ea5d0..ebbf0450178244035b9f95f3576cd4c31a925fb2 100644 (file)
@@ -613,8 +613,8 @@ static int sample_block_group_extent_item(struct btrfs_caching_control *caching_
        extent_root = btrfs_extent_root(fs_info, max_t(u64, block_group->start,
                                                       BTRFS_SUPER_INFO_OFFSET));
 
-       path->skip_locking = 1;
-       path->search_commit_root = 1;
+       path->skip_locking = true;
+       path->search_commit_root = true;
        path->reada = READA_FORWARD;
 
        search_offset = index * div_u64(block_group->length, max_index);
@@ -744,8 +744,8 @@ static int load_extent_tree_free(struct btrfs_caching_control *caching_ctl)
         * root to add free space.  So we skip locking and search the commit
         * root, since its read-only
         */
-       path->skip_locking = 1;
-       path->search_commit_root = 1;
+       path->skip_locking = true;
+       path->search_commit_root = true;
        path->reada = READA_FORWARD;
 
        key.objectid = last;
index 46262939e873cdc3812bfb9e7f33ae5aa1052ef0..51dc8e0bc9c1b58065d71d0c85c2f96acb012e3b 100644 (file)
@@ -1709,9 +1709,9 @@ static struct extent_buffer *btrfs_search_slot_get_root(struct btrfs_root *root,
                level = btrfs_header_level(b);
                /*
                 * Ensure that all callers have set skip_locking when
-                * p->search_commit_root = 1.
+                * p->search_commit_root is true.
                 */
-               ASSERT(p->skip_locking == 1);
+               ASSERT(p->skip_locking);
 
                goto out;
        }
@@ -3860,10 +3860,10 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
        }
        btrfs_release_path(path);
 
-       path->keep_locks = 1;
-       path->search_for_split = 1;
+       path->keep_locks = true;
+       path->search_for_split = true;
        ret = btrfs_search_slot(trans, root, &key, path, 0, 1);
-       path->search_for_split = 0;
+       path->search_for_split = false;
        if (ret > 0)
                ret = -EAGAIN;
        if (ret < 0)
@@ -3890,11 +3890,11 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
        if (ret)
                goto err;
 
-       path->keep_locks = 0;
+       path->keep_locks = false;
        btrfs_unlock_up_safe(path, 1);
        return 0;
 err:
-       path->keep_locks = 0;
+       path->keep_locks = false;
        return ret;
 }
 
@@ -4610,11 +4610,11 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
        u32 nritems;
        int level;
        int ret = 1;
-       int keep_locks = path->keep_locks;
+       const bool keep_locks = path->keep_locks;
 
        ASSERT(!path->nowait);
        ASSERT(path->lowest_level == 0);
-       path->keep_locks = 1;
+       path->keep_locks = true;
 again:
        cur = btrfs_read_lock_root_node(root);
        level = btrfs_header_level(cur);
@@ -4704,7 +4704,7 @@ out:
  * 0 is returned if another key is found, < 0 if there are any errors
  * and 1 is returned if there are no higher keys in the tree
  *
- * path->keep_locks should be set to 1 on the search made before
+ * path->keep_locks should be set to true on the search made before
  * calling this function.
  */
 int btrfs_find_next_key(struct btrfs_root *root, struct btrfs_path *path,
@@ -4803,13 +4803,13 @@ again:
        next = NULL;
        btrfs_release_path(path);
 
-       path->keep_locks = 1;
+       path->keep_locks = true;
 
        if (time_seq) {
                ret = btrfs_search_old_slot(root, &key, path, time_seq);
        } else {
                if (path->need_commit_sem) {
-                       path->need_commit_sem = 0;
+                       path->need_commit_sem = false;
                        need_commit_sem = true;
                        if (path->nowait) {
                                if (!down_read_trylock(&fs_info->commit_root_sem)) {
@@ -4822,7 +4822,7 @@ again:
                }
                ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
        }
-       path->keep_locks = 0;
+       path->keep_locks = false;
 
        if (ret < 0)
                goto done;
@@ -4961,7 +4961,7 @@ done:
        if (need_commit_sem) {
                int ret2;
 
-               path->need_commit_sem = 1;
+               path->need_commit_sem = true;
                ret2 = finish_need_commit_sem_search(path);
                up_read(&fs_info->commit_root_sem);
                if (ret2)
index 16dd11c48531309053becb72a9286fdc7b30fd6e..692370fc07b280ff75b1511aa57d654ee56f6f2a 100644 (file)
@@ -65,21 +65,21 @@ struct btrfs_path {
         * set by btrfs_split_item, tells search_slot to keep all locks
         * and to force calls to keep space in the nodes
         */
-       unsigned int search_for_split:1;
+       bool search_for_split:1;
        /* Keep some upper locks as we walk down. */
-       unsigned int keep_locks:1;
-       unsigned int skip_locking:1;
-       unsigned int search_commit_root:1;
-       unsigned int need_commit_sem:1;
-       unsigned int skip_release_on_error:1;
+       bool keep_locks:1;
+       bool skip_locking:1;
+       bool search_commit_root:1;
+       bool need_commit_sem:1;
+       bool skip_release_on_error:1;
        /*
         * Indicate that new item (btrfs_search_slot) is extending already
         * existing item and ins_len contains only the data size and not item
         * header (ie. sizeof(struct btrfs_item) is not included).
         */
-       unsigned int search_for_extension:1;
+       bool search_for_extension:1;
        /* Stop search if any locks need to be taken (for read) */
-       unsigned int nowait:1;
+       bool nowait:1;
 };
 
 #define BTRFS_PATH_AUTO_FREE(path_name)                                        \
index a4cc1bc63562272b9d400488d609f1350077204c..2e3c011d410a6f3b36ae37bceb84427149d38434 100644 (file)
@@ -472,7 +472,7 @@ static int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
                memcpy(&key, &root->defrag_progress, sizeof(key));
        }
 
-       path->keep_locks = 1;
+       path->keep_locks = true;
 
        ret = btrfs_search_forward(root, &key, path, BTRFS_OLDEST_GENERATION);
        if (ret < 0)
@@ -515,7 +515,7 @@ static int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
        /*
         * Now that we reallocated the node we can find the next key. Note that
         * btrfs_find_next_key() can release our path and do another search
-        * without COWing, this is because even with path->keep_locks = 1,
+        * without COWing, this is because even with path->keep_locks == true,
         * btrfs_search_slot() / ctree.c:unlock_up() does not keeps a lock on a
         * node when path->slots[node_level - 1] does not point to the last
         * item or a slot beyond the last item (ctree.c:unlock_up()). Therefore
index a4eaef60549eed494ca5f917cd8d3241de376597..b6c7da8e1bc8b1422447df00db9c002a6f323dc3 100644 (file)
@@ -489,8 +489,8 @@ static int mark_block_group_to_copy(struct btrfs_fs_info *fs_info,
        }
 
        path->reada = READA_FORWARD;
-       path->search_commit_root = 1;
-       path->skip_locking = 1;
+       path->search_commit_root = true;
+       path->skip_locking = true;
 
        key.objectid = src_dev->devid;
        key.type = BTRFS_DEV_EXTENT_KEY;
index 86004b8daa96e934501703a7c8c417d0c5cd293c..819e0a15e8e7da227ea49e18f9736e35a9710de5 100644 (file)
@@ -789,7 +789,7 @@ int lookup_inline_extent_backref(struct btrfs_trans_handle *trans,
        want = extent_ref_type(parent, owner);
        if (insert) {
                extra_size = btrfs_extent_inline_ref_size(want);
-               path->search_for_extension = 1;
+               path->search_for_extension = true;
        } else
                extra_size = -1;
 
@@ -955,7 +955,7 @@ again:
 
                if (!path->keep_locks) {
                        btrfs_release_path(path);
-                       path->keep_locks = 1;
+                       path->keep_locks = true;
                        goto again;
                }
 
@@ -976,11 +976,11 @@ out_no_entry:
        *ref_ret = (struct btrfs_extent_inline_ref *)ptr;
 out:
        if (path->keep_locks) {
-               path->keep_locks = 0;
+               path->keep_locks = false;
                btrfs_unlock_up_safe(path, 1);
        }
        if (insert)
-               path->search_for_extension = 0;
+               path->search_for_extension = false;
        return ret;
 }
 
index e7c219e83ff04348d7231984f0b575e8d28469de..b17632ea085f255d658d979ae97cf8baaf5b7013 100644 (file)
@@ -394,8 +394,8 @@ int btrfs_lookup_bio_sums(struct btrfs_bio *bbio)
         * between reading the free space cache and updating the csum tree.
         */
        if (btrfs_is_free_space_inode(inode)) {
-               path->search_commit_root = 1;
-               path->skip_locking = 1;
+               path->search_commit_root = true;
+               path->skip_locking = true;
        }
 
        /*
@@ -423,8 +423,8 @@ int btrfs_lookup_bio_sums(struct btrfs_bio *bbio)
         * from across transactions.
         */
        if (bbio->csum_search_commit_root) {
-               path->search_commit_root = 1;
-               path->skip_locking = 1;
+               path->search_commit_root = true;
+               path->skip_locking = true;
                down_read(&fs_info->commit_root_sem);
        }
 
@@ -1177,10 +1177,10 @@ again:
        }
 
        btrfs_release_path(path);
-       path->search_for_extension = 1;
+       path->search_for_extension = true;
        ret = btrfs_search_slot(trans, root, &file_key, path,
                                csum_size, 1);
-       path->search_for_extension = 0;
+       path->search_for_extension = false;
        if (ret < 0)
                goto out;
 
index 6ccb492eae8e31716e7f3b7955f3d5c620d4352e..f0f72850fab24794d06426ca22b79da92749bd62 100644 (file)
@@ -968,8 +968,8 @@ int load_free_space_cache(struct btrfs_block_group *block_group)
        path = btrfs_alloc_path();
        if (!path)
                return 0;
-       path->search_commit_root = 1;
-       path->skip_locking = 1;
+       path->search_commit_root = true;
+       path->skip_locking = true;
 
        /*
         * We must pass a path with search_commit_root set to btrfs_iget in
index 26eae347739fbabef781d6dcf0d769efe15b40ad..47745ae23c7d5f4dcd3d5887222f296d3ae51cc7 100644 (file)
@@ -1694,8 +1694,8 @@ int btrfs_load_free_space_tree(struct btrfs_caching_control *caching_ctl)
         * Just like caching_thread() doesn't want to deadlock on the extent
         * tree, we don't want to deadlock on the free space tree.
         */
-       path->skip_locking = 1;
-       path->search_commit_root = 1;
+       path->skip_locking = true;
+       path->search_commit_root = true;
        path->reada = READA_FORWARD;
 
        info = btrfs_search_free_space_info(NULL, block_group, path, 0);
index 1bd73b80f9fac89a0f52dd8c9fa8dce12a98a5a6..98dacfd03234a6ba47ecffd66946c4adc31cd4c2 100644 (file)
@@ -312,7 +312,7 @@ int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans,
        if (!path)
                return -ENOMEM;
 
-       path->skip_release_on_error = 1;
+       path->skip_release_on_error = true;
        ret = btrfs_insert_empty_item(trans, root, path, &key,
                                      ins_len);
        if (ret == -EEXIST) {
index 1a0c380ef464260a9d2d02a0b18bb934b6b4e80e..fc0f0c46ab22fcab7bfa2696fa627b5f94ea17f4 100644 (file)
@@ -7111,8 +7111,8 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
         * point the commit_root has everything we need.
         */
        if (btrfs_is_free_space_inode(inode)) {
-               path->search_commit_root = 1;
-               path->skip_locking = 1;
+               path->search_commit_root = true;
+               path->skip_locking = true;
        }
 
        ret = btrfs_lookup_file_extent(NULL, root, path, objectid, start, 0);
index 1956e4bf230220b8035447f5555e1b6c13fbbff2..58fb55644be5b25a256a4ef6cb8f3e95c5357689 100644 (file)
@@ -3834,8 +3834,8 @@ static void btrfs_qgroup_rescan_worker(struct btrfs_work *work)
         * Rescan should only search for commit root, and any later difference
         * should be recorded by qgroup
         */
-       path->search_commit_root = 1;
-       path->skip_locking = 1;
+       path->search_commit_root = true;
+       path->skip_locking = true;
 
        while (!ret && !(stopped = rescan_should_stop(fs_info))) {
                trans = btrfs_start_transaction(fs_info->fs_root, 0);
index f5c6161152548f2a5b7a1b34420e2de13e40f72b..2987cb7c686eabb21fc0adc5bc8fae371679a94b 100644 (file)
@@ -388,8 +388,8 @@ int btrfs_get_raid_extent_offset(struct btrfs_fs_info *fs_info,
                return -ENOMEM;
 
        if (stripe->rst_search_commit_root) {
-               path->skip_locking = 1;
-               path->search_commit_root = 1;
+               path->skip_locking = true;
+               path->search_commit_root = true;
        }
 
        ret = btrfs_search_slot(NULL, stripe_root, &stripe_key, path, 0, 0);
index 739fca9442968c4b00d5de3d86b11b3316c200b5..5bfefc3e9c06168770d35d56fa59cbb90d67a3e6 100644 (file)
@@ -3165,8 +3165,8 @@ again:
                key.offset = blocksize;
        }
 
-       path->search_commit_root = 1;
-       path->skip_locking = 1;
+       path->search_commit_root = true;
+       path->skip_locking = true;
        ret = btrfs_search_slot(NULL, rc->extent_root, &key, path, 0, 0);
        if (ret < 0)
                return ret;
@@ -3358,8 +3358,8 @@ int find_next_extent(struct reloc_control *rc, struct btrfs_path *path,
                key.type = BTRFS_EXTENT_ITEM_KEY;
                key.offset = 0;
 
-               path->search_commit_root = 1;
-               path->skip_locking = 1;
+               path->search_commit_root = true;
+               path->skip_locking = true;
                ret = btrfs_search_slot(NULL, rc->extent_root, &key, path,
                                        0, 0);
                if (ret < 0)
index 7e521d21ad4098636f4045b52c903deddc758140..f6c2196322c6273e74202046d31f0b86c754a90e 100644 (file)
@@ -463,10 +463,10 @@ static noinline_for_stack struct scrub_ctx *scrub_setup_ctx(
        refcount_set(&sctx->refs, 1);
        sctx->is_dev_replace = is_dev_replace;
        sctx->fs_info = fs_info;
-       sctx->extent_path.search_commit_root = 1;
-       sctx->extent_path.skip_locking = 1;
-       sctx->csum_path.search_commit_root = 1;
-       sctx->csum_path.skip_locking = 1;
+       sctx->extent_path.search_commit_root = true;
+       sctx->extent_path.skip_locking = true;
+       sctx->csum_path.search_commit_root = true;
+       sctx->csum_path.skip_locking = true;
        for (i = 0; i < SCRUB_TOTAL_STRIPES; i++) {
                int ret;
 
@@ -2202,10 +2202,10 @@ static int scrub_raid56_parity_stripe(struct scrub_ctx *sctx,
         * as the data stripe bytenr may be smaller than previous extent.  Thus
         * we have to use our own extent/csum paths.
         */
-       extent_path.search_commit_root = 1;
-       extent_path.skip_locking = 1;
-       csum_path.search_commit_root = 1;
-       csum_path.skip_locking = 1;
+       extent_path.search_commit_root = true;
+       extent_path.skip_locking = true;
+       csum_path.search_commit_root = true;
+       csum_path.skip_locking = true;
 
        for (int i = 0; i < data_stripes; i++) {
                int stripe_index;
@@ -2688,8 +2688,8 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,
                return -ENOMEM;
 
        path->reada = READA_FORWARD;
-       path->search_commit_root = 1;
-       path->skip_locking = 1;
+       path->search_commit_root = true;
+       path->skip_locking = true;
 
        key.objectid = scrub_dev->devid;
        key.type = BTRFS_DEV_EXTENT_KEY;
index fa94105e139a3bb24c9aa6a82f01e520acb1871e..3d437024e8bca695525e586851960b67fc3abb7a 100644 (file)
@@ -633,9 +633,9 @@ static struct btrfs_path *alloc_path_for_send(void)
        path = btrfs_alloc_path();
        if (!path)
                return NULL;
-       path->search_commit_root = 1;
-       path->skip_locking = 1;
-       path->need_commit_sem = 1;
+       path->search_commit_root = true;
+       path->skip_locking = true;
+       path->need_commit_sem = true;
        return path;
 }
 
@@ -7622,10 +7622,10 @@ static int btrfs_compare_trees(struct btrfs_root *left_root,
                goto out;
        }
 
-       left_path->search_commit_root = 1;
-       left_path->skip_locking = 1;
-       right_path->search_commit_root = 1;
-       right_path->skip_locking = 1;
+       left_path->search_commit_root = true;
+       left_path->skip_locking = true;
+       right_path->search_commit_root = true;
+       right_path->skip_locking = true;
 
        /*
         * Strategy: Go to the first items of both trees. Then do
index e40e1d746381df575cebdc6e794adc87f56d641d..cc27f87c4904f1703e4230da72df5026b7c8d84c 100644 (file)
@@ -602,9 +602,9 @@ static int overwrite_item(struct walk_control *wc)
 insert:
        btrfs_release_path(wc->subvol_path);
        /* try to insert the key into the destination tree */
-       wc->subvol_path->skip_release_on_error = 1;
+       wc->subvol_path->skip_release_on_error = true;
        ret = btrfs_insert_empty_item(trans, root, wc->subvol_path, &wc->log_key, item_size);
-       wc->subvol_path->skip_release_on_error = 0;
+       wc->subvol_path->skip_release_on_error = false;
 
        dst_eb = wc->subvol_path->nodes[0];
        dst_slot = wc->subvol_path->slots[0];
@@ -5706,8 +5706,8 @@ static int btrfs_check_ref_name_override(struct extent_buffer *eb,
        search_path = btrfs_alloc_path();
        if (!search_path)
                return -ENOMEM;
-       search_path->search_commit_root = 1;
-       search_path->skip_locking = 1;
+       search_path->search_commit_root = true;
+       search_path->skip_locking = true;
 
        while (cur_offset < item_size) {
                u64 parent;
@@ -6026,8 +6026,8 @@ static int conflicting_inode_is_dir(struct btrfs_root *root, u64 ino,
        key.type = BTRFS_INODE_ITEM_KEY;
        key.offset = 0;
 
-       path->search_commit_root = 1;
-       path->skip_locking = 1;
+       path->search_commit_root = true;
+       path->skip_locking = true;
 
        ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
        if (WARN_ON_ONCE(ret > 0)) {
@@ -6047,8 +6047,8 @@ static int conflicting_inode_is_dir(struct btrfs_root *root, u64 ino,
        }
 
        btrfs_release_path(path);
-       path->search_commit_root = 0;
-       path->skip_locking = 0;
+       path->search_commit_root = false;
+       path->skip_locking = false;
 
        return ret;
 }
@@ -7169,8 +7169,8 @@ static int btrfs_log_all_parents(struct btrfs_trans_handle *trans,
        path = btrfs_alloc_path();
        if (!path)
                return -ENOMEM;
-       path->skip_locking = 1;
-       path->search_commit_root = 1;
+       path->skip_locking = true;
+       path->search_commit_root = true;
 
        key.objectid = ino;
        key.type = BTRFS_INODE_REF_KEY;
index 75a34ed95c74cd0d5628ce784966236b5d52f036..e6a3f3ceb74bf401b05d699bd0617cf9494a85ac 100644 (file)
@@ -1710,8 +1710,8 @@ again:
        }
 
        path->reada = READA_FORWARD;
-       path->search_commit_root = 1;
-       path->skip_locking = 1;
+       path->search_commit_root = true;
+       path->skip_locking = true;
 
        key.objectid = device->devid;
        key.type = BTRFS_DEV_EXTENT_KEY;
@@ -7448,7 +7448,7 @@ int btrfs_read_chunk_tree(struct btrfs_fs_info *fs_info)
         * chunk tree, to keep it simple, just skip locking on the chunk tree.
         */
        ASSERT(!test_bit(BTRFS_FS_OPEN, &fs_info->flags));
-       path->skip_locking = 1;
+       path->skip_locking = true;
 
        /*
         * Read all device items, and then all the chunk items. All
index 3d27eb1e2f749b53d4fe8c1c446b210b4e708821..98d6aa3b7d6a3a072514fae4b6018ee789b5df41 100644 (file)
@@ -85,7 +85,7 @@ int btrfs_setxattr(struct btrfs_trans_handle *trans, struct inode *inode,
        path = btrfs_alloc_path();
        if (!path)
                return -ENOMEM;
-       path->skip_release_on_error = 1;
+       path->skip_release_on_error = true;
 
        if (!value) {
                di = btrfs_lookup_xattr(trans, root, path,