Lines Matching refs:ret
35 int ret; in btrfs_search_root() local
45 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in btrfs_search_root()
46 if (ret < 0) in btrfs_search_root()
48 if (ret == 0) { in btrfs_search_root()
49 ret = 1; in btrfs_search_root()
53 ret = btrfs_next_leaf(root, path); in btrfs_search_root()
54 if (ret) in btrfs_search_root()
63 ret = 0; in btrfs_search_root()
68 return ret; in btrfs_search_root()
83 int ret; in btrfs_find_last_root() local
92 ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0); in btrfs_find_last_root()
93 if (ret < 0) in btrfs_find_last_root()
96 BUG_ON(ret == 0); in btrfs_find_last_root()
102 ret = 1; in btrfs_find_last_root()
108 ret = 0; in btrfs_find_last_root()
111 return ret; in btrfs_find_last_root()
123 int ret; in btrfs_update_root() local
129 ret = btrfs_search_slot(trans, root, key, path, 0, 1); in btrfs_update_root()
130 if (ret < 0) in btrfs_update_root()
133 if (ret != 0) { in btrfs_update_root()
149 return ret; in btrfs_update_root()
156 int ret; in btrfs_insert_root() local
157 ret = btrfs_insert_item(trans, root, key, item, sizeof(*item)); in btrfs_insert_root()
158 return ret; in btrfs_insert_root()
176 int ret; in btrfs_find_dead_roots() local
189 ret = btrfs_search_slot(NULL, root, &key, path, 0, 0); in btrfs_find_dead_roots()
190 if (ret < 0) in btrfs_find_dead_roots()
197 ret = btrfs_next_leaf(root, path); in btrfs_find_dead_roots()
198 if (ret) in btrfs_find_dead_roots()
226 ret = PTR_ERR(dead_root); in btrfs_find_dead_roots()
231 ret = btrfs_add_dead_reloc_root(dead_root); in btrfs_find_dead_roots()
233 ret = btrfs_add_dead_root(dead_root, latest); in btrfs_find_dead_roots()
234 if (ret) in btrfs_find_dead_roots()
241 ret = 0; in btrfs_find_dead_roots()
244 return ret; in btrfs_find_dead_roots()
252 int ret; in btrfs_del_root() local
259 ret = btrfs_search_slot(trans, root, key, path, -1, 1); in btrfs_del_root()
260 if (ret < 0) in btrfs_del_root()
263 BUG_ON(ret != 0); in btrfs_del_root()
269 ret = btrfs_del_item(trans, root, path); in btrfs_del_root()
273 return ret; in btrfs_del_root()
282 int ret;
291 ret = btrfs_search_slot(trans, tree_root, &key, path, -1, 1);
292 BUG_ON(ret);
294 ret = btrfs_del_item(trans, tree_root, path);
295 BUG_ON(ret);
298 return ret;
307 int ret; in btrfs_find_root_ref() local
313 ret = btrfs_search_slot(NULL, tree_root, &key, path, 0, 0); in btrfs_find_root_ref()
314 return ret; in btrfs_find_root_ref()
338 int ret; in btrfs_add_root_ref() local
351 ret = btrfs_insert_empty_item(trans, tree_root, path, &key, in btrfs_add_root_ref()
353 BUG_ON(ret); in btrfs_add_root_ref()
365 return ret; in btrfs_add_root_ref()