/linux/fs/btrfs/ |
H A D | messages.h | 18 void btrfs_no_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...) in btrfs_no_printk() argument 26 #define btrfs_printk(fs_info, fmt, args...) \ argument 27 _btrfs_printk(fs_info, fmt, ##args) 31 void _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...); 35 #define btrfs_printk(fs_info, fmt, args...) \ argument 36 btrfs_no_printk(fs_info, fmt, ##args) 39 #define btrfs_emerg(fs_info, fmt, args...) \ argument 40 btrfs_printk(fs_info, KERN_EMERG fmt, ##args) 41 #define btrfs_alert(fs_info, fmt, args...) \ argument 42 btrfs_printk(fs_info, KERN_ALERT fmt, ##args) [all …]
|
H A D | disk-io.c | 61 static int btrfs_cleanup_transaction(struct btrfs_fs_info *fs_info); 62 static void btrfs_error_commit_super(struct btrfs_fs_info *fs_info); 64 static void btrfs_free_csum_hash(struct btrfs_fs_info *fs_info) in btrfs_free_csum_hash() argument 66 if (fs_info->csum_shash) in btrfs_free_csum_hash() 67 crypto_free_shash(fs_info->csum_shash); in btrfs_free_csum_hash() 75 struct btrfs_fs_info *fs_info = buf->fs_info; in csum_tree_block() local 78 SHASH_DESC_ON_STACK(shash, fs_info->csum_shash); in csum_tree_block() 82 shash->tfm = fs_info->csum_shash; in csum_tree_block() 88 first_page_part = fs_info->nodesize; in csum_tree_block() 92 first_page_part = min_t(u32, PAGE_SIZE, fs_info->nodesize); in csum_tree_block() [all …]
|
H A D | transaction.c | 147 btrfs_err(transaction->fs_info, in btrfs_put_transaction() 175 struct btrfs_fs_info *fs_info = trans->fs_info; in switch_commit_roots() local 184 down_write(&fs_info->commit_root_sem); in switch_commit_roots() 186 if (test_bit(BTRFS_FS_RELOC_RUNNING, &fs_info->flags)) in switch_commit_roots() 187 fs_info->last_reloc_trans = trans->transid; in switch_commit_roots() 206 btrfs_drop_and_free_fs_root(fs_info, root); in switch_commit_roots() 211 up_write(&fs_info->commit_root_sem); in switch_commit_roots() 248 struct btrfs_fs_info *fs_info = trans->fs_info; in btrfs_trans_release_chunk_metadata() local 253 btrfs_block_rsv_release(fs_info, &fs_info->chunk_block_rsv, in btrfs_trans_release_chunk_metadata() 261 static noinline int join_transaction(struct btrfs_fs_info *fs_info, in join_transaction() argument [all …]
|
H A D | subpage.c | 68 bool btrfs_is_subpage(const struct btrfs_fs_info *fs_info, struct address_space *mapping) in btrfs_is_subpage() argument 70 if (fs_info->sectorsize >= PAGE_SIZE) in btrfs_is_subpage() 85 if (fs_info->nodesize < PAGE_SIZE) in btrfs_is_subpage() 91 int btrfs_attach_subpage(const struct btrfs_fs_info *fs_info, in btrfs_attach_subpage() argument 104 if (!btrfs_is_subpage(fs_info, folio->mapping) || folio_test_private(folio)) in btrfs_attach_subpage() 107 subpage = btrfs_alloc_subpage(fs_info, type); in btrfs_attach_subpage() 115 void btrfs_detach_subpage(const struct btrfs_fs_info *fs_info, struct folio *folio) in btrfs_detach_subpage() argument 120 if (!btrfs_is_subpage(fs_info, folio->mapping) || !folio_test_private(folio)) in btrfs_detach_subpage() 128 struct btrfs_subpage *btrfs_alloc_subpage(const struct btrfs_fs_info *fs_info, in btrfs_alloc_subpage() argument 134 ASSERT(fs_info->sectorsize < PAGE_SIZE); in btrfs_alloc_subpage() [all …]
|
H A D | qgroup.c | 33 enum btrfs_qgroup_mode btrfs_qgroup_mode(const struct btrfs_fs_info *fs_info) in btrfs_qgroup_mode() argument 35 if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) in btrfs_qgroup_mode() 37 if (fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_SIMPLE_MODE) in btrfs_qgroup_mode() 42 bool btrfs_qgroup_enabled(const struct btrfs_fs_info *fs_info) in btrfs_qgroup_enabled() argument 44 return btrfs_qgroup_mode(fs_info) != BTRFS_QGROUP_MODE_DISABLED; in btrfs_qgroup_enabled() 47 bool btrfs_qgroup_full_accounting(const struct btrfs_fs_info *fs_info) in btrfs_qgroup_full_accounting() argument 49 return btrfs_qgroup_mode(fs_info) == BTRFS_QGROUP_MODE_FULL; in btrfs_qgroup_full_accounting() 82 static void qgroup_rsv_add(struct btrfs_fs_info *fs_info, in qgroup_rsv_add() argument 86 trace_qgroup_update_reserve(fs_info, qgroup, num_bytes, type); in qgroup_rsv_add() 90 static void qgroup_rsv_release(struct btrfs_fs_info *fs_info, in qgroup_rsv_release() argument [all …]
|
H A D | delalloc-space.c | 117 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_alloc_data_chunk_ondemand() local 121 bytes = ALIGN(bytes, fs_info->sectorsize); in btrfs_alloc_data_chunk_ondemand() 126 return btrfs_reserve_data_bytes(fs_info, bytes, flush); in btrfs_alloc_data_chunk_ondemand() 133 struct btrfs_fs_info *fs_info = inode->root->fs_info; in btrfs_check_data_free_space() local 138 len = round_up(start + len, fs_info->sectorsize) - in btrfs_check_data_free_space() 139 round_down(start, fs_info->sectorsize); in btrfs_check_data_free_space() 140 start = round_down(start, fs_info->sectorsize); in btrfs_check_data_free_space() 147 ret = btrfs_reserve_data_bytes(fs_info, len, flush); in btrfs_check_data_free_space() 154 btrfs_free_reserved_data_space_noquota(fs_info, len); in btrfs_check_data_free_space() 171 void btrfs_free_reserved_data_space_noquota(struct btrfs_fs_info *fs_info, in btrfs_free_reserved_data_space_noquota() argument [all …]
|
H A D | block-rsv.c | 104 static u64 block_rsv_release_bytes(struct btrfs_fs_info *fs_info, in block_rsv_release_bytes() argument 153 btrfs_space_info_free_bytes_may_use(fs_info, in block_rsv_release_bytes() 183 void btrfs_init_metadata_block_rsv(struct btrfs_fs_info *fs_info, in btrfs_init_metadata_block_rsv() argument 188 rsv->space_info = btrfs_find_space_info(fs_info, in btrfs_init_metadata_block_rsv() 192 struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_fs_info *fs_info, in btrfs_alloc_block_rsv() argument 201 btrfs_init_metadata_block_rsv(fs_info, block_rsv, type); in btrfs_alloc_block_rsv() 205 void btrfs_free_block_rsv(struct btrfs_fs_info *fs_info, in btrfs_free_block_rsv() argument 210 btrfs_block_rsv_release(fs_info, rsv, (u64)-1, NULL); in btrfs_free_block_rsv() 214 int btrfs_block_rsv_add(struct btrfs_fs_info *fs_info, in btrfs_block_rsv_add() argument 223 ret = btrfs_reserve_metadata_bytes(fs_info, block_rsv->space_info, in btrfs_block_rsv_add() [all …]
|
H A D | space-info.c | 200 static u64 calc_chunk_size(const struct btrfs_fs_info *fs_info, u64 flags) in calc_chunk_size() argument 202 if (btrfs_is_zoned(fs_info)) in calc_chunk_size() 203 return fs_info->zone_size; in calc_chunk_size() 213 if (fs_info->fs_devices->total_rw_bytes > 50ULL * SZ_1G) in calc_chunk_size() 239 space_info->fs_info = info; in create_space_info() 266 int btrfs_init_space_info(struct btrfs_fs_info *fs_info) in btrfs_init_space_info() argument 274 disk_super = fs_info->super_copy; in btrfs_init_space_info() 283 ret = create_space_info(fs_info, flags); in btrfs_init_space_info() 289 ret = create_space_info(fs_info, flags); in btrfs_init_space_info() 292 ret = create_space_info(fs_info, flags); in btrfs_init_space_info() [all …]
|
H A D | dev-replace.c | 66 static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, 70 int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info) in btrfs_init_dev_replace() argument 74 struct btrfs_root *dev_root = fs_info->dev_root; in btrfs_init_dev_replace() 75 struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace; in btrfs_init_dev_replace() 103 if (btrfs_find_device(fs_info->fs_devices, &args)) { in btrfs_init_dev_replace() 104 btrfs_err(fs_info, in btrfs_init_dev_replace() 134 btrfs_warn(fs_info, in btrfs_init_dev_replace() 165 if (btrfs_find_device(fs_info->fs_devices, &args)) { in btrfs_init_dev_replace() 166 btrfs_err(fs_info, in btrfs_init_dev_replace() 176 dev_replace->tgtdev = btrfs_find_device(fs_info->fs_devices, &args); in btrfs_init_dev_replace() [all …]
|
H A D | scrub.c | 188 struct btrfs_fs_info *fs_info; member 249 static int init_scrub_stripe(struct btrfs_fs_info *fs_info, in init_scrub_stripe() argument 256 stripe->nr_sectors = BTRFS_STRIPE_LEN >> fs_info->sectorsize_bits; in init_scrub_stripe() 274 stripe->csums = kcalloc(BTRFS_STRIPE_LEN >> fs_info->sectorsize_bits, in init_scrub_stripe() 275 fs_info->csum_size, GFP_KERNEL); in init_scrub_stripe() 291 static void __scrub_blocked_if_needed(struct btrfs_fs_info *fs_info) in __scrub_blocked_if_needed() argument 293 while (atomic_read(&fs_info->scrub_pause_req)) { in __scrub_blocked_if_needed() 294 mutex_unlock(&fs_info->scrub_lock); in __scrub_blocked_if_needed() 295 wait_event(fs_info->scrub_pause_wait, in __scrub_blocked_if_needed() 296 atomic_read(&fs_info->scrub_pause_req) == 0); in __scrub_blocked_if_needed() [all …]
|
H A D | super.c | 71 struct btrfs_fs_info *fs_info = btrfs_sb(sb); in btrfs_put_super() local 73 btrfs_info(fs_info, "last unmount of filesystem %pU", fs_info->fs_devices->fsid); in btrfs_put_super() 74 close_ctree(fs_info); in btrfs_put_super() 646 static void btrfs_clear_oneshot_options(struct btrfs_fs_info *fs_info) in btrfs_clear_oneshot_options() argument 648 btrfs_clear_opt(fs_info->mount_opt, USEBACKUPROOT); in btrfs_clear_oneshot_options() 649 btrfs_clear_opt(fs_info->mount_opt, CLEAR_CACHE); in btrfs_clear_oneshot_options() 650 btrfs_clear_opt(fs_info->mount_opt, NOSPACECACHE); in btrfs_clear_oneshot_options() 653 static bool check_ro_option(const struct btrfs_fs_info *fs_info, in check_ro_option() argument 658 btrfs_err(fs_info, "%s must be used with ro mount option", in check_ro_option() 719 void btrfs_set_free_space_cache_settings(struct btrfs_fs_info *fs_info) in btrfs_set_free_space_cache_settings() argument [all …]
|
H A D | block-group.c | 28 struct btrfs_fs_info *fs_info = block_group->fs_info; in btrfs_should_fragment_free_space() local 30 return (btrfs_test_opt(fs_info, FRAGMENT_METADATA) && in btrfs_should_fragment_free_space() 32 (btrfs_test_opt(fs_info, FRAGMENT_DATA) && in btrfs_should_fragment_free_space() 43 static u64 get_restripe_target(const struct btrfs_fs_info *fs_info, u64 flags) in get_restripe_target() argument 45 const struct btrfs_balance_control *bctl = fs_info->balance_ctl; in get_restripe_target() 72 static u64 btrfs_reduce_alloc_profile(struct btrfs_fs_info *fs_info, u64 flags) in btrfs_reduce_alloc_profile() argument 74 u64 num_devices = fs_info->fs_devices->rw_devices; in btrfs_reduce_alloc_profile() 83 spin_lock(&fs_info->balance_lock); in btrfs_reduce_alloc_profile() 84 target = get_restripe_target(fs_info, flags); in btrfs_reduce_alloc_profile() 86 spin_unlock(&fs_info->balance_lock); in btrfs_reduce_alloc_profile() [all …]
|
H A D | fs.c | 8 void __btrfs_set_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag, in __btrfs_set_fs_incompat() argument 14 disk_super = fs_info->super_copy; in __btrfs_set_fs_incompat() 17 spin_lock(&fs_info->super_lock); in __btrfs_set_fs_incompat() 22 btrfs_info(fs_info, in __btrfs_set_fs_incompat() 26 spin_unlock(&fs_info->super_lock); in __btrfs_set_fs_incompat() 27 set_bit(BTRFS_FS_FEATURE_CHANGED, &fs_info->flags); in __btrfs_set_fs_incompat() 31 void __btrfs_clear_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag, in __btrfs_clear_fs_incompat() argument 37 disk_super = fs_info->super_copy; in __btrfs_clear_fs_incompat() 40 spin_lock(&fs_info->super_lock); in __btrfs_clear_fs_incompat() 45 btrfs_info(fs_info, in __btrfs_clear_fs_incompat() [all …]
|
H A D | zoned.h | 56 int btrfs_get_dev_zone_info_all_devices(struct btrfs_fs_info *fs_info); 60 int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info); 78 int btrfs_check_meta_write_pointer(struct btrfs_fs_info *fs_info, 86 void btrfs_zone_finish_endio(struct btrfs_fs_info *fs_info, u64 logical, 91 void btrfs_free_zone_cache(struct btrfs_fs_info *fs_info); 92 bool btrfs_zoned_should_reclaim(const struct btrfs_fs_info *fs_info); 93 void btrfs_zoned_release_data_reloc_bg(struct btrfs_fs_info *fs_info, u64 logical, 95 int btrfs_zone_finish_one_bg(struct btrfs_fs_info *fs_info); 96 int btrfs_zoned_activate_one_bg(struct btrfs_fs_info *fs_info, 98 void btrfs_check_active_zone_reservation(struct btrfs_fs_info *fs_info); [all …]
|
H A D | tree-mod-log.c | 47 static u64 btrfs_inc_tree_mod_seq(struct btrfs_fs_info *fs_info) in btrfs_inc_tree_mod_seq() argument 49 return atomic64_inc_return(&fs_info->tree_mod_seq); in btrfs_inc_tree_mod_seq() 60 u64 btrfs_get_tree_mod_seq(struct btrfs_fs_info *fs_info, in btrfs_get_tree_mod_seq() argument 63 write_lock(&fs_info->tree_mod_log_lock); in btrfs_get_tree_mod_seq() 65 elem->seq = btrfs_inc_tree_mod_seq(fs_info); in btrfs_get_tree_mod_seq() 66 list_add_tail(&elem->list, &fs_info->tree_mod_seq_list); in btrfs_get_tree_mod_seq() 67 set_bit(BTRFS_FS_TREE_MOD_LOG_USERS, &fs_info->flags); in btrfs_get_tree_mod_seq() 69 write_unlock(&fs_info->tree_mod_log_lock); in btrfs_get_tree_mod_seq() 74 void btrfs_put_tree_mod_seq(struct btrfs_fs_info *fs_info, in btrfs_put_tree_mod_seq() argument 87 write_lock(&fs_info->tree_mod_log_lock); in btrfs_put_tree_mod_seq() [all …]
|
H A D | sysfs.c | 121 static u64 get_features(struct btrfs_fs_info *fs_info, in get_features() argument 124 struct btrfs_super_block *disk_super = fs_info->super_copy; in get_features() 133 static void set_features(struct btrfs_fs_info *fs_info, in set_features() argument 136 struct btrfs_super_block *disk_super = fs_info->super_copy; in set_features() 180 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_attr_show() local 182 if (fs_info) { in btrfs_feature_attr_show() 183 u64 features = get_features(fs_info, fa->feature_set); in btrfs_feature_attr_show() 196 struct btrfs_fs_info *fs_info; in btrfs_feature_attr_store() local 202 fs_info = to_fs_info(kobj); in btrfs_feature_attr_store() 203 if (!fs_info) in btrfs_feature_attr_store() [all …]
|
H A D | ref-verify.c | 214 static void __print_stack_trace(struct btrfs_fs_info *fs_info, in __print_stack_trace() argument 218 btrfs_err(fs_info, " ref-verify: no stacktrace"); in __print_stack_trace() 228 static inline void __print_stack_trace(struct btrfs_fs_info *fs_info, in __print_stack_trace() argument 231 btrfs_err(fs_info, " ref-verify: no stacktrace support"); in __print_stack_trace() 263 static struct block_entry *add_block_entry(struct btrfs_fs_info *fs_info, in add_block_entry() argument 283 spin_lock(&fs_info->ref_verify_lock); in add_block_entry() 284 exist = insert_block_entry(&fs_info->block_tree, be); in add_block_entry() 312 static int add_tree_block(struct btrfs_fs_info *fs_info, u64 ref_root, in add_tree_block() argument 332 be = add_block_entry(fs_info, bytenr, fs_info->nodesize, ref_root); in add_tree_block() 352 spin_unlock(&fs_info->ref_verify_lock); in add_tree_block() [all …]
|
H A D | fs.h | 885 #define folio_to_fs_info(_folio) (folio_to_inode(_folio)->root->fs_info) 888 struct inode *: (_inode)))->root->fs_info) 890 static inline u64 btrfs_get_fs_generation(const struct btrfs_fs_info *fs_info) in btrfs_get_fs_generation() argument 892 return READ_ONCE(fs_info->generation); in btrfs_get_fs_generation() 895 static inline void btrfs_set_fs_generation(struct btrfs_fs_info *fs_info, u64 gen) in btrfs_set_fs_generation() argument 897 WRITE_ONCE(fs_info->generation, gen); in btrfs_set_fs_generation() 900 static inline u64 btrfs_get_last_trans_committed(const struct btrfs_fs_info *fs_info) in btrfs_get_last_trans_committed() argument 902 return READ_ONCE(fs_info->last_trans_committed); in btrfs_get_last_trans_committed() 905 static inline void btrfs_set_last_trans_committed(struct btrfs_fs_info *fs_info, u64 gen) in btrfs_set_last_trans_committed() argument 907 WRITE_ONCE(fs_info->last_trans_committed, gen); in btrfs_set_last_trans_committed() [all …]
|
H A D | volumes.c | 259 static int btrfs_relocate_sys_chunks(struct btrfs_fs_info *fs_info); 1221 device->fs_info = NULL; in btrfs_close_one_device() 1261 fs_devices->fs_info = NULL; in close_fs_devices() 1579 lockdep_assert_held(&device->fs_info->chunk_mutex); in contains_pending_extent() 1741 struct btrfs_fs_info *fs_info = device->fs_info; in find_free_dev_extent() local 1742 struct btrfs_root *root = fs_info->dev_root; in find_free_dev_extent() 1885 struct btrfs_fs_info *fs_info = device->fs_info; in btrfs_free_dev_extent() local 1886 struct btrfs_root *root = fs_info->dev_root; in btrfs_free_dev_extent() 1935 static u64 find_next_chunk(struct btrfs_fs_info *fs_info) in find_next_chunk() argument 1940 read_lock(&fs_info->mapping_tree_lock); in find_next_chunk() [all …]
|
H A D | subpage.h | 73 bool btrfs_is_subpage(const struct btrfs_fs_info *fs_info, struct address_space *mapping); 75 static inline bool btrfs_is_subpage(const struct btrfs_fs_info *fs_info, in btrfs_is_subpage() argument 82 int btrfs_attach_subpage(const struct btrfs_fs_info *fs_info, 84 void btrfs_detach_subpage(const struct btrfs_fs_info *fs_info, struct folio *folio); 87 struct btrfs_subpage *btrfs_alloc_subpage(const struct btrfs_fs_info *fs_info, 91 void btrfs_folio_inc_eb_refs(const struct btrfs_fs_info *fs_info, struct folio *folio); 92 void btrfs_folio_dec_eb_refs(const struct btrfs_fs_info *fs_info, struct folio *folio); 94 void btrfs_folio_end_lock(const struct btrfs_fs_info *fs_info, 96 void btrfs_folio_set_lock(const struct btrfs_fs_info *fs_info, 98 void btrfs_folio_end_lock_bitmap(const struct btrfs_fs_info *fs_info, [all …]
|
H A D | zoned.c | 197 const sector_t zone_sectors = device->fs_info->zone_size >> SECTOR_SHIFT; in emulate_report_zones() 266 btrfs_err_in_rcu(device->fs_info, in btrfs_get_dev_zones() 288 static int calculate_emulated_zone_size(struct btrfs_fs_info *fs_info) in calculate_emulated_zone_size() argument 291 struct btrfs_root *root = fs_info->dev_root; in calculate_emulated_zone_size() 320 fs_info->zone_size = btrfs_dev_extent_length(leaf, dext); in calculate_emulated_zone_size() 324 int btrfs_get_dev_zone_info_all_devices(struct btrfs_fs_info *fs_info) in btrfs_get_dev_zone_info_all_devices() argument 326 struct btrfs_fs_devices *fs_devices = fs_info->fs_devices; in btrfs_get_dev_zone_info_all_devices() 331 if (!btrfs_fs_incompat(fs_info, ZONED)) in btrfs_get_dev_zone_info_all_devices() 351 struct btrfs_fs_info *fs_info = device->fs_info; in btrfs_get_dev_zone_info() local 368 if (!btrfs_fs_incompat(fs_info, ZONED)) in btrfs_get_dev_zone_info() [all …]
|
H A D | extent_io.c | 43 struct btrfs_fs_info *fs_info = eb->fs_info; in btrfs_leak_debug_add_eb() local 46 spin_lock_irqsave(&fs_info->eb_leak_lock, flags); in btrfs_leak_debug_add_eb() 47 list_add(&eb->leak_list, &fs_info->allocated_ebs); in btrfs_leak_debug_add_eb() 48 spin_unlock_irqrestore(&fs_info->eb_leak_lock, flags); in btrfs_leak_debug_add_eb() 53 struct btrfs_fs_info *fs_info = eb->fs_info; in btrfs_leak_debug_del_eb() local 56 spin_lock_irqsave(&fs_info->eb_leak_lock, flags); in btrfs_leak_debug_del_eb() 58 spin_unlock_irqrestore(&fs_info->eb_leak_lock, flags); in btrfs_leak_debug_del_eb() 61 void btrfs_extent_buffer_leak_debug_check(struct btrfs_fs_info *fs_info) in btrfs_extent_buffer_leak_debug_check() argument 70 if (!fs_info->allocated_ebs.next) in btrfs_extent_buffer_leak_debug_check() 73 WARN_ON(!list_empty(&fs_info->allocated_ebs)); in btrfs_extent_buffer_leak_debug_check() [all …]
|
H A D | file-item.c | 92 ASSERT(IS_ALIGNED(start + len, inode->root->fs_info->sectorsize)); in btrfs_inode_set_file_extent_range() 121 ASSERT(IS_ALIGNED(start + len, inode->root->fs_info->sectorsize) || in btrfs_inode_clear_file_extent_range() 128 static size_t bytes_to_csum_size(const struct btrfs_fs_info *fs_info, u32 bytes) in bytes_to_csum_size() argument 130 ASSERT(IS_ALIGNED(bytes, fs_info->sectorsize)); in bytes_to_csum_size() 132 return (bytes >> fs_info->sectorsize_bits) * fs_info->csum_size; in bytes_to_csum_size() 135 static size_t csum_size_to_bytes(const struct btrfs_fs_info *fs_info, u32 csum_size) in csum_size_to_bytes() argument 137 ASSERT(IS_ALIGNED(csum_size, fs_info->csum_size)); in csum_size_to_bytes() 139 return (csum_size / fs_info->csum_size) << fs_info->sectorsize_bits; in csum_size_to_bytes() 142 static inline u32 max_ordered_sum_bytes(const struct btrfs_fs_info *fs_info) in max_ordered_sum_bytes() argument 145 fs_info->csum_size); in max_ordered_sum_bytes() [all …]
|
H A D | delayed-ref.c | 31 bool btrfs_check_space_for_delayed_refs(struct btrfs_fs_info *fs_info) in btrfs_check_space_for_delayed_refs() argument 33 struct btrfs_block_rsv *delayed_refs_rsv = &fs_info->delayed_refs_rsv; in btrfs_check_space_for_delayed_refs() 34 struct btrfs_block_rsv *global_rsv = &fs_info->global_block_rsv; in btrfs_check_space_for_delayed_refs() 66 void btrfs_delayed_refs_rsv_release(struct btrfs_fs_info *fs_info, int nr_refs, int nr_csums) in btrfs_delayed_refs_rsv_release() argument 68 struct btrfs_block_rsv *block_rsv = &fs_info->delayed_refs_rsv; in btrfs_delayed_refs_rsv_release() 72 num_bytes = btrfs_calc_delayed_ref_bytes(fs_info, nr_refs); in btrfs_delayed_refs_rsv_release() 73 num_bytes += btrfs_calc_delayed_ref_csum_bytes(fs_info, nr_csums); in btrfs_delayed_refs_rsv_release() 75 released = btrfs_block_rsv_release(fs_info, block_rsv, num_bytes, NULL); in btrfs_delayed_refs_rsv_release() 77 trace_btrfs_space_reservation(fs_info, "delayed_refs_rsv", in btrfs_delayed_refs_rsv_release() 90 struct btrfs_fs_info *fs_info = trans->fs_info; in btrfs_update_delayed_refs_rsv() local [all …]
|
H A D | bio.c | 44 void btrfs_bio_init(struct btrfs_bio *bbio, struct btrfs_fs_info *fs_info, in btrfs_bio_init() argument 48 bbio->fs_info = fs_info; in btrfs_bio_init() 63 struct btrfs_fs_info *fs_info, in btrfs_bio_alloc() argument 71 btrfs_bio_init(bbio, fs_info, end_io, private); in btrfs_bio_alloc() 75 static struct btrfs_bio *btrfs_split_bio(struct btrfs_fs_info *fs_info, in btrfs_split_bio() argument 88 btrfs_bio_init(bbio, fs_info, NULL, orig_bbio); in btrfs_split_bio() 172 struct btrfs_fs_info *fs_info = inode->root->fs_info; in btrfs_end_repair_bio() local 189 btrfs_debug(fs_info, "no mirror left"); in btrfs_end_repair_bio() 200 btrfs_repair_io_failure(fs_info, btrfs_ino(inode), in btrfs_end_repair_bio() 201 repair_bbio->file_offset, fs_info->sectorsize, in btrfs_end_repair_bio() [all …]
|