| .. | .. |
|---|
| 36 | 36 | di = btrfs_match_dir_item_name(fs_info, path, name, name_len); |
|---|
| 37 | 37 | if (di) |
|---|
| 38 | 38 | return ERR_PTR(-EEXIST); |
|---|
| 39 | | - btrfs_extend_item(fs_info, path, data_size); |
|---|
| 39 | + btrfs_extend_item(path, data_size); |
|---|
| 40 | 40 | } else if (ret < 0) |
|---|
| 41 | 41 | return ERR_PTR(ret); |
|---|
| 42 | 42 | WARN_ON(ret > 0); |
|---|
| .. | .. |
|---|
| 105 | 105 | * to use for the second index (if one is created). |
|---|
| 106 | 106 | * Will return 0 or -ENOMEM |
|---|
| 107 | 107 | */ |
|---|
| 108 | | -int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root |
|---|
| 109 | | - *root, const char *name, int name_len, |
|---|
| 110 | | - struct btrfs_inode *dir, struct btrfs_key *location, |
|---|
| 111 | | - u8 type, u64 index) |
|---|
| 108 | +int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, const char *name, |
|---|
| 109 | + int name_len, struct btrfs_inode *dir, |
|---|
| 110 | + struct btrfs_key *location, u8 type, u64 index) |
|---|
| 112 | 111 | { |
|---|
| 113 | 112 | int ret = 0; |
|---|
| 114 | 113 | int ret2 = 0; |
|---|
| 114 | + struct btrfs_root *root = dir->root; |
|---|
| 115 | 115 | struct btrfs_path *path; |
|---|
| 116 | 116 | struct btrfs_dir_item *dir_item; |
|---|
| 117 | 117 | struct extent_buffer *leaf; |
|---|
| .. | .. |
|---|
| 429 | 429 | start = btrfs_item_ptr_offset(leaf, path->slots[0]); |
|---|
| 430 | 430 | memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, |
|---|
| 431 | 431 | item_len - (ptr + sub_item_len - start)); |
|---|
| 432 | | - btrfs_truncate_item(root->fs_info, path, |
|---|
| 433 | | - item_len - sub_item_len, 1); |
|---|
| 432 | + btrfs_truncate_item(path, item_len - sub_item_len, 1); |
|---|
| 434 | 433 | } |
|---|
| 435 | 434 | return ret; |
|---|
| 436 | 435 | } |
|---|