aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode-item.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2012-03-28 20:31:37 -0400
committerChris Mason <chris.mason@oracle.com>2012-03-28 20:31:37 -0400
commit1d4284bd6e8d7dd1d5521a6747bdb6dc1caf0225 (patch)
treea7dde6312ec24eb6368cad7a3efedbf368a5a70c /fs/btrfs/inode-item.c
parentb5d67f64f9bc656970dacba245410f0faedad18e (diff)
parent65139ed99234d8505948cdb7a835452eb5c191f9 (diff)
Merge branch 'error-handling' into for-linus
Conflicts: fs/btrfs/ctree.c fs/btrfs/disk-io.c fs/btrfs/extent-tree.c fs/btrfs/extent_io.c fs/btrfs/extent_io.h fs/btrfs/inode.c fs/btrfs/scrub.c Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode-item.c')
-rw-r--r--fs/btrfs/inode-item.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index 6ea71c60e80a..a13cf1a96c73 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -129,13 +129,14 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans,
129 item_start = btrfs_item_ptr_offset(leaf, path->slots[0]); 129 item_start = btrfs_item_ptr_offset(leaf, path->slots[0]);
130 memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, 130 memmove_extent_buffer(leaf, ptr, ptr + sub_item_len,
131 item_size - (ptr + sub_item_len - item_start)); 131 item_size - (ptr + sub_item_len - item_start));
132 ret = btrfs_truncate_item(trans, root, path, 132 btrfs_truncate_item(trans, root, path,
133 item_size - sub_item_len, 1); 133 item_size - sub_item_len, 1);
134out: 134out:
135 btrfs_free_path(path); 135 btrfs_free_path(path);
136 return ret; 136 return ret;
137} 137}
138 138
139/* Will return 0, -ENOMEM, -EMLINK, or -EEXIST or anything from the CoW path */
139int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans, 140int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans,
140 struct btrfs_root *root, 141 struct btrfs_root *root,
141 const char *name, int name_len, 142 const char *name, int name_len,
@@ -166,7 +167,7 @@ int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans,
166 goto out; 167 goto out;
167 168
168 old_size = btrfs_item_size_nr(path->nodes[0], path->slots[0]); 169 old_size = btrfs_item_size_nr(path->nodes[0], path->slots[0]);
169 ret = btrfs_extend_item(trans, root, path, ins_len); 170 btrfs_extend_item(trans, root, path, ins_len);
170 ref = btrfs_item_ptr(path->nodes[0], path->slots[0], 171 ref = btrfs_item_ptr(path->nodes[0], path->slots[0],
171 struct btrfs_inode_ref); 172 struct btrfs_inode_ref);
172 ref = (struct btrfs_inode_ref *)((unsigned long)ref + old_size); 173 ref = (struct btrfs_inode_ref *)((unsigned long)ref + old_size);