summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-06-22 14:16:25 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-06-22 14:16:25 -0400
commit5eda7b5e9b0bed864dd18284c7df9b3c8207dad7 (patch)
tree9efe48de46e77f2b7b97a2ce3ee93c9da6451671 /fs/btrfs/ctree.h
parent54aa1f4dfdacd60a19c4471220b24e581be6f774 (diff)
Btrfs: Add the ability to find and remove dead roots after a crash.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 77071f27397..fb6fffb71dd 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -122,12 +122,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__));
/*
@@ -226,10 +226,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
@@ -800,6 +802,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);
@@ -1076,6 +1088,7 @@ int btrfs_update_root(struct btrfs_trans_handle *trans, struct btrfs_root
*item);
int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct
btrfs_root_item *item, struct btrfs_key *key);
+int btrfs_find_dead_roots(struct btrfs_root *root);
/* dir-item.c */
int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
*root, const char *name, int name_len, u64 dir,