aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-11-17 20:42:26 -0500
committerChris Mason <chris.mason@oracle.com>2008-11-17 20:42:26 -0500
commit3394e1607eaf870ebba37d303fbd590a4c569908 (patch)
tree7833927ae6137122bea670544147be6a69f804ad /fs/btrfs/transaction.c
parent3de4586c5278a28107030c336956381f69ff7a9d (diff)
Btrfs: Give each subvol and snapshot their own anonymous devid
Each subvolume has its own private inode number space, and so we need to fill in different device numbers for each subvolume to avoid confusing applications. This commit puts a struct super_block into struct btrfs_root so it can call set_anon_super() and get a different device number generated for each root. btrfs_rename is changed to prevent renames across subvols. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index eec8b2465039..93f23a456a36 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -832,13 +832,13 @@ static noinline int finish_pending_snapshot(struct btrfs_fs_info *fs_info,
832 struct inode *parent_inode; 832 struct inode *parent_inode;
833 struct inode *inode; 833 struct inode *inode;
834 834
835 trans = btrfs_start_transaction(fs_info->fs_root, 1); 835 parent_inode = pending->dentry->d_parent->d_inode;
836 trans = btrfs_start_transaction(BTRFS_I(parent_inode)->root, 1);
836 837
837 /* 838 /*
838 * insert the directory item 839 * insert the directory item
839 */ 840 */
840 namelen = strlen(pending->name); 841 namelen = strlen(pending->name);
841 parent_inode = pending->dentry->d_parent->d_inode;
842 ret = btrfs_set_inode_index(parent_inode, &index); 842 ret = btrfs_set_inode_index(parent_inode, &index);
843 ret = btrfs_insert_dir_item(trans, 843 ret = btrfs_insert_dir_item(trans,
844 BTRFS_I(parent_inode)->root, 844 BTRFS_I(parent_inode)->root,