aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-11-17 21:02:50 -0500
committerChris Mason <chris.mason@oracle.com>2008-11-17 21:02:50 -0500
commit3de4586c5278a28107030c336956381f69ff7a9d (patch)
treed636e3806cd5ecff71927d0300e46526fa23de1a /fs/btrfs/ctree.h
parent4ce4cb526f67775c1cce3e3fa01c292672ba874e (diff)
Btrfs: Allow subvolumes and snapshots anywhere in the directory tree
Before, all snapshots and subvolumes lived in a single flat directory. This was awkward and confusing because the single flat directory was only writable with the ioctls. This commit changes the ioctls to create subvols and snapshots at any point in the directory tree. This requires making separate ioctls for snapshot and subvol creation instead of a combining them into one. The subvol ioctl does: btrfsctl -S subvol_name parent_dir After the ioctl is done subvol_name lives inside parent_dir. The snapshot ioctl does: btrfsctl -s path_for_snapshot root_to_snapshot path_for_snapshot can be an absolute or relative path. btrfsctl breaks it up into directory and basename components. root_to_snapshot can be any file or directory in the FS. The snapshot is taken of the entire root where that file lives. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 5ff74282a620..5611f8e035a4 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -606,6 +606,7 @@ struct btrfs_fs_info {
606 struct btrfs_root *tree_root; 606 struct btrfs_root *tree_root;
607 struct btrfs_root *chunk_root; 607 struct btrfs_root *chunk_root;
608 struct btrfs_root *dev_root; 608 struct btrfs_root *dev_root;
609 struct btrfs_root *fs_root;
609 610
610 /* the log root tree is a directory of all the other log roots */ 611 /* the log root tree is a directory of all the other log roots */
611 struct btrfs_root *log_root_tree; 612 struct btrfs_root *log_root_tree;
@@ -758,7 +759,6 @@ struct btrfs_root {
758 struct btrfs_root_item root_item; 759 struct btrfs_root_item root_item;
759 struct btrfs_key root_key; 760 struct btrfs_key root_key;
760 struct btrfs_fs_info *fs_info; 761 struct btrfs_fs_info *fs_info;
761 struct inode *inode;
762 struct extent_io_tree dirty_log_pages; 762 struct extent_io_tree dirty_log_pages;
763 763
764 struct kobject root_kobj; 764 struct kobject root_kobj;
@@ -1876,6 +1876,8 @@ int btrfs_csum_truncate(struct btrfs_trans_handle *trans,
1876#define PageChecked PageFsMisc 1876#define PageChecked PageFsMisc
1877#endif 1877#endif
1878 1878
1879struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry);
1880int btrfs_set_inode_index(struct inode *dir, u64 *index);
1879int btrfs_unlink_inode(struct btrfs_trans_handle *trans, 1881int btrfs_unlink_inode(struct btrfs_trans_handle *trans,
1880 struct btrfs_root *root, 1882 struct btrfs_root *root,
1881 struct inode *dir, struct inode *inode, 1883 struct inode *dir, struct inode *inode,
@@ -1896,9 +1898,6 @@ int btrfs_create_subvol_root(struct btrfs_root *new_root, struct dentry *dentry,
1896 struct btrfs_trans_handle *trans, u64 new_dirid, 1898 struct btrfs_trans_handle *trans, u64 new_dirid,
1897 struct btrfs_block_group_cache *block_group); 1899 struct btrfs_block_group_cache *block_group);
1898 1900
1899void btrfs_invalidate_dcache_root(struct btrfs_root *root, char *name,
1900 int namelen);
1901
1902int btrfs_merge_bio_hook(struct page *page, unsigned long offset, 1901int btrfs_merge_bio_hook(struct page *page, unsigned long offset,
1903 size_t size, struct bio *bio, unsigned long bio_flags); 1902 size_t size, struct bio *bio, unsigned long bio_flags);
1904 1903