path: root/volumes.c
diff options
authorChris Mason <>2008-12-08 17:01:14 -0500
committerChris Mason <>2008-12-08 17:01:14 -0500
commitb238b4b072904e3fe72149b68a2e69784893619e (patch)
tree7b3c6084dddf8ba7b40860ac11e80bab788e8bdb /volumes.c
parent5ccd1715fa2eaad0b26037bb53706779c8c93b5f (diff)
Btrfs: Add inode sequence number for NFS and reserved space in a few structs
This adds a sequence number to the btrfs inode that is increased on every update. NFS will be able to use that to detect when an inode has changed, without relying on inaccurate time fields. While we're here, this also: Puts reserved space into the super block and inode Adds a log root transid to the super so we can pick the newest super based on the fsync log as well as the main transaction ID. For now the log root transid is always zero, but that'll get fixed. Adds a starting offset to the dev_item. This will let us do better alignment calculations if we know the start of a partition on the disk. Signed-off-by: Chris Mason <>
Diffstat (limited to 'volumes.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/volumes.c b/volumes.c
index c2618479..b27e66ff 100644
--- a/volumes.c
+++ b/volumes.c
@@ -529,6 +529,7 @@ int btrfs_add_device(struct btrfs_trans_handle *trans,
btrfs_set_device_group(leaf, dev_item, 0);
btrfs_set_device_seek_speed(leaf, dev_item, 0);
btrfs_set_device_bandwidth(leaf, dev_item, 0);
+ btrfs_set_device_start_offset(leaf, dev_item, 0);
ptr = (unsigned long)btrfs_device_uuid(dev_item);
write_extent_buffer(leaf, device->uuid, ptr, BTRFS_UUID_SIZE);