aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index ccc056aad692..620430825840 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -141,7 +141,6 @@ static void btrfs_read_locked_inode(struct inode *inode)
141 struct btrfs_inode_item *inode_item; 141 struct btrfs_inode_item *inode_item;
142 struct btrfs_root *root = btrfs_sb(inode->i_sb); 142 struct btrfs_root *root = btrfs_sb(inode->i_sb);
143 int ret; 143 int ret;
144printk("read locked inode %lu\n", inode->i_ino);
145 btrfs_init_path(&path); 144 btrfs_init_path(&path);
146 ret = btrfs_lookup_inode(NULL, root, &path, inode->i_ino, 0); 145 ret = btrfs_lookup_inode(NULL, root, &path, inode->i_ino, 0);
147 if (ret) { 146 if (ret) {
@@ -152,7 +151,6 @@ printk("read locked inode %lu\n", inode->i_ino);
152 path.slots[0], 151 path.slots[0],
153 struct btrfs_inode_item); 152 struct btrfs_inode_item);
154 153
155printk("found locked inode %lu\n", inode->i_ino);
156 inode->i_mode = btrfs_inode_mode(inode_item); 154 inode->i_mode = btrfs_inode_mode(inode_item);
157 inode->i_nlink = btrfs_inode_nlink(inode_item); 155 inode->i_nlink = btrfs_inode_nlink(inode_item);
158 inode->i_uid = btrfs_inode_uid(inode_item); 156 inode->i_uid = btrfs_inode_uid(inode_item);
@@ -166,7 +164,6 @@ printk("found locked inode %lu\n", inode->i_ino);
166 inode->i_ctime.tv_nsec = btrfs_timespec_nsec(&inode_item->ctime); 164 inode->i_ctime.tv_nsec = btrfs_timespec_nsec(&inode_item->ctime);
167 inode->i_blocks = btrfs_inode_nblocks(inode_item); 165 inode->i_blocks = btrfs_inode_nblocks(inode_item);
168 inode->i_generation = btrfs_inode_generation(inode_item); 166 inode->i_generation = btrfs_inode_generation(inode_item);
169printk("about to release\n");
170 btrfs_release_path(root, &path); 167 btrfs_release_path(root, &path);
171 switch (inode->i_mode & S_IFMT) { 168 switch (inode->i_mode & S_IFMT) {
172#if 0 169#if 0
@@ -176,19 +173,15 @@ printk("about to release\n");
176 break; 173 break;
177#endif 174#endif
178 case S_IFREG: 175 case S_IFREG:
179printk("inode %lu now a file\n", inode->i_ino);
180 break; 176 break;
181 case S_IFDIR: 177 case S_IFDIR:
182printk("inode %lu now a directory\n", inode->i_ino);
183 inode->i_op = &btrfs_dir_inode_operations; 178 inode->i_op = &btrfs_dir_inode_operations;
184 inode->i_fop = &btrfs_dir_file_operations; 179 inode->i_fop = &btrfs_dir_file_operations;
185 break; 180 break;
186 case S_IFLNK: 181 case S_IFLNK:
187printk("inode %lu now a link\n", inode->i_ino);
188 // inode->i_op = &page_symlink_inode_operations; 182 // inode->i_op = &page_symlink_inode_operations;
189 break; 183 break;
190 } 184 }
191printk("returning!\n");
192 return; 185 return;
193} 186}
194 187
@@ -232,7 +225,6 @@ static struct dentry *btrfs_lookup(struct inode *dir, struct dentry *dentry,
232 return ERR_PTR(ret); 225 return ERR_PTR(ret);
233 inode = NULL; 226 inode = NULL;
234 if (ino) { 227 if (ino) {
235printk("lookup on %.*s returns %lu\n", dentry->d_name.len, dentry->d_name.name, ino);
236 inode = iget(dir->i_sb, ino); 228 inode = iget(dir->i_sb, ino);
237 if (!inode) 229 if (!inode)
238 return ERR_PTR(-EACCES); 230 return ERR_PTR(-EACCES);
@@ -257,7 +249,6 @@ static int btrfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
257 int over; 249 int over;
258 250
259 key.objectid = inode->i_ino; 251 key.objectid = inode->i_ino;
260printk("readdir on dir %Lu pos %Lu\n", key.objectid, filp->f_pos);
261 key.flags = 0; 252 key.flags = 0;
262 btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY); 253 btrfs_set_key_type(&key, BTRFS_DIR_ITEM_KEY);
263 key.offset = filp->f_pos; 254 key.offset = filp->f_pos;
@@ -266,15 +257,12 @@ printk("readdir on dir %Lu pos %Lu\n", key.objectid, filp->f_pos);
266 if (ret < 0) { 257 if (ret < 0) {
267 goto err; 258 goto err;
268 } 259 }
269printk("first ret %d\n", ret);
270 advance = filp->f_pos > 0 && ret != 0; 260 advance = filp->f_pos > 0 && ret != 0;
271 while(1) { 261 while(1) {
272 leaf = btrfs_buffer_leaf(path.nodes[0]); 262 leaf = btrfs_buffer_leaf(path.nodes[0]);
273 nritems = btrfs_header_nritems(&leaf->header); 263 nritems = btrfs_header_nritems(&leaf->header);
274 slot = path.slots[0]; 264 slot = path.slots[0];
275printk("leaf %Lu nritems %lu slot %d\n", path.nodes[0]->b_blocknr, nritems, slot);
276 if (advance) { 265 if (advance) {
277printk("advancing!\n");
278 if (slot == nritems -1) { 266 if (slot == nritems -1) {
279 ret = btrfs_next_leaf(root, &path); 267 ret = btrfs_next_leaf(root, &path);
280 if (ret) 268 if (ret)
@@ -282,7 +270,6 @@ printk("advancing!\n");
282 leaf = btrfs_buffer_leaf(path.nodes[0]); 270 leaf = btrfs_buffer_leaf(path.nodes[0]);
283 nritems = btrfs_header_nritems(&leaf->header); 271 nritems = btrfs_header_nritems(&leaf->header);
284 slot = path.slots[0]; 272 slot = path.slots[0];
285printk("2leaf %Lu nritems %lu slot %d\n", path.nodes[0]->b_blocknr, nritems, slot);
286 } else { 273 } else {
287 slot++; 274 slot++;
288 path.slots[0]++; 275 path.slots[0]++;
@@ -290,15 +277,11 @@ printk("2leaf %Lu nritems %lu slot %d\n", path.nodes[0]->b_blocknr, nritems, slo
290 } 277 }
291 advance = 1; 278 advance = 1;
292 item = leaf->items + slot; 279 item = leaf->items + slot;
293printk("item key %Lu %u %Lu\n", btrfs_disk_key_objectid(&item->key),
294 btrfs_disk_key_flags(&item->key), btrfs_disk_key_offset(&item->key));
295 if (btrfs_disk_key_objectid(&item->key) != key.objectid) 280 if (btrfs_disk_key_objectid(&item->key) != key.objectid)
296 break; 281 break;
297 if (btrfs_disk_key_type(&item->key) != BTRFS_DIR_ITEM_KEY) 282 if (btrfs_disk_key_type(&item->key) != BTRFS_DIR_ITEM_KEY)
298 continue; 283 continue;
299 di = btrfs_item_ptr(leaf, slot, struct btrfs_dir_item); 284 di = btrfs_item_ptr(leaf, slot, struct btrfs_dir_item);
300printk("filldir name %.*s, objectid %Lu\n", btrfs_dir_name_len(di),
301 (const char *)(di + 1), btrfs_dir_objectid(di));
302 over = filldir(dirent, (const char *)(di + 1), 285 over = filldir(dirent, (const char *)(di + 1),
303 btrfs_dir_name_len(di), 286 btrfs_dir_name_len(di),
304 btrfs_disk_key_offset(&item->key), 287 btrfs_disk_key_offset(&item->key),
@@ -307,7 +290,6 @@ printk("filldir name %.*s, objectid %Lu\n", btrfs_dir_name_len(di),
307 break; 290 break;
308 filp->f_pos = btrfs_disk_key_offset(&item->key) + 1; 291 filp->f_pos = btrfs_disk_key_offset(&item->key) + 1;
309 } 292 }
310printk("filldir all done\n");
311 ret = 0; 293 ret = 0;
312err: 294err:
313 btrfs_release_path(root, &path); 295 btrfs_release_path(root, &path);