/Linux-v6.6/fs/btrfs/ |
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 …]
|
D | disk-io.c | 63 static int btrfs_cleanup_transaction(struct btrfs_fs_info *fs_info); 64 static void btrfs_error_commit_super(struct btrfs_fs_info *fs_info); 66 static void btrfs_free_csum_hash(struct btrfs_fs_info *fs_info) in btrfs_free_csum_hash() argument 68 if (fs_info->csum_shash) in btrfs_free_csum_hash() 69 crypto_free_shash(fs_info->csum_shash); in btrfs_free_csum_hash() 77 struct btrfs_fs_info *fs_info = buf->fs_info; in csum_tree_block() local 79 const int first_page_part = min_t(u32, PAGE_SIZE, fs_info->nodesize); in csum_tree_block() 80 SHASH_DESC_ON_STACK(shash, fs_info->csum_shash); in csum_tree_block() 84 shash->tfm = fs_info->csum_shash; in csum_tree_block() 117 btrfs_err_rl(eb->fs_info, in btrfs_buffer_uptodate() [all …]
|
D | transaction.c | 153 btrfs_err(transaction->fs_info, in btrfs_put_transaction() 181 struct btrfs_fs_info *fs_info = trans->fs_info; in switch_commit_roots() local 190 down_write(&fs_info->commit_root_sem); in switch_commit_roots() 192 if (test_bit(BTRFS_FS_RELOC_RUNNING, &fs_info->flags)) in switch_commit_roots() 193 fs_info->last_reloc_trans = trans->transid; in switch_commit_roots() 212 btrfs_drop_and_free_fs_root(fs_info, root); in switch_commit_roots() 217 up_write(&fs_info->commit_root_sem); in switch_commit_roots() 254 struct btrfs_fs_info *fs_info = trans->fs_info; in btrfs_trans_release_chunk_metadata() local 259 btrfs_block_rsv_release(fs_info, &fs_info->chunk_block_rsv, in btrfs_trans_release_chunk_metadata() 267 static noinline int join_transaction(struct btrfs_fs_info *fs_info, in join_transaction() argument [all …]
|
D | subpage.c | 67 bool btrfs_is_subpage(const struct btrfs_fs_info *fs_info, struct page *page) in btrfs_is_subpage() argument 69 if (fs_info->sectorsize >= PAGE_SIZE) in btrfs_is_subpage() 85 if (fs_info->nodesize < PAGE_SIZE) in btrfs_is_subpage() 118 int btrfs_attach_subpage(const struct btrfs_fs_info *fs_info, in btrfs_attach_subpage() argument 131 if (!btrfs_is_subpage(fs_info, page) || PagePrivate(page)) in btrfs_attach_subpage() 134 subpage = btrfs_alloc_subpage(fs_info, type); in btrfs_attach_subpage() 142 void btrfs_detach_subpage(const struct btrfs_fs_info *fs_info, in btrfs_detach_subpage() argument 148 if (!btrfs_is_subpage(fs_info, page) || !PagePrivate(page)) in btrfs_detach_subpage() 156 struct btrfs_subpage *btrfs_alloc_subpage(const struct btrfs_fs_info *fs_info, in btrfs_alloc_subpage() argument 162 ASSERT(fs_info->sectorsize < PAGE_SIZE); in btrfs_alloc_subpage() [all …]
|
D | delalloc-space.c | 119 struct btrfs_fs_info *fs_info = root->fs_info; in btrfs_alloc_data_chunk_ondemand() local 123 bytes = ALIGN(bytes, fs_info->sectorsize); in btrfs_alloc_data_chunk_ondemand() 128 return btrfs_reserve_data_bytes(fs_info, bytes, flush); in btrfs_alloc_data_chunk_ondemand() 135 struct btrfs_fs_info *fs_info = inode->root->fs_info; in btrfs_check_data_free_space() local 140 len = round_up(start + len, fs_info->sectorsize) - in btrfs_check_data_free_space() 141 round_down(start, fs_info->sectorsize); in btrfs_check_data_free_space() 142 start = round_down(start, fs_info->sectorsize); in btrfs_check_data_free_space() 149 ret = btrfs_reserve_data_bytes(fs_info, len, flush); in btrfs_check_data_free_space() 156 btrfs_free_reserved_data_space_noquota(fs_info, len); in btrfs_check_data_free_space() 173 void btrfs_free_reserved_data_space_noquota(struct btrfs_fs_info *fs_info, in btrfs_free_reserved_data_space_noquota() argument [all …]
|
D | qgroup.c | 63 static void qgroup_rsv_add(struct btrfs_fs_info *fs_info, in qgroup_rsv_add() argument 67 trace_qgroup_update_reserve(fs_info, qgroup, num_bytes, type); in qgroup_rsv_add() 71 static void qgroup_rsv_release(struct btrfs_fs_info *fs_info, in qgroup_rsv_release() argument 75 trace_qgroup_update_reserve(fs_info, qgroup, -(s64)num_bytes, type); in qgroup_rsv_release() 89 static void qgroup_rsv_add_by_qgroup(struct btrfs_fs_info *fs_info, in qgroup_rsv_add_by_qgroup() argument 96 qgroup_rsv_add(fs_info, dest, src->rsv.values[i], i); in qgroup_rsv_add_by_qgroup() 99 static void qgroup_rsv_release_by_qgroup(struct btrfs_fs_info *fs_info, in qgroup_rsv_release_by_qgroup() argument 106 qgroup_rsv_release(fs_info, dest, src->rsv.values[i], i); in qgroup_rsv_release_by_qgroup() 160 qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid, 162 static void qgroup_rescan_zero_tracking(struct btrfs_fs_info *fs_info); [all …]
|
D | dev-replace.c | 69 static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info, 73 int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info) in btrfs_init_dev_replace() argument 77 struct btrfs_root *dev_root = fs_info->dev_root; in btrfs_init_dev_replace() 78 struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace; in btrfs_init_dev_replace() 106 if (btrfs_find_device(fs_info->fs_devices, &args)) { in btrfs_init_dev_replace() 107 btrfs_err(fs_info, in btrfs_init_dev_replace() 137 btrfs_warn(fs_info, in btrfs_init_dev_replace() 168 if (btrfs_find_device(fs_info->fs_devices, &args)) { in btrfs_init_dev_replace() 169 btrfs_err(fs_info, in btrfs_init_dev_replace() 179 dev_replace->tgtdev = btrfs_find_device(fs_info->fs_devices, &args); in btrfs_init_dev_replace() [all …]
|
D | block-rsv.c | 105 static u64 block_rsv_release_bytes(struct btrfs_fs_info *fs_info, in block_rsv_release_bytes() argument 154 btrfs_space_info_free_bytes_may_use(fs_info, in block_rsv_release_bytes() 184 void btrfs_init_metadata_block_rsv(struct btrfs_fs_info *fs_info, in btrfs_init_metadata_block_rsv() argument 189 rsv->space_info = btrfs_find_space_info(fs_info, in btrfs_init_metadata_block_rsv() 193 struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_fs_info *fs_info, in btrfs_alloc_block_rsv() argument 202 btrfs_init_metadata_block_rsv(fs_info, block_rsv, type); in btrfs_alloc_block_rsv() 206 void btrfs_free_block_rsv(struct btrfs_fs_info *fs_info, in btrfs_free_block_rsv() argument 211 btrfs_block_rsv_release(fs_info, rsv, (u64)-1, NULL); in btrfs_free_block_rsv() 215 int btrfs_block_rsv_add(struct btrfs_fs_info *fs_info, in btrfs_block_rsv_add() argument 224 ret = btrfs_reserve_metadata_bytes(fs_info, block_rsv, num_bytes, flush); in btrfs_block_rsv_add() [all …]
|
D | space-info.c | 197 static u64 calc_chunk_size(const struct btrfs_fs_info *fs_info, u64 flags) in calc_chunk_size() argument 199 if (btrfs_is_zoned(fs_info)) in calc_chunk_size() 200 return fs_info->zone_size; in calc_chunk_size() 210 if (fs_info->fs_devices->total_rw_bytes > 50ULL * SZ_1G) in calc_chunk_size() 262 int btrfs_init_space_info(struct btrfs_fs_info *fs_info) in btrfs_init_space_info() argument 270 disk_super = fs_info->super_copy; in btrfs_init_space_info() 279 ret = create_space_info(fs_info, flags); in btrfs_init_space_info() 285 ret = create_space_info(fs_info, flags); in btrfs_init_space_info() 288 ret = create_space_info(fs_info, flags); in btrfs_init_space_info() 293 ret = create_space_info(fs_info, flags); in btrfs_init_space_info() [all …]
|
D | scrub.c | 188 struct btrfs_fs_info *fs_info; member 250 static int init_scrub_stripe(struct btrfs_fs_info *fs_info, in init_scrub_stripe() argument 257 stripe->nr_sectors = BTRFS_STRIPE_LEN >> fs_info->sectorsize_bits; in init_scrub_stripe() 275 stripe->csums = kcalloc(BTRFS_STRIPE_LEN >> fs_info->sectorsize_bits, in init_scrub_stripe() 276 fs_info->csum_size, GFP_KERNEL); in init_scrub_stripe() 292 static void __scrub_blocked_if_needed(struct btrfs_fs_info *fs_info) in __scrub_blocked_if_needed() argument 294 while (atomic_read(&fs_info->scrub_pause_req)) { in __scrub_blocked_if_needed() 295 mutex_unlock(&fs_info->scrub_lock); in __scrub_blocked_if_needed() 296 wait_event(fs_info->scrub_pause_wait, in __scrub_blocked_if_needed() 297 atomic_read(&fs_info->scrub_pause_req) == 0); in __scrub_blocked_if_needed() [all …]
|
D | disk-io.h | 32 void btrfs_check_leaked_roots(struct btrfs_fs_info *fs_info); 33 void btrfs_init_fs_info(struct btrfs_fs_info *fs_info); 34 struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr, 37 struct btrfs_fs_info *fs_info, 42 void btrfs_clear_oneshot_options(struct btrfs_fs_info *fs_info); 43 int btrfs_start_pre_rw_mount(struct btrfs_fs_info *fs_info); 44 int btrfs_check_super_csum(struct btrfs_fs_info *fs_info, 49 void __cold close_ctree(struct btrfs_fs_info *fs_info); 50 int btrfs_validate_super(struct btrfs_fs_info *fs_info, 52 int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount); [all …]
|
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 …]
|
D | zoned.h | 43 int btrfs_get_dev_zone_info_all_devices(struct btrfs_fs_info *fs_info); 47 int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info); 66 int btrfs_check_meta_write_pointer(struct btrfs_fs_info *fs_info, 74 void btrfs_zone_finish_endio(struct btrfs_fs_info *fs_info, u64 logical, 79 void btrfs_free_zone_cache(struct btrfs_fs_info *fs_info); 80 bool btrfs_zoned_should_reclaim(struct btrfs_fs_info *fs_info); 81 void btrfs_zoned_release_data_reloc_bg(struct btrfs_fs_info *fs_info, u64 logical, 83 int btrfs_zone_finish_one_bg(struct btrfs_fs_info *fs_info); 84 int btrfs_zoned_activate_one_bg(struct btrfs_fs_info *fs_info, 86 void btrfs_check_active_zone_reservation(struct btrfs_fs_info *fs_info); [all …]
|
D | tree-mod-log.c | 47 static inline 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 …]
|
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(struct btrfs_fs_info *fs_info, u64 flags) in get_restripe_target() argument 45 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 …]
|
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 …]
|
D | subpage.h | 76 bool btrfs_is_subpage(const struct btrfs_fs_info *fs_info, struct page *page); 79 int btrfs_attach_subpage(const struct btrfs_fs_info *fs_info, 81 void btrfs_detach_subpage(const struct btrfs_fs_info *fs_info, 85 struct btrfs_subpage *btrfs_alloc_subpage(const struct btrfs_fs_info *fs_info, 89 void btrfs_page_inc_eb_refs(const struct btrfs_fs_info *fs_info, 91 void btrfs_page_dec_eb_refs(const struct btrfs_fs_info *fs_info, 94 void btrfs_subpage_start_reader(const struct btrfs_fs_info *fs_info, 96 void btrfs_subpage_end_reader(const struct btrfs_fs_info *fs_info, 99 void btrfs_subpage_start_writer(const struct btrfs_fs_info *fs_info, 101 bool btrfs_subpage_end_and_test_writer(const struct btrfs_fs_info *fs_info, [all …]
|
D | fs.h | 815 static inline void btrfs_set_last_root_drop_gen(struct btrfs_fs_info *fs_info, in btrfs_set_last_root_drop_gen() argument 818 WRITE_ONCE(fs_info->last_root_drop_gen, gen); in btrfs_set_last_root_drop_gen() 821 static inline u64 btrfs_get_last_root_drop_gen(const struct btrfs_fs_info *fs_info) in btrfs_get_last_root_drop_gen() argument 823 return READ_ONCE(fs_info->last_root_drop_gen); in btrfs_get_last_root_drop_gen() 831 const struct btrfs_fs_info *fs_info, u64 csum_bytes) in btrfs_csum_bytes_to_leaves() argument 833 const u64 num_csums = csum_bytes >> fs_info->sectorsize_bits; in btrfs_csum_bytes_to_leaves() 835 return DIV_ROUND_UP_ULL(num_csums, fs_info->csums_per_leaf); in btrfs_csum_bytes_to_leaves() 842 static inline u64 btrfs_calc_insert_metadata_size(const struct btrfs_fs_info *fs_info, in btrfs_calc_insert_metadata_size() argument 845 return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * 2 * num_items; in btrfs_calc_insert_metadata_size() 852 static inline u64 btrfs_calc_metadata_size(const struct btrfs_fs_info *fs_info, in btrfs_calc_metadata_size() argument [all …]
|
D | volumes.c | 249 static int btrfs_relocate_sys_chunks(struct btrfs_fs_info *fs_info); 1147 device->fs_info = NULL; in btrfs_close_one_device() 1187 fs_devices->fs_info = NULL; in close_fs_devices() 1427 lockdep_assert_held(&device->fs_info->chunk_mutex); in contains_pending_extent() 1589 struct btrfs_fs_info *fs_info = device->fs_info; in find_free_dev_extent() local 1590 struct btrfs_root *root = fs_info->dev_root; in find_free_dev_extent() 1733 struct btrfs_fs_info *fs_info = device->fs_info; in btrfs_free_dev_extent() local 1734 struct btrfs_root *root = fs_info->dev_root; in btrfs_free_dev_extent() 1783 static u64 find_next_chunk(struct btrfs_fs_info *fs_info) in find_next_chunk() argument 1790 em_tree = &fs_info->mapping_tree; in find_next_chunk() [all …]
|
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 …]
|
D | messages.c | 117 void __btrfs_handle_fs_error(struct btrfs_fs_info *fs_info, const char *function, in __btrfs_handle_fs_error() argument 120 struct super_block *sb = fs_info->sb; in __btrfs_handle_fs_error() 140 btrfs_state_to_string(fs_info, statestr); in __btrfs_handle_fs_error() 162 WRITE_ONCE(fs_info->fs_error, errno); in __btrfs_handle_fs_error() 171 btrfs_discard_stop(fs_info); in __btrfs_handle_fs_error() 175 btrfs_info(fs_info, "forced readonly"); in __btrfs_handle_fs_error() 213 void __cold _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...) in _btrfs_printk() argument 244 if (fs_info) { in _btrfs_printk() 247 btrfs_state_to_string(fs_info, statestr); in _btrfs_printk() 249 fs_info->sb->s_id, statestr, &vaf); in _btrfs_printk() [all …]
|
D | super.c | 230 static bool check_ro_option(struct btrfs_fs_info *fs_info, unsigned long opt, in check_ro_option() argument 233 if (fs_info->mount_opt & opt) { in check_ro_option() 234 btrfs_err(fs_info, "%s must be used with ro mount option", in check_ro_option() 967 char *btrfs_get_subvol_name_from_objectid(struct btrfs_fs_info *fs_info, in btrfs_get_subvol_name_from_objectid() argument 970 struct btrfs_root *root = fs_info->tree_root; in btrfs_get_subvol_name_from_objectid() 1028 fs_root = btrfs_get_fs_root(fs_info, subvol_objectid, true); in btrfs_get_subvol_name_from_objectid() 1089 static int get_default_subvol_objectid(struct btrfs_fs_info *fs_info, u64 *objectid) in get_default_subvol_objectid() argument 1091 struct btrfs_root *root = fs_info->tree_root; in get_default_subvol_objectid() 1107 dir_id = btrfs_super_root_dir(fs_info->super_copy); in get_default_subvol_objectid() 1135 struct btrfs_fs_info *fs_info = btrfs_sb(sb); in btrfs_fill_super() local [all …]
|
D | ref-verify.h | 10 int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info); 11 void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info); 12 int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, 14 void btrfs_free_ref_tree_range(struct btrfs_fs_info *fs_info, u64 start, 17 static inline void btrfs_init_ref_verify(struct btrfs_fs_info *fs_info) in btrfs_init_ref_verify() argument 19 spin_lock_init(&fs_info->ref_verify_lock); in btrfs_init_ref_verify() 20 fs_info->block_tree = RB_ROOT; in btrfs_init_ref_verify() 23 static inline int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info) in btrfs_build_ref_tree() argument 28 static inline void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info) in btrfs_free_ref_cache() argument 32 static inline int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, in btrfs_ref_tree_mod() argument [all …]
|
D | file-item.c | 51 struct btrfs_fs_info *fs_info = inode->root->fs_info; in btrfs_inode_safe_disk_i_size_write() local 57 if (btrfs_fs_incompat(fs_info, NO_HOLES)) { in btrfs_inode_safe_disk_i_size_write() 93 ASSERT(IS_ALIGNED(start + len, inode->root->fs_info->sectorsize)); in btrfs_inode_set_file_extent_range() 95 if (btrfs_fs_incompat(inode->root->fs_info, NO_HOLES)) 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() 124 if (btrfs_fs_incompat(inode->root->fs_info, NO_HOLES)) in btrfs_inode_clear_file_extent_range() 130 static size_t bytes_to_csum_size(const struct btrfs_fs_info *fs_info, u32 bytes) in bytes_to_csum_size() argument 132 ASSERT(IS_ALIGNED(bytes, fs_info->sectorsize)); in bytes_to_csum_size() 134 return (bytes >> fs_info->sectorsize_bits) * fs_info->csum_size; in bytes_to_csum_size() 137 static size_t csum_size_to_bytes(const struct btrfs_fs_info *fs_info, u32 csum_size) in csum_size_to_bytes() argument [all …]
|
/Linux-v6.6/fs/btrfs/tests/ |
D | btrfs-tests.c | 97 struct btrfs_device *btrfs_alloc_dummy_device(struct btrfs_fs_info *fs_info) in btrfs_alloc_dummy_device() argument 107 list_add(&dev->dev_list, &fs_info->fs_devices->devices); in btrfs_alloc_dummy_device() 120 struct btrfs_fs_info *fs_info = kzalloc(sizeof(struct btrfs_fs_info), in btrfs_alloc_dummy_fs_info() local 123 if (!fs_info) in btrfs_alloc_dummy_fs_info() 124 return fs_info; in btrfs_alloc_dummy_fs_info() 125 fs_info->fs_devices = kzalloc(sizeof(struct btrfs_fs_devices), in btrfs_alloc_dummy_fs_info() 127 if (!fs_info->fs_devices) { in btrfs_alloc_dummy_fs_info() 128 kfree(fs_info); in btrfs_alloc_dummy_fs_info() 131 INIT_LIST_HEAD(&fs_info->fs_devices->devices); in btrfs_alloc_dummy_fs_info() 133 fs_info->super_copy = kzalloc(sizeof(struct btrfs_super_block), in btrfs_alloc_dummy_fs_info() [all …]
|