summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-04-12 12:14:00 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-04-12 12:14:00 -0400
commitb4100d64241fed93a3f821ddf59d11ab4443a3ba (patch)
tree57d3cb2367b5852a9017ec9ff58653338ef45a9f /fs/btrfs/ctree.h
parent8352d8a473ac84bf7a1c69690b626946d744ca58 (diff)
Btrfs: add a device id to device items
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 454eb88611b..ef3583cf74d 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -91,10 +91,12 @@ struct btrfs_super_block {
__le64 total_blocks;
__le64 blocks_used;
__le64 root_dir_objectid;
+ __le64 last_device_id;
/* fields below here vary with the underlying disk */
__le64 device_block_start;
__le64 device_num_blocks;
__le64 device_root;
+ __le64 device_id;
} __attribute__ ((__packed__));
/*
@@ -230,6 +232,7 @@ struct btrfs_csum_item {
struct btrfs_device_item {
__le16 pathlen;
+ __le64 device_id;
} __attribute__ ((__packed__));
struct crypto_hash;
@@ -798,6 +801,28 @@ static inline void btrfs_set_super_root_dir(struct btrfs_super_block *s, u64
s->root_dir_objectid = cpu_to_le64(val);
}
+static inline u64 btrfs_super_last_device_id(struct btrfs_super_block *s)
+{
+ return le64_to_cpu(s->last_device_id);
+}
+
+static inline void btrfs_set_super_last_device_id(struct btrfs_super_block *s,
+ u64 val)
+{
+ s->last_device_id = cpu_to_le64(val);
+}
+
+static inline u64 btrfs_super_device_id(struct btrfs_super_block *s)
+{
+ return le64_to_cpu(s->device_id);
+}
+
+static inline void btrfs_set_super_device_id(struct btrfs_super_block *s,
+ u64 val)
+{
+ s->device_id = cpu_to_le64(val);
+}
+
static inline u64 btrfs_super_device_block_start(struct btrfs_super_block *s)
{
return le64_to_cpu(s->device_block_start);
@@ -910,6 +935,17 @@ static inline void btrfs_set_device_pathlen(struct btrfs_device_item *d,
d->pathlen = cpu_to_le16(val);
}
+static inline u64 btrfs_device_id(struct btrfs_device_item *d)
+{
+ return le64_to_cpu(d->device_id);
+}
+
+static inline void btrfs_set_device_id(struct btrfs_device_item *d,
+ u64 val)
+{
+ d->device_id = cpu_to_le64(val);
+}
+
static inline struct btrfs_root *btrfs_sb(struct super_block *sb)
{
return sb->s_fs_info;