summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-06-22 14:37:48 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-06-22 14:37:48 -0400
commitc3bbf0c093f35f75169f01c31b0c0d86e04145d9 (patch)
tree599ece6bd3fc6dbb22ba2cb0f59aed2d2ee60048
parent4e5ca58de0ea5befe964f88f2833e1acff594a09 (diff)
disk format updates for finding dead roots
-rw-r--r--ctree.h16
-rw-r--r--root-tree.c2
2 files changed, 15 insertions, 3 deletions
diff --git a/ctree.h b/ctree.h
index 2ddd305c..9a3a7896 100644
--- a/ctree.h
+++ b/ctree.h
@@ -109,12 +109,12 @@ struct btrfs_super_block {
u8 fsid[16]; /* FS specific uuid */
__le64 blocknr; /* this block number */
__le64 magic;
- __le32 blocksize;
__le64 generation;
__le64 root;
__le64 total_blocks;
__le64 blocks_used;
__le64 root_dir_objectid;
+ __le32 blocksize;
} __attribute__ ((__packed__));
/*
@@ -218,10 +218,12 @@ struct btrfs_root_item {
struct btrfs_inode_item inode;
__le64 root_dirid;
__le64 blocknr;
- __le32 flags;
__le64 block_limit;
__le64 blocks_used;
+ __le32 flags;
__le32 refs;
+ struct btrfs_disk_key drop_progress;
+ u8 drop_level;
} __attribute__ ((__packed__));
#define BTRFS_FILE_EXTENT_REG 0
@@ -770,6 +772,16 @@ static inline void btrfs_set_root_refs(struct btrfs_root_item *item, u32 val)
item->refs = cpu_to_le32(val);
}
+static inline u32 btrfs_root_flags(struct btrfs_root_item *item)
+{
+ return le32_to_cpu(item->flags);
+}
+
+static inline void btrfs_set_root_flags(struct btrfs_root_item *item, u32 val)
+{
+ item->flags = cpu_to_le32(val);
+}
+
static inline u64 btrfs_super_blocknr(struct btrfs_super_block *s)
{
return le64_to_cpu(s->blocknr);
diff --git a/root-tree.c b/root-tree.c
index 25701589..d0cabeda 100644
--- a/root-tree.c
+++ b/root-tree.c
@@ -35,7 +35,7 @@ int btrfs_find_last_root(struct btrfs_root *root, u64 objectid,
search_key.objectid = objectid;
search_key.flags = (u32)-1;
- search_key.offset = (u32)-1;
+ search_key.offset = (u64)-1;
btrfs_init_path(&path);
ret = btrfs_search_slot(NULL, root, &search_key, &path, 0, 0);