key.offset = 0;
ret = btrfs_insert_dir_item(trans, root, buf, strlen(buf), dir_oid,
&key, BTRFS_FT_UNKNOWN);
key.offset = 0;
ret = btrfs_insert_dir_item(trans, root, buf, strlen(buf), dir_oid,
&key, BTRFS_FT_UNKNOWN);
if (root->fs_info->last_inode_alloc > file_objectid)
root->fs_info->last_inode_alloc = file_objectid;
if (root->fs_info->last_inode_alloc > file_objectid)
root->fs_info->last_inode_alloc = file_objectid;
btrfs_init_path(&path);
ret = btrfs_lookup_dir_item(trans, root, &path, dir_oid, buf,
strlen(buf), 0);
btrfs_init_path(&path);
ret = btrfs_lookup_dir_item(trans, root, &path, dir_oid, buf,
strlen(buf), 0);
key.objectid = dir_oid;
while(nr-- >= 0) {
btrfs_init_path(&path);
ret = btrfs_search_slot(trans, root, &key, &path, -1, 1);
if (ret < 0) {
key.objectid = dir_oid;
while(nr-- >= 0) {
btrfs_init_path(&path);
ret = btrfs_search_slot(trans, root, &key, &path, -1, 1);
if (ret < 0) {