diff options
Diffstat (limited to 'fs/btrfs/dir-item.c')
-rw-r--r-- | fs/btrfs/dir-item.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/dir-item.c b/fs/btrfs/dir-item.c index 31d84e78129b..c1a074d0696f 100644 --- a/fs/btrfs/dir-item.c +++ b/fs/btrfs/dir-item.c | |||
@@ -49,9 +49,8 @@ static struct btrfs_dir_item *insert_with_overflow(struct btrfs_trans_handle | |||
49 | di = btrfs_match_dir_item_name(root, path, name, name_len); | 49 | di = btrfs_match_dir_item_name(root, path, name, name_len); |
50 | if (di) | 50 | if (di) |
51 | return ERR_PTR(-EEXIST); | 51 | return ERR_PTR(-EEXIST); |
52 | ret = btrfs_extend_item(trans, root, path, data_size); | 52 | btrfs_extend_item(trans, root, path, data_size); |
53 | } | 53 | } else if (ret < 0) |
54 | if (ret < 0) | ||
55 | return ERR_PTR(ret); | 54 | return ERR_PTR(ret); |
56 | WARN_ON(ret > 0); | 55 | WARN_ON(ret > 0); |
57 | leaf = path->nodes[0]; | 56 | leaf = path->nodes[0]; |
@@ -116,6 +115,7 @@ int btrfs_insert_xattr_item(struct btrfs_trans_handle *trans, | |||
116 | * 'location' is the key to stuff into the directory item, 'type' is the | 115 | * 'location' is the key to stuff into the directory item, 'type' is the |
117 | * type of the inode we're pointing to, and 'index' is the sequence number | 116 | * type of the inode we're pointing to, and 'index' is the sequence number |
118 | * to use for the second index (if one is created). | 117 | * to use for the second index (if one is created). |
118 | * Will return 0 or -ENOMEM | ||
119 | */ | 119 | */ |
120 | int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root | 120 | int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root |
121 | *root, const char *name, int name_len, | 121 | *root, const char *name, int name_len, |
@@ -383,8 +383,8 @@ int btrfs_delete_one_dir_name(struct btrfs_trans_handle *trans, | |||
383 | start = btrfs_item_ptr_offset(leaf, path->slots[0]); | 383 | start = btrfs_item_ptr_offset(leaf, path->slots[0]); |
384 | memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, | 384 | memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, |
385 | item_len - (ptr + sub_item_len - start)); | 385 | item_len - (ptr + sub_item_len - start)); |
386 | ret = btrfs_truncate_item(trans, root, path, | 386 | btrfs_truncate_item(trans, root, path, |
387 | item_len - sub_item_len, 1); | 387 | item_len - sub_item_len, 1); |
388 | } | 388 | } |
389 | return ret; | 389 | return ret; |
390 | } | 390 | } |