aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/ctree.h6
-rw-r--r--fs/btrfs/inode-item.c65
2 files changed, 0 insertions, 71 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index a58611fbf004..47835f5850de 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3587,12 +3587,6 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans,
3587 struct btrfs_root *root, 3587 struct btrfs_root *root,
3588 const char *name, int name_len, 3588 const char *name, int name_len,
3589 u64 inode_objectid, u64 ref_objectid, u64 *index); 3589 u64 inode_objectid, u64 ref_objectid, u64 *index);
3590int btrfs_get_inode_ref_index(struct btrfs_trans_handle *trans,
3591 struct btrfs_root *root,
3592 struct btrfs_path *path,
3593 const char *name, int name_len,
3594 u64 inode_objectid, u64 ref_objectid, int mod,
3595 u64 *ret_index);
3596int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans, 3590int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans,
3597 struct btrfs_root *root, 3591 struct btrfs_root *root,
3598 struct btrfs_path *path, u64 objectid); 3592 struct btrfs_path *path, u64 objectid);
diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c
index ec82fae07097..2be38df703c9 100644
--- a/fs/btrfs/inode-item.c
+++ b/fs/btrfs/inode-item.c
@@ -91,32 +91,6 @@ int btrfs_find_name_in_ext_backref(struct btrfs_path *path, u64 ref_objectid,
91 return 0; 91 return 0;
92} 92}
93 93
94static struct btrfs_inode_ref *
95btrfs_lookup_inode_ref(struct btrfs_trans_handle *trans,
96 struct btrfs_root *root,
97 struct btrfs_path *path,
98 const char *name, int name_len,
99 u64 inode_objectid, u64 ref_objectid, int ins_len,
100 int cow)
101{
102 int ret;
103 struct btrfs_key key;
104 struct btrfs_inode_ref *ref;
105
106 key.objectid = inode_objectid;
107 key.type = BTRFS_INODE_REF_KEY;
108 key.offset = ref_objectid;
109
110 ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow);
111 if (ret < 0)
112 return ERR_PTR(ret);
113 if (ret > 0)
114 return NULL;
115 if (!find_name_in_backref(path, name, name_len, &ref))
116 return NULL;
117 return ref;
118}
119
120/* Returns NULL if no extref found */ 94/* Returns NULL if no extref found */
121struct btrfs_inode_extref * 95struct btrfs_inode_extref *
122btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans, 96btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
@@ -144,45 +118,6 @@ btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
144 return extref; 118 return extref;
145} 119}
146 120
147int btrfs_get_inode_ref_index(struct btrfs_trans_handle *trans,
148 struct btrfs_root *root,
149 struct btrfs_path *path,
150 const char *name, int name_len,
151 u64 inode_objectid, u64 ref_objectid, int mod,
152 u64 *ret_index)
153{
154 struct btrfs_inode_ref *ref;
155 struct btrfs_inode_extref *extref;
156 int ins_len = mod < 0 ? -1 : 0;
157 int cow = mod != 0;
158
159 ref = btrfs_lookup_inode_ref(trans, root, path, name, name_len,
160 inode_objectid, ref_objectid, ins_len,
161 cow);
162 if (IS_ERR(ref))
163 return PTR_ERR(ref);
164
165 if (ref != NULL) {
166 *ret_index = btrfs_inode_ref_index(path->nodes[0], ref);
167 return 0;
168 }
169
170 btrfs_release_path(path);
171
172 extref = btrfs_lookup_inode_extref(trans, root, path, name,
173 name_len, inode_objectid,
174 ref_objectid, ins_len, cow);
175 if (IS_ERR(extref))
176 return PTR_ERR(extref);
177
178 if (extref) {
179 *ret_index = btrfs_inode_extref_index(path->nodes[0], extref);
180 return 0;
181 }
182
183 return -ENOENT;
184}
185
186static int btrfs_del_inode_extref(struct btrfs_trans_handle *trans, 121static int btrfs_del_inode_extref(struct btrfs_trans_handle *trans,
187 struct btrfs_root *root, 122 struct btrfs_root *root,
188 const char *name, int name_len, 123 const char *name, int name_len,