diff options
author | Yan, Zheng <zheng.yan@oracle.com> | 2009-09-21 16:00:26 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2009-09-21 16:00:26 -0400 |
commit | 76dda93c6ae2c1dc3e6cde34569d6aca26b0c918 (patch) | |
tree | f5ca46ec89d4ae2c762952d5f35e2c6f95ac046a /fs/btrfs/ctree.h | |
parent | 4df27c4d5cc1dda54ed7d0a8389347f2df359cf9 (diff) |
Btrfs: add snapshot/subvolume destroy ioctl
This patch adds snapshot/subvolume destroy ioctl. A subvolume that isn't being
used and doesn't contains links to other subvolumes can be destroyed.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 6ade48b227e9..bc57e236ac64 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -839,9 +839,7 @@ struct btrfs_fs_info { | |||
839 | struct mutex transaction_kthread_mutex; | 839 | struct mutex transaction_kthread_mutex; |
840 | struct mutex cleaner_mutex; | 840 | struct mutex cleaner_mutex; |
841 | struct mutex chunk_mutex; | 841 | struct mutex chunk_mutex; |
842 | struct mutex drop_mutex; | ||
843 | struct mutex volume_mutex; | 842 | struct mutex volume_mutex; |
844 | struct mutex tree_reloc_mutex; | ||
845 | /* | 843 | /* |
846 | * this protects the ordered operations list only while we are | 844 | * this protects the ordered operations list only while we are |
847 | * processing all of the entries on it. This way we make | 845 | * processing all of the entries on it. This way we make |
@@ -852,6 +850,10 @@ struct btrfs_fs_info { | |||
852 | struct mutex ordered_operations_mutex; | 850 | struct mutex ordered_operations_mutex; |
853 | struct rw_semaphore extent_commit_sem; | 851 | struct rw_semaphore extent_commit_sem; |
854 | 852 | ||
853 | struct rw_semaphore subvol_sem; | ||
854 | |||
855 | struct srcu_struct subvol_srcu; | ||
856 | |||
855 | struct list_head trans_list; | 857 | struct list_head trans_list; |
856 | struct list_head hashers; | 858 | struct list_head hashers; |
857 | struct list_head dead_roots; | 859 | struct list_head dead_roots; |
@@ -2142,6 +2144,7 @@ int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct | |||
2142 | int btrfs_search_root(struct btrfs_root *root, u64 search_start, | 2144 | int btrfs_search_root(struct btrfs_root *root, u64 search_start, |
2143 | u64 *found_objectid); | 2145 | u64 *found_objectid); |
2144 | int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid); | 2146 | int btrfs_find_dead_roots(struct btrfs_root *root, u64 objectid); |
2147 | int btrfs_find_orphan_roots(struct btrfs_root *tree_root); | ||
2145 | int btrfs_set_root_node(struct btrfs_root_item *item, | 2148 | int btrfs_set_root_node(struct btrfs_root_item *item, |
2146 | struct extent_buffer *node); | 2149 | struct extent_buffer *node); |
2147 | /* dir-item.c */ | 2150 | /* dir-item.c */ |
@@ -2273,7 +2276,7 @@ int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end); | |||
2273 | int btrfs_writepages(struct address_space *mapping, | 2276 | int btrfs_writepages(struct address_space *mapping, |
2274 | struct writeback_control *wbc); | 2277 | struct writeback_control *wbc); |
2275 | int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, | 2278 | int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, |
2276 | struct btrfs_root *new_root, struct dentry *dentry, | 2279 | struct btrfs_root *new_root, |
2277 | u64 new_dirid, u64 alloc_hint); | 2280 | u64 new_dirid, u64 alloc_hint); |
2278 | int btrfs_merge_bio_hook(struct page *page, unsigned long offset, | 2281 | int btrfs_merge_bio_hook(struct page *page, unsigned long offset, |
2279 | size_t size, struct bio *bio, unsigned long bio_flags); | 2282 | size_t size, struct bio *bio, unsigned long bio_flags); |
@@ -2289,6 +2292,7 @@ int btrfs_write_inode(struct inode *inode, int wait); | |||
2289 | void btrfs_dirty_inode(struct inode *inode); | 2292 | void btrfs_dirty_inode(struct inode *inode); |
2290 | struct inode *btrfs_alloc_inode(struct super_block *sb); | 2293 | struct inode *btrfs_alloc_inode(struct super_block *sb); |
2291 | void btrfs_destroy_inode(struct inode *inode); | 2294 | void btrfs_destroy_inode(struct inode *inode); |
2295 | void btrfs_drop_inode(struct inode *inode); | ||
2292 | int btrfs_init_cachep(void); | 2296 | int btrfs_init_cachep(void); |
2293 | void btrfs_destroy_cachep(void); | 2297 | void btrfs_destroy_cachep(void); |
2294 | long btrfs_ioctl_trans_end(struct file *file); | 2298 | long btrfs_ioctl_trans_end(struct file *file); |
@@ -2306,6 +2310,8 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode); | |||
2306 | int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode); | 2310 | int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode); |
2307 | void btrfs_orphan_cleanup(struct btrfs_root *root); | 2311 | void btrfs_orphan_cleanup(struct btrfs_root *root); |
2308 | int btrfs_cont_expand(struct inode *inode, loff_t size); | 2312 | int btrfs_cont_expand(struct inode *inode, loff_t size); |
2313 | int btrfs_invalidate_inodes(struct btrfs_root *root); | ||
2314 | extern struct dentry_operations btrfs_dentry_operations; | ||
2309 | 2315 | ||
2310 | /* ioctl.c */ | 2316 | /* ioctl.c */ |
2311 | long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | 2317 | long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |