diff options
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 134 |
1 files changed, 99 insertions, 35 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 7506825211a2..2c1a42ca519f 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -521,9 +521,15 @@ struct btrfs_super_block { | |||
521 | #define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6) | 521 | #define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6) |
522 | #define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) | 522 | #define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) |
523 | #define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8) | 523 | #define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8) |
524 | #define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9) | ||
524 | 525 | ||
525 | #define BTRFS_FEATURE_COMPAT_SUPP 0ULL | 526 | #define BTRFS_FEATURE_COMPAT_SUPP 0ULL |
527 | #define BTRFS_FEATURE_COMPAT_SAFE_SET 0ULL | ||
528 | #define BTRFS_FEATURE_COMPAT_SAFE_CLEAR 0ULL | ||
526 | #define BTRFS_FEATURE_COMPAT_RO_SUPP 0ULL | 529 | #define BTRFS_FEATURE_COMPAT_RO_SUPP 0ULL |
530 | #define BTRFS_FEATURE_COMPAT_RO_SAFE_SET 0ULL | ||
531 | #define BTRFS_FEATURE_COMPAT_RO_SAFE_CLEAR 0ULL | ||
532 | |||
527 | #define BTRFS_FEATURE_INCOMPAT_SUPP \ | 533 | #define BTRFS_FEATURE_INCOMPAT_SUPP \ |
528 | (BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF | \ | 534 | (BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF | \ |
529 | BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL | \ | 535 | BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL | \ |
@@ -532,7 +538,12 @@ struct btrfs_super_block { | |||
532 | BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO | \ | 538 | BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO | \ |
533 | BTRFS_FEATURE_INCOMPAT_RAID56 | \ | 539 | BTRFS_FEATURE_INCOMPAT_RAID56 | \ |
534 | BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF | \ | 540 | BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF | \ |
535 | BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) | 541 | BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA | \ |
542 | BTRFS_FEATURE_INCOMPAT_NO_HOLES) | ||
543 | |||
544 | #define BTRFS_FEATURE_INCOMPAT_SAFE_SET \ | ||
545 | (BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) | ||
546 | #define BTRFS_FEATURE_INCOMPAT_SAFE_CLEAR 0ULL | ||
536 | 547 | ||
537 | /* | 548 | /* |
538 | * A leaf is full of items. offset and size tell us where to find | 549 | * A leaf is full of items. offset and size tell us where to find |
@@ -1094,7 +1105,7 @@ struct btrfs_qgroup_limit_item { | |||
1094 | } __attribute__ ((__packed__)); | 1105 | } __attribute__ ((__packed__)); |
1095 | 1106 | ||
1096 | struct btrfs_space_info { | 1107 | struct btrfs_space_info { |
1097 | u64 flags; | 1108 | spinlock_t lock; |
1098 | 1109 | ||
1099 | u64 total_bytes; /* total bytes in the space, | 1110 | u64 total_bytes; /* total bytes in the space, |
1100 | this doesn't take mirrors into account */ | 1111 | this doesn't take mirrors into account */ |
@@ -1104,14 +1115,25 @@ struct btrfs_space_info { | |||
1104 | transaction finishes */ | 1115 | transaction finishes */ |
1105 | u64 bytes_reserved; /* total bytes the allocator has reserved for | 1116 | u64 bytes_reserved; /* total bytes the allocator has reserved for |
1106 | current allocations */ | 1117 | current allocations */ |
1107 | u64 bytes_readonly; /* total bytes that are read only */ | ||
1108 | |||
1109 | u64 bytes_may_use; /* number of bytes that may be used for | 1118 | u64 bytes_may_use; /* number of bytes that may be used for |
1110 | delalloc/allocations */ | 1119 | delalloc/allocations */ |
1120 | u64 bytes_readonly; /* total bytes that are read only */ | ||
1121 | |||
1122 | unsigned int full:1; /* indicates that we cannot allocate any more | ||
1123 | chunks for this space */ | ||
1124 | unsigned int chunk_alloc:1; /* set if we are allocating a chunk */ | ||
1125 | |||
1126 | unsigned int flush:1; /* set if we are trying to make space */ | ||
1127 | |||
1128 | unsigned int force_alloc; /* set if we need to force a chunk | ||
1129 | alloc for this space */ | ||
1130 | |||
1111 | u64 disk_used; /* total bytes used on disk */ | 1131 | u64 disk_used; /* total bytes used on disk */ |
1112 | u64 disk_total; /* total bytes on disk, takes mirrors into | 1132 | u64 disk_total; /* total bytes on disk, takes mirrors into |
1113 | account */ | 1133 | account */ |
1114 | 1134 | ||
1135 | u64 flags; | ||
1136 | |||
1115 | /* | 1137 | /* |
1116 | * bytes_pinned is kept in line with what is actually pinned, as in | 1138 | * bytes_pinned is kept in line with what is actually pinned, as in |
1117 | * we've called update_block_group and dropped the bytes_used counter | 1139 | * we've called update_block_group and dropped the bytes_used counter |
@@ -1124,22 +1146,15 @@ struct btrfs_space_info { | |||
1124 | */ | 1146 | */ |
1125 | struct percpu_counter total_bytes_pinned; | 1147 | struct percpu_counter total_bytes_pinned; |
1126 | 1148 | ||
1127 | unsigned int full:1; /* indicates that we cannot allocate any more | ||
1128 | chunks for this space */ | ||
1129 | unsigned int chunk_alloc:1; /* set if we are allocating a chunk */ | ||
1130 | |||
1131 | unsigned int flush:1; /* set if we are trying to make space */ | ||
1132 | |||
1133 | unsigned int force_alloc; /* set if we need to force a chunk | ||
1134 | alloc for this space */ | ||
1135 | |||
1136 | struct list_head list; | 1149 | struct list_head list; |
1137 | 1150 | ||
1151 | struct rw_semaphore groups_sem; | ||
1138 | /* for block groups in our same type */ | 1152 | /* for block groups in our same type */ |
1139 | struct list_head block_groups[BTRFS_NR_RAID_TYPES]; | 1153 | struct list_head block_groups[BTRFS_NR_RAID_TYPES]; |
1140 | spinlock_t lock; | ||
1141 | struct rw_semaphore groups_sem; | ||
1142 | wait_queue_head_t wait; | 1154 | wait_queue_head_t wait; |
1155 | |||
1156 | struct kobject kobj; | ||
1157 | struct kobject block_group_kobjs[BTRFS_NR_RAID_TYPES]; | ||
1143 | }; | 1158 | }; |
1144 | 1159 | ||
1145 | #define BTRFS_BLOCK_RSV_GLOBAL 1 | 1160 | #define BTRFS_BLOCK_RSV_GLOBAL 1 |
@@ -1346,6 +1361,7 @@ struct btrfs_fs_info { | |||
1346 | 1361 | ||
1347 | u64 generation; | 1362 | u64 generation; |
1348 | u64 last_trans_committed; | 1363 | u64 last_trans_committed; |
1364 | u64 avg_delayed_ref_runtime; | ||
1349 | 1365 | ||
1350 | /* | 1366 | /* |
1351 | * this is updated to the current trans every time a full commit | 1367 | * this is updated to the current trans every time a full commit |
@@ -1448,7 +1464,6 @@ struct btrfs_fs_info { | |||
1448 | spinlock_t tree_mod_seq_lock; | 1464 | spinlock_t tree_mod_seq_lock; |
1449 | atomic64_t tree_mod_seq; | 1465 | atomic64_t tree_mod_seq; |
1450 | struct list_head tree_mod_seq_list; | 1466 | struct list_head tree_mod_seq_list; |
1451 | struct seq_list tree_mod_seq_elem; | ||
1452 | 1467 | ||
1453 | /* this protects tree_mod_log */ | 1468 | /* this protects tree_mod_log */ |
1454 | rwlock_t tree_mod_log_lock; | 1469 | rwlock_t tree_mod_log_lock; |
@@ -1515,6 +1530,8 @@ struct btrfs_fs_info { | |||
1515 | int thread_pool_size; | 1530 | int thread_pool_size; |
1516 | 1531 | ||
1517 | struct kobject super_kobj; | 1532 | struct kobject super_kobj; |
1533 | struct kobject *space_info_kobj; | ||
1534 | struct kobject *device_dir_kobj; | ||
1518 | struct completion kobj_unregister; | 1535 | struct completion kobj_unregister; |
1519 | int do_barriers; | 1536 | int do_barriers; |
1520 | int closing; | 1537 | int closing; |
@@ -1643,6 +1660,10 @@ struct btrfs_fs_info { | |||
1643 | spinlock_t reada_lock; | 1660 | spinlock_t reada_lock; |
1644 | struct radix_tree_root reada_tree; | 1661 | struct radix_tree_root reada_tree; |
1645 | 1662 | ||
1663 | /* Extent buffer radix tree */ | ||
1664 | spinlock_t buffer_lock; | ||
1665 | struct radix_tree_root buffer_radix; | ||
1666 | |||
1646 | /* next backup root to be overwritten */ | 1667 | /* next backup root to be overwritten */ |
1647 | int backup_root_index; | 1668 | int backup_root_index; |
1648 | 1669 | ||
@@ -1795,6 +1816,12 @@ struct btrfs_root { | |||
1795 | struct list_head ordered_extents; | 1816 | struct list_head ordered_extents; |
1796 | struct list_head ordered_root; | 1817 | struct list_head ordered_root; |
1797 | u64 nr_ordered_extents; | 1818 | u64 nr_ordered_extents; |
1819 | |||
1820 | /* | ||
1821 | * Number of currently running SEND ioctls to prevent | ||
1822 | * manipulation with the read-only status via SUBVOL_SETFLAGS | ||
1823 | */ | ||
1824 | int send_in_progress; | ||
1798 | }; | 1825 | }; |
1799 | 1826 | ||
1800 | struct btrfs_ioctl_defrag_range_args { | 1827 | struct btrfs_ioctl_defrag_range_args { |
@@ -1997,6 +2024,7 @@ struct btrfs_ioctl_defrag_range_args { | |||
1997 | #define BTRFS_MOUNT_CHECK_INTEGRITY_INCLUDING_EXTENT_DATA (1 << 21) | 2024 | #define BTRFS_MOUNT_CHECK_INTEGRITY_INCLUDING_EXTENT_DATA (1 << 21) |
1998 | #define BTRFS_MOUNT_PANIC_ON_FATAL_ERROR (1 << 22) | 2025 | #define BTRFS_MOUNT_PANIC_ON_FATAL_ERROR (1 << 22) |
1999 | #define BTRFS_MOUNT_RESCAN_UUID_TREE (1 << 23) | 2026 | #define BTRFS_MOUNT_RESCAN_UUID_TREE (1 << 23) |
2027 | #define BTRFS_MOUNT_CHANGE_INODE_CACHE (1 << 24) | ||
2000 | 2028 | ||
2001 | #define BTRFS_DEFAULT_COMMIT_INTERVAL (30) | 2029 | #define BTRFS_DEFAULT_COMMIT_INTERVAL (30) |
2002 | 2030 | ||
@@ -2925,6 +2953,10 @@ BTRFS_SETGET_STACK_FUNCS(stack_file_extent_generation, | |||
2925 | struct btrfs_file_extent_item, generation, 64); | 2953 | struct btrfs_file_extent_item, generation, 64); |
2926 | BTRFS_SETGET_STACK_FUNCS(stack_file_extent_num_bytes, | 2954 | BTRFS_SETGET_STACK_FUNCS(stack_file_extent_num_bytes, |
2927 | struct btrfs_file_extent_item, num_bytes, 64); | 2955 | struct btrfs_file_extent_item, num_bytes, 64); |
2956 | BTRFS_SETGET_STACK_FUNCS(stack_file_extent_disk_num_bytes, | ||
2957 | struct btrfs_file_extent_item, disk_num_bytes, 64); | ||
2958 | BTRFS_SETGET_STACK_FUNCS(stack_file_extent_compression, | ||
2959 | struct btrfs_file_extent_item, compression, 8); | ||
2928 | 2960 | ||
2929 | static inline unsigned long | 2961 | static inline unsigned long |
2930 | btrfs_file_extent_inline_start(struct btrfs_file_extent_item *e) | 2962 | btrfs_file_extent_inline_start(struct btrfs_file_extent_item *e) |
@@ -2958,15 +2990,6 @@ BTRFS_SETGET_FUNCS(file_extent_encryption, struct btrfs_file_extent_item, | |||
2958 | BTRFS_SETGET_FUNCS(file_extent_other_encoding, struct btrfs_file_extent_item, | 2990 | BTRFS_SETGET_FUNCS(file_extent_other_encoding, struct btrfs_file_extent_item, |
2959 | other_encoding, 16); | 2991 | other_encoding, 16); |
2960 | 2992 | ||
2961 | /* this returns the number of file bytes represented by the inline item. | ||
2962 | * If an item is compressed, this is the uncompressed size | ||
2963 | */ | ||
2964 | static inline u32 btrfs_file_extent_inline_len(struct extent_buffer *eb, | ||
2965 | struct btrfs_file_extent_item *e) | ||
2966 | { | ||
2967 | return btrfs_file_extent_ram_bytes(eb, e); | ||
2968 | } | ||
2969 | |||
2970 | /* | 2993 | /* |
2971 | * this returns the number of bytes used by the item on disk, minus the | 2994 | * this returns the number of bytes used by the item on disk, minus the |
2972 | * size of any extent headers. If a file is compressed on disk, this is | 2995 | * size of any extent headers. If a file is compressed on disk, this is |
@@ -2980,6 +3003,32 @@ static inline u32 btrfs_file_extent_inline_item_len(struct extent_buffer *eb, | |||
2980 | return btrfs_item_size(eb, e) - offset; | 3003 | return btrfs_item_size(eb, e) - offset; |
2981 | } | 3004 | } |
2982 | 3005 | ||
3006 | /* this returns the number of file bytes represented by the inline item. | ||
3007 | * If an item is compressed, this is the uncompressed size | ||
3008 | */ | ||
3009 | static inline u32 btrfs_file_extent_inline_len(struct extent_buffer *eb, | ||
3010 | int slot, | ||
3011 | struct btrfs_file_extent_item *fi) | ||
3012 | { | ||
3013 | struct btrfs_map_token token; | ||
3014 | |||
3015 | btrfs_init_map_token(&token); | ||
3016 | /* | ||
3017 | * return the space used on disk if this item isn't | ||
3018 | * compressed or encoded | ||
3019 | */ | ||
3020 | if (btrfs_token_file_extent_compression(eb, fi, &token) == 0 && | ||
3021 | btrfs_token_file_extent_encryption(eb, fi, &token) == 0 && | ||
3022 | btrfs_token_file_extent_other_encoding(eb, fi, &token) == 0) { | ||
3023 | return btrfs_file_extent_inline_item_len(eb, | ||
3024 | btrfs_item_nr(slot)); | ||
3025 | } | ||
3026 | |||
3027 | /* otherwise use the ram bytes field */ | ||
3028 | return btrfs_token_file_extent_ram_bytes(eb, fi, &token); | ||
3029 | } | ||
3030 | |||
3031 | |||
2983 | /* btrfs_dev_stats_item */ | 3032 | /* btrfs_dev_stats_item */ |
2984 | static inline u64 btrfs_dev_stats_value(struct extent_buffer *eb, | 3033 | static inline u64 btrfs_dev_stats_value(struct extent_buffer *eb, |
2985 | struct btrfs_dev_stats_item *ptr, | 3034 | struct btrfs_dev_stats_item *ptr, |
@@ -3143,6 +3192,8 @@ static inline u64 btrfs_calc_trunc_metadata_size(struct btrfs_root *root, | |||
3143 | 3192 | ||
3144 | int btrfs_should_throttle_delayed_refs(struct btrfs_trans_handle *trans, | 3193 | int btrfs_should_throttle_delayed_refs(struct btrfs_trans_handle *trans, |
3145 | struct btrfs_root *root); | 3194 | struct btrfs_root *root); |
3195 | int btrfs_check_space_for_delayed_refs(struct btrfs_trans_handle *trans, | ||
3196 | struct btrfs_root *root); | ||
3146 | void btrfs_put_block_group(struct btrfs_block_group_cache *cache); | 3197 | void btrfs_put_block_group(struct btrfs_block_group_cache *cache); |
3147 | int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, | 3198 | int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, |
3148 | struct btrfs_root *root, unsigned long count); | 3199 | struct btrfs_root *root, unsigned long count); |
@@ -3163,6 +3214,7 @@ struct btrfs_block_group_cache *btrfs_lookup_block_group( | |||
3163 | struct btrfs_fs_info *info, | 3214 | struct btrfs_fs_info *info, |
3164 | u64 bytenr); | 3215 | u64 bytenr); |
3165 | void btrfs_put_block_group(struct btrfs_block_group_cache *cache); | 3216 | void btrfs_put_block_group(struct btrfs_block_group_cache *cache); |
3217 | int get_block_group_index(struct btrfs_block_group_cache *cache); | ||
3166 | struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, | 3218 | struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, |
3167 | struct btrfs_root *root, u32 blocksize, | 3219 | struct btrfs_root *root, u32 blocksize, |
3168 | u64 parent, u64 root_objectid, | 3220 | u64 parent, u64 root_objectid, |
@@ -3301,6 +3353,8 @@ int btrfs_comp_cpu_keys(struct btrfs_key *k1, struct btrfs_key *k2); | |||
3301 | int btrfs_previous_item(struct btrfs_root *root, | 3353 | int btrfs_previous_item(struct btrfs_root *root, |
3302 | struct btrfs_path *path, u64 min_objectid, | 3354 | struct btrfs_path *path, u64 min_objectid, |
3303 | int type); | 3355 | int type); |
3356 | int btrfs_previous_extent_item(struct btrfs_root *root, | ||
3357 | struct btrfs_path *path, u64 min_objectid); | ||
3304 | void btrfs_set_item_key_safe(struct btrfs_root *root, struct btrfs_path *path, | 3358 | void btrfs_set_item_key_safe(struct btrfs_root *root, struct btrfs_path *path, |
3305 | struct btrfs_key *new_key); | 3359 | struct btrfs_key *new_key); |
3306 | struct extent_buffer *btrfs_root_node(struct btrfs_root *root); | 3360 | struct extent_buffer *btrfs_root_node(struct btrfs_root *root); |
@@ -3350,6 +3404,8 @@ int btrfs_duplicate_item(struct btrfs_trans_handle *trans, | |||
3350 | struct btrfs_root *root, | 3404 | struct btrfs_root *root, |
3351 | struct btrfs_path *path, | 3405 | struct btrfs_path *path, |
3352 | struct btrfs_key *new_key); | 3406 | struct btrfs_key *new_key); |
3407 | int btrfs_find_item(struct btrfs_root *fs_root, struct btrfs_path *path, | ||
3408 | u64 inum, u64 ioff, u8 key_type, struct btrfs_key *found_key); | ||
3353 | int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root | 3409 | int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root |
3354 | *root, struct btrfs_key *key, struct btrfs_path *p, int | 3410 | *root, struct btrfs_key *key, struct btrfs_path *p, int |
3355 | ins_len, int cow); | 3411 | ins_len, int cow); |
@@ -3399,6 +3455,7 @@ static inline int btrfs_insert_empty_item(struct btrfs_trans_handle *trans, | |||
3399 | } | 3455 | } |
3400 | 3456 | ||
3401 | int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); | 3457 | int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path); |
3458 | int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); | ||
3402 | int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path, | 3459 | int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path, |
3403 | u64 time_seq); | 3460 | u64 time_seq); |
3404 | static inline int btrfs_next_old_item(struct btrfs_root *root, | 3461 | static inline int btrfs_next_old_item(struct btrfs_root *root, |
@@ -3563,12 +3620,6 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans, | |||
3563 | struct btrfs_root *root, | 3620 | struct btrfs_root *root, |
3564 | const char *name, int name_len, | 3621 | const char *name, int name_len, |
3565 | u64 inode_objectid, u64 ref_objectid, u64 *index); | 3622 | u64 inode_objectid, u64 ref_objectid, u64 *index); |
3566 | int btrfs_get_inode_ref_index(struct btrfs_trans_handle *trans, | ||
3567 | struct btrfs_root *root, | ||
3568 | struct btrfs_path *path, | ||
3569 | const char *name, int name_len, | ||
3570 | u64 inode_objectid, u64 ref_objectid, int mod, | ||
3571 | u64 *ret_index); | ||
3572 | int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans, | 3623 | int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans, |
3573 | struct btrfs_root *root, | 3624 | struct btrfs_root *root, |
3574 | struct btrfs_path *path, u64 objectid); | 3625 | struct btrfs_path *path, u64 objectid); |
@@ -3676,7 +3727,9 @@ int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, int delay_iput); | |||
3676 | int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end, | 3727 | int btrfs_set_extent_delalloc(struct inode *inode, u64 start, u64 end, |
3677 | struct extent_state **cached_state); | 3728 | struct extent_state **cached_state); |
3678 | int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, | 3729 | int btrfs_create_subvol_root(struct btrfs_trans_handle *trans, |
3679 | struct btrfs_root *new_root, u64 new_dirid); | 3730 | struct btrfs_root *new_root, |
3731 | struct btrfs_root *parent_root, | ||
3732 | u64 new_dirid); | ||
3680 | int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset, | 3733 | int btrfs_merge_bio_hook(int rw, struct page *page, unsigned long offset, |
3681 | size_t size, struct bio *bio, | 3734 | size_t size, struct bio *bio, |
3682 | unsigned long bio_flags); | 3735 | unsigned long bio_flags); |
@@ -3745,7 +3798,10 @@ extern const struct file_operations btrfs_file_operations; | |||
3745 | int __btrfs_drop_extents(struct btrfs_trans_handle *trans, | 3798 | int __btrfs_drop_extents(struct btrfs_trans_handle *trans, |
3746 | struct btrfs_root *root, struct inode *inode, | 3799 | struct btrfs_root *root, struct inode *inode, |
3747 | struct btrfs_path *path, u64 start, u64 end, | 3800 | struct btrfs_path *path, u64 start, u64 end, |
3748 | u64 *drop_end, int drop_cache); | 3801 | u64 *drop_end, int drop_cache, |
3802 | int replace_extent, | ||
3803 | u32 extent_item_size, | ||
3804 | int *key_inserted); | ||
3749 | int btrfs_drop_extents(struct btrfs_trans_handle *trans, | 3805 | int btrfs_drop_extents(struct btrfs_trans_handle *trans, |
3750 | struct btrfs_root *root, struct inode *inode, u64 start, | 3806 | struct btrfs_root *root, struct inode *inode, u64 start, |
3751 | u64 end, int drop_cache); | 3807 | u64 end, int drop_cache); |
@@ -3764,6 +3820,8 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans, | |||
3764 | /* sysfs.c */ | 3820 | /* sysfs.c */ |
3765 | int btrfs_init_sysfs(void); | 3821 | int btrfs_init_sysfs(void); |
3766 | void btrfs_exit_sysfs(void); | 3822 | void btrfs_exit_sysfs(void); |
3823 | int btrfs_sysfs_add_one(struct btrfs_fs_info *fs_info); | ||
3824 | void btrfs_sysfs_remove_one(struct btrfs_fs_info *fs_info); | ||
3767 | 3825 | ||
3768 | /* xattr.c */ | 3826 | /* xattr.c */ |
3769 | ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size); | 3827 | ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size); |
@@ -3796,14 +3854,20 @@ void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...) | |||
3796 | btrfs_printk(fs_info, KERN_NOTICE fmt, ##args) | 3854 | btrfs_printk(fs_info, KERN_NOTICE fmt, ##args) |
3797 | #define btrfs_info(fs_info, fmt, args...) \ | 3855 | #define btrfs_info(fs_info, fmt, args...) \ |
3798 | btrfs_printk(fs_info, KERN_INFO fmt, ##args) | 3856 | btrfs_printk(fs_info, KERN_INFO fmt, ##args) |
3857 | |||
3858 | #ifdef DEBUG | ||
3799 | #define btrfs_debug(fs_info, fmt, args...) \ | 3859 | #define btrfs_debug(fs_info, fmt, args...) \ |
3800 | btrfs_printk(fs_info, KERN_DEBUG fmt, ##args) | 3860 | btrfs_printk(fs_info, KERN_DEBUG fmt, ##args) |
3861 | #else | ||
3862 | #define btrfs_debug(fs_info, fmt, args...) \ | ||
3863 | no_printk(KERN_DEBUG fmt, ##args) | ||
3864 | #endif | ||
3801 | 3865 | ||
3802 | #ifdef CONFIG_BTRFS_ASSERT | 3866 | #ifdef CONFIG_BTRFS_ASSERT |
3803 | 3867 | ||
3804 | static inline void assfail(char *expr, char *file, int line) | 3868 | static inline void assfail(char *expr, char *file, int line) |
3805 | { | 3869 | { |
3806 | printk(KERN_ERR "BTRFS assertion failed: %s, file: %s, line: %d", | 3870 | pr_err("BTRFS: assertion failed: %s, file: %s, line: %d", |
3807 | expr, file, line); | 3871 | expr, file, line); |
3808 | BUG(); | 3872 | BUG(); |
3809 | } | 3873 | } |
@@ -3841,7 +3905,7 @@ static inline void __btrfs_set_fs_incompat(struct btrfs_fs_info *fs_info, | |||
3841 | if (!(features & flag)) { | 3905 | if (!(features & flag)) { |
3842 | features |= flag; | 3906 | features |= flag; |
3843 | btrfs_set_super_incompat_flags(disk_super, features); | 3907 | btrfs_set_super_incompat_flags(disk_super, features); |
3844 | printk(KERN_INFO "btrfs: setting %llu feature flag\n", | 3908 | btrfs_info(fs_info, "setting %llu feature flag", |
3845 | flag); | 3909 | flag); |
3846 | } | 3910 | } |
3847 | spin_unlock(&fs_info->super_lock); | 3911 | spin_unlock(&fs_info->super_lock); |