]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: change how subvolumes are organized
authorYan, Zheng <zheng.yan@oracle.com>
Mon, 21 Sep 2009 19:56:00 +0000 (15:56 -0400)
committerChris Mason <chris.mason@oracle.com>
Mon, 21 Sep 2009 19:56:00 +0000 (15:56 -0400)
commit5a5d42d0a1cfdbe2b200a7cd7abdf05eea7eccb3
tree2008f348d28c6c19e31924ae4fb414ca929a01f1
parenta3763c159ef92d00be7ab5be6a014af27e0f88fe
Btrfs: change how subvolumes are organized

btrfs allows subvolumes and snapshots anywhere in the directory tree.
If we snapshot a subvolume that contains a link to other subvolume
called subvolA, subvolA can be accessed through both the original
subvolume and the snapshot. This is similar to creating hard link to
directory, and has the very similar problems.

The aim of this patch is enforcing there is only one access point to
each subvolume. Only the first directory entry (the one added when
the subvolume/snapshot was created) is treated as valid access point.
The first directory entry is distinguished by checking root forward
reference. If the corresponding root forward reference is missing,
we know the entry is not the first one.

This patch also adds snapshot/subvolume rename support, the code
allows rename subvolume link across subvolumes.

Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/ctree.h
fs/btrfs/dir-item.c
fs/btrfs/disk-io.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/orphan.c
fs/btrfs/root-tree.c
fs/btrfs/transaction.c