diff options
| author | Michal Marek <mmarek@suse.cz> | 2010-10-27 18:15:57 -0400 |
|---|---|---|
| committer | Michal Marek <mmarek@suse.cz> | 2010-10-27 18:15:57 -0400 |
| commit | b74b953b998bcc2db91b694446f3a2619ec32de6 (patch) | |
| tree | 6ce24caabd730f6ae9287ed0676ec32e6ff31e9d /fs/btrfs/ctree.h | |
| parent | abb438526201c6a79949ad45375c051b6681c253 (diff) | |
| parent | f6f94e2ab1b33f0082ac22d71f66385a60d8157f (diff) | |
Merge commit 'v2.6.36' into kbuild/misc
Update to be able to fix a recent change to scripts/basic/docproc.c
(commit eda603f).
Diffstat (limited to 'fs/btrfs/ctree.h')
| -rw-r--r-- | fs/btrfs/ctree.h | 186 |
1 files changed, 134 insertions, 52 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 2aa8ec6a0981..eaf286abad17 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/completion.h> | 26 | #include <linux/completion.h> |
| 27 | #include <linux/backing-dev.h> | 27 | #include <linux/backing-dev.h> |
| 28 | #include <linux/wait.h> | 28 | #include <linux/wait.h> |
| 29 | #include <linux/slab.h> | ||
| 29 | #include <asm/kmap_types.h> | 30 | #include <asm/kmap_types.h> |
| 30 | #include "extent_io.h" | 31 | #include "extent_io.h" |
| 31 | #include "extent_map.h" | 32 | #include "extent_map.h" |
| @@ -33,6 +34,7 @@ | |||
| 33 | 34 | ||
| 34 | struct btrfs_trans_handle; | 35 | struct btrfs_trans_handle; |
| 35 | struct btrfs_transaction; | 36 | struct btrfs_transaction; |
| 37 | struct btrfs_pending_snapshot; | ||
| 36 | extern struct kmem_cache *btrfs_trans_handle_cachep; | 38 | extern struct kmem_cache *btrfs_trans_handle_cachep; |
| 37 | extern struct kmem_cache *btrfs_transaction_cachep; | 39 | extern struct kmem_cache *btrfs_transaction_cachep; |
| 38 | extern struct kmem_cache *btrfs_bit_radix_cachep; | 40 | extern struct kmem_cache *btrfs_bit_radix_cachep; |
| @@ -373,11 +375,13 @@ struct btrfs_super_block { | |||
| 373 | * ones specified below then we will fail to mount | 375 | * ones specified below then we will fail to mount |
| 374 | */ | 376 | */ |
| 375 | #define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0) | 377 | #define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0) |
| 378 | #define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (2ULL << 0) | ||
| 376 | 379 | ||
| 377 | #define BTRFS_FEATURE_COMPAT_SUPP 0ULL | 380 | #define BTRFS_FEATURE_COMPAT_SUPP 0ULL |
| 378 | #define BTRFS_FEATURE_COMPAT_RO_SUPP 0ULL | 381 | #define BTRFS_FEATURE_COMPAT_RO_SUPP 0ULL |
| 379 | #define BTRFS_FEATURE_INCOMPAT_SUPP \ | 382 | #define BTRFS_FEATURE_INCOMPAT_SUPP \ |
| 380 | BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF | 383 | (BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF | \ |
| 384 | BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL) | ||
| 381 | 385 | ||
| 382 | /* | 386 | /* |
| 383 | * A leaf is full of items. offset and size tell us where to find | 387 | * A leaf is full of items. offset and size tell us where to find |
| @@ -660,6 +664,7 @@ struct btrfs_csum_item { | |||
| 660 | #define BTRFS_BLOCK_GROUP_RAID1 (1 << 4) | 664 | #define BTRFS_BLOCK_GROUP_RAID1 (1 << 4) |
| 661 | #define BTRFS_BLOCK_GROUP_DUP (1 << 5) | 665 | #define BTRFS_BLOCK_GROUP_DUP (1 << 5) |
| 662 | #define BTRFS_BLOCK_GROUP_RAID10 (1 << 6) | 666 | #define BTRFS_BLOCK_GROUP_RAID10 (1 << 6) |
| 667 | #define BTRFS_NR_RAID_TYPES 5 | ||
| 663 | 668 | ||
| 664 | struct btrfs_block_group_item { | 669 | struct btrfs_block_group_item { |
| 665 | __le64 used; | 670 | __le64 used; |
| @@ -671,42 +676,46 @@ struct btrfs_space_info { | |||
| 671 | u64 flags; | 676 | u64 flags; |
| 672 | 677 | ||
| 673 | u64 total_bytes; /* total bytes in the space */ | 678 | u64 total_bytes; /* total bytes in the space */ |
| 674 | u64 bytes_used; /* total bytes used on disk */ | 679 | u64 bytes_used; /* total bytes used, |
| 680 | this does't take mirrors into account */ | ||
| 675 | u64 bytes_pinned; /* total bytes pinned, will be freed when the | 681 | u64 bytes_pinned; /* total bytes pinned, will be freed when the |
| 676 | transaction finishes */ | 682 | transaction finishes */ |
| 677 | u64 bytes_reserved; /* total bytes the allocator has reserved for | 683 | u64 bytes_reserved; /* total bytes the allocator has reserved for |
| 678 | current allocations */ | 684 | current allocations */ |
| 679 | u64 bytes_readonly; /* total bytes that are read only */ | 685 | u64 bytes_readonly; /* total bytes that are read only */ |
| 680 | u64 bytes_super; /* total bytes reserved for the super blocks */ | 686 | |
| 681 | u64 bytes_root; /* the number of bytes needed to commit a | ||
| 682 | transaction */ | ||
| 683 | u64 bytes_may_use; /* number of bytes that may be used for | 687 | u64 bytes_may_use; /* number of bytes that may be used for |
| 684 | delalloc/allocations */ | 688 | delalloc/allocations */ |
| 685 | u64 bytes_delalloc; /* number of bytes currently reserved for | 689 | u64 disk_used; /* total bytes used on disk */ |
| 686 | delayed allocation */ | ||
| 687 | 690 | ||
| 688 | int full; /* indicates that we cannot allocate any more | 691 | int full; /* indicates that we cannot allocate any more |
| 689 | chunks for this space */ | 692 | chunks for this space */ |
| 690 | int force_alloc; /* set if we need to force a chunk alloc for | 693 | int force_alloc; /* set if we need to force a chunk alloc for |
| 691 | this space */ | 694 | this space */ |
| 692 | int force_delalloc; /* make people start doing filemap_flush until | ||
| 693 | we're under a threshold */ | ||
| 694 | 695 | ||
| 695 | struct list_head list; | 696 | struct list_head list; |
| 696 | 697 | ||
| 697 | /* for controlling how we free up space for allocations */ | ||
| 698 | wait_queue_head_t allocate_wait; | ||
| 699 | wait_queue_head_t flush_wait; | ||
| 700 | int allocating_chunk; | ||
| 701 | int flushing; | ||
| 702 | |||
| 703 | /* for block groups in our same type */ | 698 | /* for block groups in our same type */ |
| 704 | struct list_head block_groups; | 699 | struct list_head block_groups[BTRFS_NR_RAID_TYPES]; |
| 705 | spinlock_t lock; | 700 | spinlock_t lock; |
| 706 | struct rw_semaphore groups_sem; | 701 | struct rw_semaphore groups_sem; |
| 707 | atomic_t caching_threads; | 702 | atomic_t caching_threads; |
| 708 | }; | 703 | }; |
| 709 | 704 | ||
| 705 | struct btrfs_block_rsv { | ||
| 706 | u64 size; | ||
| 707 | u64 reserved; | ||
| 708 | u64 freed[2]; | ||
| 709 | struct btrfs_space_info *space_info; | ||
| 710 | struct list_head list; | ||
| 711 | spinlock_t lock; | ||
| 712 | atomic_t usage; | ||
| 713 | unsigned int priority:8; | ||
| 714 | unsigned int durable:1; | ||
| 715 | unsigned int refill_used:1; | ||
| 716 | unsigned int full:1; | ||
| 717 | }; | ||
| 718 | |||
| 710 | /* | 719 | /* |
| 711 | * free clusters are used to claim free space in relatively large chunks, | 720 | * free clusters are used to claim free space in relatively large chunks, |
| 712 | * allowing us to do less seeky writes. They are used for all metadata | 721 | * allowing us to do less seeky writes. They are used for all metadata |
| @@ -757,6 +766,7 @@ struct btrfs_block_group_cache { | |||
| 757 | spinlock_t lock; | 766 | spinlock_t lock; |
| 758 | u64 pinned; | 767 | u64 pinned; |
| 759 | u64 reserved; | 768 | u64 reserved; |
| 769 | u64 reserved_pinned; | ||
| 760 | u64 bytes_super; | 770 | u64 bytes_super; |
| 761 | u64 flags; | 771 | u64 flags; |
| 762 | u64 sectorsize; | 772 | u64 sectorsize; |
| @@ -822,6 +832,22 @@ struct btrfs_fs_info { | |||
| 822 | /* logical->physical extent mapping */ | 832 | /* logical->physical extent mapping */ |
| 823 | struct btrfs_mapping_tree mapping_tree; | 833 | struct btrfs_mapping_tree mapping_tree; |
| 824 | 834 | ||
| 835 | /* block reservation for extent, checksum and root tree */ | ||
| 836 | struct btrfs_block_rsv global_block_rsv; | ||
| 837 | /* block reservation for delay allocation */ | ||
| 838 | struct btrfs_block_rsv delalloc_block_rsv; | ||
| 839 | /* block reservation for metadata operations */ | ||
| 840 | struct btrfs_block_rsv trans_block_rsv; | ||
| 841 | /* block reservation for chunk tree */ | ||
| 842 | struct btrfs_block_rsv chunk_block_rsv; | ||
| 843 | |||
| 844 | struct btrfs_block_rsv empty_block_rsv; | ||
| 845 | |||
| 846 | /* list of block reservations that cross multiple transactions */ | ||
| 847 | struct list_head durable_block_rsv_list; | ||
| 848 | |||
| 849 | struct mutex durable_block_rsv_mutex; | ||
| 850 | |||
| 825 | u64 generation; | 851 | u64 generation; |
| 826 | u64 last_trans_committed; | 852 | u64 last_trans_committed; |
| 827 | 853 | ||
| @@ -832,7 +858,6 @@ struct btrfs_fs_info { | |||
| 832 | u64 last_trans_log_full_commit; | 858 | u64 last_trans_log_full_commit; |
| 833 | u64 open_ioctl_trans; | 859 | u64 open_ioctl_trans; |
| 834 | unsigned long mount_opt; | 860 | unsigned long mount_opt; |
| 835 | u64 max_extent; | ||
| 836 | u64 max_inline; | 861 | u64 max_inline; |
| 837 | u64 alloc_start; | 862 | u64 alloc_start; |
| 838 | struct btrfs_transaction *running_transaction; | 863 | struct btrfs_transaction *running_transaction; |
| @@ -925,7 +950,6 @@ struct btrfs_fs_info { | |||
| 925 | struct btrfs_workers endio_meta_write_workers; | 950 | struct btrfs_workers endio_meta_write_workers; |
| 926 | struct btrfs_workers endio_write_workers; | 951 | struct btrfs_workers endio_write_workers; |
| 927 | struct btrfs_workers submit_workers; | 952 | struct btrfs_workers submit_workers; |
| 928 | struct btrfs_workers enospc_workers; | ||
| 929 | /* | 953 | /* |
| 930 | * fixup workers take dirty pages that didn't properly go through | 954 | * fixup workers take dirty pages that didn't properly go through |
| 931 | * the cow mechanism and make them safe to write. It happens | 955 | * the cow mechanism and make them safe to write. It happens |
| @@ -941,6 +965,7 @@ struct btrfs_fs_info { | |||
| 941 | int do_barriers; | 965 | int do_barriers; |
| 942 | int closing; | 966 | int closing; |
| 943 | int log_root_recovering; | 967 | int log_root_recovering; |
| 968 | int enospc_unlink; | ||
| 944 | 969 | ||
| 945 | u64 total_pinned; | 970 | u64 total_pinned; |
| 946 | 971 | ||
| @@ -1010,6 +1035,9 @@ struct btrfs_root { | |||
| 1010 | struct completion kobj_unregister; | 1035 | struct completion kobj_unregister; |
| 1011 | struct mutex objectid_mutex; | 1036 | struct mutex objectid_mutex; |
| 1012 | 1037 | ||
| 1038 | spinlock_t accounting_lock; | ||
| 1039 | struct btrfs_block_rsv *block_rsv; | ||
| 1040 | |||
| 1013 | struct mutex log_mutex; | 1041 | struct mutex log_mutex; |
| 1014 | wait_queue_head_t log_writer_wait; | 1042 | wait_queue_head_t log_writer_wait; |
| 1015 | wait_queue_head_t log_commit_wait[2]; | 1043 | wait_queue_head_t log_commit_wait[2]; |
| @@ -1041,7 +1069,6 @@ struct btrfs_root { | |||
| 1041 | int ref_cows; | 1069 | int ref_cows; |
| 1042 | int track_dirty; | 1070 | int track_dirty; |
| 1043 | int in_radix; | 1071 | int in_radix; |
| 1044 | int clean_orphans; | ||
| 1045 | 1072 | ||
| 1046 | u64 defrag_trans_start; | 1073 | u64 defrag_trans_start; |
| 1047 | struct btrfs_key defrag_progress; | 1074 | struct btrfs_key defrag_progress; |
| @@ -1055,8 +1082,11 @@ struct btrfs_root { | |||
| 1055 | 1082 | ||
| 1056 | struct list_head root_list; | 1083 | struct list_head root_list; |
| 1057 | 1084 | ||
| 1058 | spinlock_t list_lock; | 1085 | spinlock_t orphan_lock; |
| 1059 | struct list_head orphan_list; | 1086 | struct list_head orphan_list; |
| 1087 | struct btrfs_block_rsv *orphan_block_rsv; | ||
| 1088 | int orphan_item_inserted; | ||
| 1089 | int orphan_cleanup_state; | ||
| 1060 | 1090 | ||
| 1061 | spinlock_t inode_lock; | 1091 | spinlock_t inode_lock; |
| 1062 | /* red-black tree that keeps track of in-memory inodes */ | 1092 | /* red-black tree that keeps track of in-memory inodes */ |
| @@ -1182,7 +1212,6 @@ struct btrfs_root { | |||
| 1182 | #define BTRFS_INODE_NOATIME (1 << 9) | 1212 | #define BTRFS_INODE_NOATIME (1 << 9) |
| 1183 | #define BTRFS_INODE_DIRSYNC (1 << 10) | 1213 | #define BTRFS_INODE_DIRSYNC (1 << 10) |
| 1184 | 1214 | ||
| 1185 | |||
| 1186 | /* some macros to generate set/get funcs for the struct fields. This | 1215 | /* some macros to generate set/get funcs for the struct fields. This |
| 1187 | * assumes there is a lefoo_to_cpu for every type, so lets make a simple | 1216 | * assumes there is a lefoo_to_cpu for every type, so lets make a simple |
| 1188 | * one for u8: | 1217 | * one for u8: |
| @@ -1842,7 +1871,7 @@ BTRFS_SETGET_STACK_FUNCS(super_num_devices, struct btrfs_super_block, | |||
| 1842 | BTRFS_SETGET_STACK_FUNCS(super_compat_flags, struct btrfs_super_block, | 1871 | BTRFS_SETGET_STACK_FUNCS(super_compat_flags, struct btrfs_super_block, |
| 1843 | compat_flags, 64); | 1872 | compat_flags, 64); |
| 1844 | BTRFS_SETGET_STACK_FUNCS(super_compat_ro_flags, struct btrfs_super_block, | 1873 | BTRFS_SETGET_STACK_FUNCS(super_compat_ro_flags, struct btrfs_super_block, |
| 1845 | compat_flags, 64); | 1874 | compat_ro_flags, 64); |
| 1846 | BTRFS_SETGET_STACK_FUNCS(super_incompat_flags, struct btrfs_super_block, | 1875 | BTRFS_SETGET_STACK_FUNCS(super_incompat_flags, struct btrfs_super_block, |
| 1847 | incompat_flags, 64); | 1876 | incompat_flags, 64); |
| 1848 | BTRFS_SETGET_STACK_FUNCS(super_csum_type, struct btrfs_super_block, | 1877 | BTRFS_SETGET_STACK_FUNCS(super_csum_type, struct btrfs_super_block, |
| @@ -1964,6 +1993,9 @@ void btrfs_put_block_group(struct btrfs_block_group_cache *cache); | |||
| 1964 | int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, | 1993 | int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, |
| 1965 | struct btrfs_root *root, unsigned long count); | 1994 | struct btrfs_root *root, unsigned long count); |
| 1966 | int btrfs_lookup_extent(struct btrfs_root *root, u64 start, u64 len); | 1995 | int btrfs_lookup_extent(struct btrfs_root *root, u64 start, u64 len); |
| 1996 | int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans, | ||
| 1997 | struct btrfs_root *root, u64 bytenr, | ||
| 1998 | u64 num_bytes, u64 *refs, u64 *flags); | ||
| 1967 | int btrfs_pin_extent(struct btrfs_root *root, | 1999 | int btrfs_pin_extent(struct btrfs_root *root, |
| 1968 | u64 bytenr, u64 num, int reserved); | 2000 | u64 bytenr, u64 num, int reserved); |
| 1969 | int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans, | 2001 | int btrfs_drop_leaf_ref(struct btrfs_trans_handle *trans, |
| @@ -1983,10 +2015,10 @@ struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | |||
| 1983 | u64 parent, u64 root_objectid, | 2015 | u64 parent, u64 root_objectid, |
| 1984 | struct btrfs_disk_key *key, int level, | 2016 | struct btrfs_disk_key *key, int level, |
| 1985 | u64 hint, u64 empty_size); | 2017 | u64 hint, u64 empty_size); |
| 1986 | int btrfs_free_tree_block(struct btrfs_trans_handle *trans, | 2018 | void btrfs_free_tree_block(struct btrfs_trans_handle *trans, |
| 1987 | struct btrfs_root *root, | 2019 | struct btrfs_root *root, |
| 1988 | u64 bytenr, u32 blocksize, | 2020 | struct extent_buffer *buf, |
| 1989 | u64 parent, u64 root_objectid, int level); | 2021 | u64 parent, int last_ref); |
| 1990 | struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans, | 2022 | struct extent_buffer *btrfs_init_new_buffer(struct btrfs_trans_handle *trans, |
| 1991 | struct btrfs_root *root, | 2023 | struct btrfs_root *root, |
| 1992 | u64 bytenr, u32 blocksize, | 2024 | u64 bytenr, u32 blocksize, |
| @@ -2040,27 +2072,49 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans, | |||
| 2040 | u64 size); | 2072 | u64 size); |
| 2041 | int btrfs_remove_block_group(struct btrfs_trans_handle *trans, | 2073 | int btrfs_remove_block_group(struct btrfs_trans_handle *trans, |
| 2042 | struct btrfs_root *root, u64 group_start); | 2074 | struct btrfs_root *root, u64 group_start); |
| 2043 | int btrfs_prepare_block_group_relocation(struct btrfs_root *root, | ||
| 2044 | struct btrfs_block_group_cache *group); | ||
| 2045 | |||
| 2046 | u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags); | 2075 | u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags); |
| 2047 | void btrfs_set_inode_space_info(struct btrfs_root *root, struct inode *ionde); | 2076 | void btrfs_set_inode_space_info(struct btrfs_root *root, struct inode *ionde); |
| 2048 | void btrfs_clear_space_info_full(struct btrfs_fs_info *info); | 2077 | void btrfs_clear_space_info_full(struct btrfs_fs_info *info); |
| 2049 | 2078 | int btrfs_check_data_free_space(struct inode *inode, u64 bytes); | |
| 2050 | int btrfs_reserve_metadata_space(struct btrfs_root *root, int num_items); | 2079 | void btrfs_free_reserved_data_space(struct inode *inode, u64 bytes); |
| 2051 | int btrfs_unreserve_metadata_space(struct btrfs_root *root, int num_items); | 2080 | int btrfs_trans_reserve_metadata(struct btrfs_trans_handle *trans, |
| 2052 | int btrfs_unreserve_metadata_for_delalloc(struct btrfs_root *root, | 2081 | struct btrfs_root *root, |
| 2053 | struct inode *inode, int num_items); | 2082 | int num_items, int *retries); |
| 2054 | int btrfs_reserve_metadata_for_delalloc(struct btrfs_root *root, | 2083 | void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, |
| 2055 | struct inode *inode, int num_items); | 2084 | struct btrfs_root *root); |
| 2056 | int btrfs_check_data_free_space(struct btrfs_root *root, struct inode *inode, | 2085 | int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans, |
| 2057 | u64 bytes); | 2086 | struct inode *inode); |
| 2058 | void btrfs_free_reserved_data_space(struct btrfs_root *root, | 2087 | void btrfs_orphan_release_metadata(struct inode *inode); |
| 2059 | struct inode *inode, u64 bytes); | 2088 | int btrfs_snap_reserve_metadata(struct btrfs_trans_handle *trans, |
| 2060 | void btrfs_delalloc_reserve_space(struct btrfs_root *root, struct inode *inode, | 2089 | struct btrfs_pending_snapshot *pending); |
| 2061 | u64 bytes); | 2090 | int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes); |
| 2062 | void btrfs_delalloc_free_space(struct btrfs_root *root, struct inode *inode, | 2091 | void btrfs_delalloc_release_metadata(struct inode *inode, u64 num_bytes); |
| 2063 | u64 bytes); | 2092 | int btrfs_delalloc_reserve_space(struct inode *inode, u64 num_bytes); |
| 2093 | void btrfs_delalloc_release_space(struct inode *inode, u64 num_bytes); | ||
| 2094 | void btrfs_init_block_rsv(struct btrfs_block_rsv *rsv); | ||
| 2095 | struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_root *root); | ||
| 2096 | void btrfs_free_block_rsv(struct btrfs_root *root, | ||
| 2097 | struct btrfs_block_rsv *rsv); | ||
| 2098 | void btrfs_add_durable_block_rsv(struct btrfs_fs_info *fs_info, | ||
| 2099 | struct btrfs_block_rsv *rsv); | ||
| 2100 | int btrfs_block_rsv_add(struct btrfs_trans_handle *trans, | ||
| 2101 | struct btrfs_root *root, | ||
| 2102 | struct btrfs_block_rsv *block_rsv, | ||
| 2103 | u64 num_bytes, int *retries); | ||
| 2104 | int btrfs_block_rsv_check(struct btrfs_trans_handle *trans, | ||
| 2105 | struct btrfs_root *root, | ||
| 2106 | struct btrfs_block_rsv *block_rsv, | ||
| 2107 | u64 min_reserved, int min_factor); | ||
| 2108 | int btrfs_block_rsv_migrate(struct btrfs_block_rsv *src_rsv, | ||
| 2109 | struct btrfs_block_rsv *dst_rsv, | ||
| 2110 | u64 num_bytes); | ||
| 2111 | void btrfs_block_rsv_release(struct btrfs_root *root, | ||
| 2112 | struct btrfs_block_rsv *block_rsv, | ||
| 2113 | u64 num_bytes); | ||
| 2114 | int btrfs_set_block_group_ro(struct btrfs_root *root, | ||
| 2115 | struct btrfs_block_group_cache *cache); | ||
| 2116 | int btrfs_set_block_group_rw(struct btrfs_root *root, | ||
| 2117 | struct btrfs_block_group_cache *cache); | ||
| 2064 | /* ctree.c */ | 2118 | /* ctree.c */ |
| 2065 | int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, | 2119 | int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, |
| 2066 | int level, int *slot); | 2120 | int level, int *slot); |
| @@ -2151,7 +2205,8 @@ static inline int btrfs_insert_empty_item(struct btrfs_trans_handle *trans, | |||
| 2151 | int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); | 2205 | int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); |
| 2152 | int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); | 2206 | int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); |
| 2153 | int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf); | 2207 | int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf); |
| 2154 | int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref); | 2208 | int btrfs_drop_snapshot(struct btrfs_root *root, |
| 2209 | struct btrfs_block_rsv *block_rsv, int update_ref); | ||
| 2155 | int btrfs_drop_subtree(struct btrfs_trans_handle *trans, | 2210 | int btrfs_drop_subtree(struct btrfs_trans_handle *trans, |
| 2156 | struct btrfs_root *root, | 2211 | struct btrfs_root *root, |
| 2157 | struct extent_buffer *node, | 2212 | struct extent_buffer *node, |
| @@ -2244,6 +2299,12 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans, | |||
| 2244 | struct btrfs_root *root, | 2299 | struct btrfs_root *root, |
| 2245 | const char *name, int name_len, | 2300 | const char *name, int name_len, |
| 2246 | u64 inode_objectid, u64 ref_objectid, u64 *index); | 2301 | u64 inode_objectid, u64 ref_objectid, u64 *index); |
| 2302 | struct btrfs_inode_ref * | ||
| 2303 | btrfs_lookup_inode_ref(struct btrfs_trans_handle *trans, | ||
| 2304 | struct btrfs_root *root, | ||
| 2305 | struct btrfs_path *path, | ||
| 2306 | const char *name, int name_len, | ||
| 2307 | u64 inode_objectid, u64 ref_objectid, int mod); | ||
| 2247 | int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans, | 2308 | int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans, |
| 2248 | struct btrfs_root *root, | 2309 | struct btrfs_root *root, |
| 2249 | struct btrfs_path *path, u64 objectid); | 2310 | struct btrfs_path *path, u64 objectid); |
| @@ -2256,6 +2317,8 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, | |||
| 2256 | struct btrfs_root *root, u64 bytenr, u64 len); | 2317 | struct btrfs_root *root, u64 bytenr, u64 len); |
| 2257 | int btrfs_lookup_bio_sums(struct btrfs_root *root, struct inode *inode, | 2318 | int btrfs_lookup_bio_sums(struct btrfs_root *root, struct inode *inode, |
| 2258 | struct bio *bio, u32 *dst); | 2319 | struct bio *bio, u32 *dst); |
| 2320 | int btrfs_lookup_bio_sums_dio(struct btrfs_root *root, struct inode *inode, | ||
| 2321 | struct bio *bio, u64 logical_offset, u32 *dst); | ||
| 2259 | int btrfs_insert_file_extent(struct btrfs_trans_handle *trans, | 2322 | int btrfs_insert_file_extent(struct btrfs_trans_handle *trans, |
| 2260 | struct btrfs_root *root, | 2323 | struct btrfs_root *root, |
| 2261 | u64 objectid, u64 pos, | 2324 | u64 objectid, u64 pos, |
| @@ -2310,7 +2373,9 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, | |||
| 2310 | u32 min_type); | 2373 | u32 min_type); |
| 2311 | 2374 | ||
| 2312 | int btrfs_start_delalloc_inodes(struct btrfs_root *root, int delay_iput); | 2375 | int btrfs_start_delalloc_inodes(struct btrfs_root *root, int delay_iput); |
| 2313 | int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end); | 2376 | int btrfs_start_one_delalloc_inode(struct btrfs_root *root, int delay_iput); |
| 2377 | int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end, | ||
| 2378 | struct extent_state **cached_state); | ||
| 2314 | int btrfs_writepages(struct address_space *mapping, | 2379 | int btrfs_writepages(struct address_space *mapping, |
| 2315 | struct writeback_control *wbc); | 2380 | struct writeback_control *wbc); |
| 2316 | int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, | 2381 | int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, |
| @@ -2324,18 +2389,18 @@ unsigned long btrfs_force_ra(struct address_space *mapping, | |||
| 2324 | pgoff_t offset, pgoff_t last_index); | 2389 | pgoff_t offset, pgoff_t last_index); |
| 2325 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); | 2390 | int btrfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); |
| 2326 | int btrfs_readpage(struct file *file, struct page *page); | 2391 | int btrfs_readpage(struct file *file, struct page *page); |
| 2327 | void btrfs_delete_inode(struct inode *inode); | 2392 | void btrfs_evict_inode(struct inode *inode); |
| 2328 | void btrfs_put_inode(struct inode *inode); | 2393 | void btrfs_put_inode(struct inode *inode); |
| 2329 | int btrfs_write_inode(struct inode *inode, int wait); | 2394 | int btrfs_write_inode(struct inode *inode, struct writeback_control *wbc); |
| 2330 | void btrfs_dirty_inode(struct inode *inode); | 2395 | void btrfs_dirty_inode(struct inode *inode); |
| 2331 | struct inode *btrfs_alloc_inode(struct super_block *sb); | 2396 | struct inode *btrfs_alloc_inode(struct super_block *sb); |
| 2332 | void btrfs_destroy_inode(struct inode *inode); | 2397 | void btrfs_destroy_inode(struct inode *inode); |
| 2333 | void btrfs_drop_inode(struct inode *inode); | 2398 | int btrfs_drop_inode(struct inode *inode); |
| 2334 | int btrfs_init_cachep(void); | 2399 | int btrfs_init_cachep(void); |
| 2335 | void btrfs_destroy_cachep(void); | 2400 | void btrfs_destroy_cachep(void); |
| 2336 | long btrfs_ioctl_trans_end(struct file *file); | 2401 | long btrfs_ioctl_trans_end(struct file *file); |
| 2337 | struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location, | 2402 | struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location, |
| 2338 | struct btrfs_root *root); | 2403 | struct btrfs_root *root, int *was_new); |
| 2339 | int btrfs_commit_write(struct file *file, struct page *page, | 2404 | int btrfs_commit_write(struct file *file, struct page *page, |
| 2340 | unsigned from, unsigned to); | 2405 | unsigned from, unsigned to); |
| 2341 | struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, | 2406 | struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, |
| @@ -2347,10 +2412,20 @@ int btrfs_update_inode(struct btrfs_trans_handle *trans, | |||
| 2347 | int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode); | 2412 | int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode); |
| 2348 | int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode); | 2413 | int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode); |
| 2349 | void btrfs_orphan_cleanup(struct btrfs_root *root); | 2414 | void btrfs_orphan_cleanup(struct btrfs_root *root); |
| 2415 | void btrfs_orphan_pre_snapshot(struct btrfs_trans_handle *trans, | ||
| 2416 | struct btrfs_pending_snapshot *pending, | ||
| 2417 | u64 *bytes_to_reserve); | ||
| 2418 | void btrfs_orphan_post_snapshot(struct btrfs_trans_handle *trans, | ||
| 2419 | struct btrfs_pending_snapshot *pending); | ||
| 2420 | void btrfs_orphan_commit_root(struct btrfs_trans_handle *trans, | ||
| 2421 | struct btrfs_root *root); | ||
| 2350 | int btrfs_cont_expand(struct inode *inode, loff_t size); | 2422 | int btrfs_cont_expand(struct inode *inode, loff_t size); |
| 2351 | int btrfs_invalidate_inodes(struct btrfs_root *root); | 2423 | int btrfs_invalidate_inodes(struct btrfs_root *root); |
| 2352 | void btrfs_add_delayed_iput(struct inode *inode); | 2424 | void btrfs_add_delayed_iput(struct inode *inode); |
| 2353 | void btrfs_run_delayed_iputs(struct btrfs_root *root); | 2425 | void btrfs_run_delayed_iputs(struct btrfs_root *root); |
| 2426 | int btrfs_prealloc_file_range(struct inode *inode, int mode, | ||
| 2427 | u64 start, u64 num_bytes, u64 min_size, | ||
| 2428 | loff_t actual_len, u64 *alloc_hint); | ||
| 2354 | extern const struct dentry_operations btrfs_dentry_operations; | 2429 | extern const struct dentry_operations btrfs_dentry_operations; |
| 2355 | 2430 | ||
| 2356 | /* ioctl.c */ | 2431 | /* ioctl.c */ |
| @@ -2359,7 +2434,7 @@ void btrfs_update_iflags(struct inode *inode); | |||
| 2359 | void btrfs_inherit_iflags(struct inode *inode, struct inode *dir); | 2434 | void btrfs_inherit_iflags(struct inode *inode, struct inode *dir); |
| 2360 | 2435 | ||
| 2361 | /* file.c */ | 2436 | /* file.c */ |
| 2362 | int btrfs_sync_file(struct file *file, struct dentry *dentry, int datasync); | 2437 | int btrfs_sync_file(struct file *file, int datasync); |
| 2363 | int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, | 2438 | int btrfs_drop_extent_cache(struct inode *inode, u64 start, u64 end, |
| 2364 | int skip_pinned); | 2439 | int skip_pinned); |
| 2365 | int btrfs_check_file(struct btrfs_root *root, struct inode *inode); | 2440 | int btrfs_check_file(struct btrfs_root *root, struct inode *inode); |
| @@ -2386,7 +2461,6 @@ void btrfs_sysfs_del_super(struct btrfs_fs_info *root); | |||
| 2386 | ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size); | 2461 | ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size); |
| 2387 | 2462 | ||
| 2388 | /* super.c */ | 2463 | /* super.c */ |
| 2389 | u64 btrfs_parse_size(char *str); | ||
| 2390 | int btrfs_parse_options(struct btrfs_root *root, char *options); | 2464 | int btrfs_parse_options(struct btrfs_root *root, char *options); |
| 2391 | int btrfs_sync_fs(struct super_block *sb, int wait); | 2465 | int btrfs_sync_fs(struct super_block *sb, int wait); |
| 2392 | 2466 | ||
| @@ -2408,4 +2482,12 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans, | |||
| 2408 | struct btrfs_root *root); | 2482 | struct btrfs_root *root); |
| 2409 | int btrfs_recover_relocation(struct btrfs_root *root); | 2483 | int btrfs_recover_relocation(struct btrfs_root *root); |
| 2410 | int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len); | 2484 | int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len); |
| 2485 | void btrfs_reloc_cow_block(struct btrfs_trans_handle *trans, | ||
| 2486 | struct btrfs_root *root, struct extent_buffer *buf, | ||
| 2487 | struct extent_buffer *cow); | ||
| 2488 | void btrfs_reloc_pre_snapshot(struct btrfs_trans_handle *trans, | ||
| 2489 | struct btrfs_pending_snapshot *pending, | ||
| 2490 | u64 *bytes_to_reserve); | ||
| 2491 | void btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans, | ||
| 2492 | struct btrfs_pending_snapshot *pending); | ||
| 2411 | #endif | 2493 | #endif |
