Btrfs: introduce subvol uuids and times
authorAlexander Block <ablock84@googlemail.com>
Wed, 25 Jul 2012 15:35:53 +0000 (17:35 +0200)
committerAlexander Block <ablock84@googlemail.com>
Wed, 25 Jul 2012 21:28:38 +0000 (23:28 +0200)
commit8ea05e3a4262b9e6871c349fa3486bcfc72ffd1a
tree893a8ff635b31caf920aaa97948e612640cbac6a
parent91cb916ca26feb99c78c131a1643af3d10fefd96
Btrfs: introduce subvol uuids and times

This patch introduces uuids for subvolumes. Each
subvolume has it's own uuid. In case it was snapshotted,
it also contains parent_uuid. In case it was received,
it also contains received_uuid.

It also introduces subvolume ctime/otime/stime/rtime. The
first two are comparable to the times found in inodes. otime
is the origin/creation time and ctime is the change time.
stime/rtime are only valid on received subvolumes.
stime is the time of the subvolume when it was
sent. rtime is the time of the subvolume when it was
received.

Additionally to the times, we have a transid for each
time. They are updated at the same place as the times.

btrfs receive uses stransid and rtransid to find out
if a received subvolume changed in the meantime.

If an older kernel mounts a filesystem with the
extented fields, all fields become invalid. The next
mount with a new kernel will detect this and reset the
fields.

Signed-off-by: Alexander Block <ablock84@googlemail.com>
Reviewed-by: David Sterba <dave@jikos.cz>
Reviewed-by: Arne Jansen <sensille@gmx.net>
Reviewed-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Reviewed-by: Alex Lyakas <alex.bolshoy.btrfs@gmail.com>
fs/btrfs/check-integrity.c
fs/btrfs/ctree.h
fs/btrfs/disk-io.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/ioctl.h
fs/btrfs/root-tree.c
fs/btrfs/transaction.c