X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=inode-map.c;h=9000e69b8d6fa5931840a6d793ced91baeb10a81;hb=50417091a076a84ed06ea8d7158b749ece0d0914;hp=1321bfb3c90aa069d7a4398c70eef9fe9aecb57b;hpb=0f500df7b60ae435e4d30c431b4b25a5120c78a3;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/inode-map.c b/inode-map.c index 1321bfb..9000e69 100644 --- a/inode-map.c +++ b/inode-map.c @@ -19,6 +19,7 @@ #include "ctree.h" #include "disk-io.h" #include "transaction.h" +#include "internal.h" /* * walks the btree of allocated inodes and find a hole. @@ -38,12 +39,15 @@ int btrfs_find_free_objectid(struct btrfs_trans_handle *trans, u64 search_start = dirid; path = btrfs_alloc_path(); - BUG_ON(!path); + if (!path) + return -ENOMEM; + search_start = root->last_inode_alloc; search_start = max((unsigned long long)search_start, BTRFS_FIRST_FREE_OBJECTID); search_key.objectid = search_start; search_key.offset = 0; + search_key.type = 0; btrfs_init_path(path); start_found = 0;