aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/btrfs.c19
-rw-r--r--fs/btrfs/disk-io.c3
2 files changed, 12 insertions, 10 deletions
diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c
index 346b2c4341..52a243a659 100644
--- a/fs/btrfs/btrfs.c
+++ b/fs/btrfs/btrfs.c
@@ -22,14 +22,13 @@ static int show_dir(struct btrfs_root *root, struct extent_buffer *eb,
struct btrfs_inode_item ii;
struct btrfs_key key;
static const char* dir_item_str[] = {
- [BTRFS_FT_REG_FILE] = "FILE",
+ [BTRFS_FT_REG_FILE] = " ",
[BTRFS_FT_DIR] = "DIR",
- [BTRFS_FT_CHRDEV] = "CHRDEV",
- [BTRFS_FT_BLKDEV] = "BLKDEV",
- [BTRFS_FT_FIFO] = "FIFO",
- [BTRFS_FT_SOCK] = "SOCK",
- [BTRFS_FT_SYMLINK] = "SYMLINK",
- [BTRFS_FT_XATTR] = "XATTR"
+ [BTRFS_FT_CHRDEV] = "CHR",
+ [BTRFS_FT_BLKDEV] = "BLK",
+ [BTRFS_FT_FIFO] = "FIF",
+ [BTRFS_FT_SOCK] = "SCK",
+ [BTRFS_FT_SYMLINK] = "SYM",
};
u8 type = btrfs_dir_type(eb, di);
char namebuf[BTRFS_NAME_LEN];
@@ -38,6 +37,10 @@ static int show_dir(struct btrfs_root *root, struct extent_buffer *eb,
time_t mtime;
int ret = 0;
+ /* skip XATTRs in directory listing */
+ if (type == BTRFS_FT_XATTR)
+ return 0;
+
btrfs_dir_item_key_to_cpu(eb, di, &key);
if (key.type == BTRFS_ROOT_ITEM_KEY) {
@@ -90,7 +93,7 @@ static int show_dir(struct btrfs_root *root, struct extent_buffer *eb,
if (type < ARRAY_SIZE(dir_item_str) && dir_item_str[type])
printf("<%s> ", dir_item_str[type]);
else
- printf("DIR_ITEM.%u", type);
+ printf("?%3u? ", type);
if (type == BTRFS_FT_CHRDEV || type == BTRFS_FT_BLKDEV) {
ASSERT(key.type == BTRFS_INODE_ITEM_KEY);
printf("%4llu,%5llu ", btrfs_stack_inode_rdev(&ii) >> 20,
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index b332ecb796..c6fdec95c1 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -732,8 +732,7 @@ struct btrfs_root *btrfs_read_fs_root(struct btrfs_fs_info *fs_info,
return fs_info->chunk_root;
if (location->objectid == BTRFS_CSUM_TREE_OBJECTID)
return fs_info->csum_root;
- BUG_ON(location->objectid == BTRFS_TREE_RELOC_OBJECTID ||
- location->offset != (u64)-1);
+ BUG_ON(location->objectid == BTRFS_TREE_RELOC_OBJECTID);
node = rb_search(&fs_info->fs_root_tree, (void *)&objectid,
btrfs_fs_roots_compare_objectids, NULL);