| /linux/fs/btrfs/ |
| 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); 69 struct btrfs_fs_info *fs_info = buf->fs_info; in csum_tree_block() local 76 btrfs_csum_init(&csum, fs_info->csum_type); in csum_tree_block() 81 first_page_part = fs_info->nodesize; in csum_tree_block() 85 first_page_part = min_t(u32, PAGE_SIZE, fs_info->nodesize); in csum_tree_block() 129 btrfs_err_rl(eb->fs_info, in btrfs_buffer_uptodate() 156 int btrfs_check_super_csum(struct btrfs_fs_info *fs_info, in btrfs_check_super_csum() argument 166 btrfs_csum(fs_info->csum_type, (const u8 *)disk_sb + BTRFS_CSUM_SIZE, in btrfs_check_super_csum() 169 if (memcmp(disk_sb->csum, result, fs_info->csum_size)) in btrfs_check_super_csum() [all …]
|
| H A D | transaction.c | 149 btrfs_err(transaction->fs_info, in btrfs_put_transaction() 169 spin_lock(&transaction->fs_info->unused_bgs_lock); in btrfs_put_transaction() 171 spin_unlock(&transaction->fs_info->unused_bgs_lock); in btrfs_put_transaction() 183 struct btrfs_fs_info *fs_info = trans->fs_info; in switch_commit_roots() local 193 down_write(&fs_info->commit_root_sem); in switch_commit_roots() 195 if (test_bit(BTRFS_FS_RELOC_RUNNING, &fs_info->flags)) in switch_commit_roots() 196 fs_info->last_reloc_trans = trans->transid; in switch_commit_roots() 215 btrfs_drop_and_free_fs_root(fs_info, root); in switch_commit_roots() 220 up_write(&fs_info in switch_commit_roots() 257 struct btrfs_fs_info *fs_info = trans->fs_info; btrfs_trans_release_chunk_metadata() local 270 join_transaction(struct btrfs_fs_info * fs_info,unsigned int type) join_transaction() argument 413 struct btrfs_fs_info *fs_info = root->fs_info; record_root_in_trans() local 484 struct btrfs_fs_info *fs_info = root->fs_info; btrfs_add_dropped_root() local 503 struct btrfs_fs_info *fs_info = root->fs_info; btrfs_record_root_in_trans() local 536 wait_current_trans(struct btrfs_fs_info * fs_info,unsigned int type) wait_current_trans() argument 557 may_wait_transaction(struct btrfs_fs_info * fs_info,int type) may_wait_transaction() argument 570 struct btrfs_fs_info *fs_info = root->fs_info; need_reserve_reloc_root() local 581 btrfs_reserve_trans_metadata(struct btrfs_fs_info * fs_info,enum btrfs_reserve_flush_enum flush,u64 num_bytes,u64 * delayed_refs_bytes) btrfs_reserve_trans_metadata() argument 615 struct btrfs_fs_info *fs_info = root->fs_info; start_transaction() local 925 struct btrfs_fs_info *fs_info = commit->fs_info; wait_for_commit() local 967 btrfs_wait_for_commit(struct btrfs_fs_info * fs_info,u64 transid) btrfs_wait_for_commit() argument 1027 btrfs_throttle(struct btrfs_fs_info * fs_info) btrfs_throttle() argument 1049 struct btrfs_fs_info *fs_info = trans->fs_info; btrfs_trans_release_metadata() local 1160 btrfs_write_marked_extents(struct btrfs_fs_info * fs_info,struct extent_io_tree * dirty_pages,int mark) btrfs_write_marked_extents() argument 1213 __btrfs_wait_marked_extents(struct btrfs_fs_info * fs_info,struct extent_io_tree * dirty_pages) __btrfs_wait_marked_extents() argument 1247 btrfs_wait_extents(struct btrfs_fs_info * fs_info,struct extent_io_tree * dirty_pages) btrfs_wait_extents() argument 1264 struct btrfs_fs_info *fs_info = log_root->fs_info; btrfs_wait_tree_log_extents() local 1298 struct btrfs_fs_info *fs_info = trans->fs_info; btrfs_write_and_wait_transaction() local 1331 struct btrfs_fs_info *fs_info = root->fs_info; update_cowonly_root() local 1364 struct btrfs_fs_info *fs_info = trans->fs_info; commit_cowonly_roots() local 1450 btrfs_maybe_wake_unfinished_drop(struct btrfs_fs_info * fs_info) btrfs_maybe_wake_unfinished_drop() argument 1479 struct btrfs_fs_info *fs_info = root->fs_info; btrfs_add_dead_root() local 1500 struct btrfs_fs_info *fs_info = trans->fs_info; commit_fs_roots() local 1581 struct btrfs_fs_info *fs_info = src->fs_info; qgroup_account_snapshot() local 1676 struct btrfs_fs_info *fs_info = trans->fs_info; create_pending_snapshot() local 1977 update_super_roots(struct btrfs_fs_info * fs_info) update_super_roots() argument 2023 struct btrfs_fs_info *fs_info = trans->fs_info; btrfs_commit_transaction_async() local 2068 struct btrfs_fs_info *fs_info = trans->fs_info; cleanup_transaction() local 2152 struct btrfs_fs_info *fs_info = trans->fs_info; btrfs_cleanup_pending_block_groups() local 2168 btrfs_start_delalloc_flush(struct btrfs_fs_info * fs_info) btrfs_start_delalloc_flush() argument 2192 btrfs_wait_delalloc_flush(struct btrfs_fs_info * fs_info) btrfs_wait_delalloc_flush() argument 2220 update_commit_stats(struct btrfs_fs_info * fs_info) update_commit_stats() argument 2237 struct btrfs_fs_info *fs_info = trans->fs_info; btrfs_commit_transaction() local 2700 btrfs_clean_one_deleted_snapshot(struct btrfs_fs_info * fs_info) btrfs_clean_one_deleted_snapshot() argument 2751 struct btrfs_fs_info *fs_info = trans->fs_info; __btrfs_abort_transaction() local [all...] |
| 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 27 void _btrfs_printk(const struct btrfs_fs_info *fs_info, unsigned int level, const char *fmt, ...); 31 #define btrfs_printk_in_rcu(fs_info, level, fmt, args...) \ argument 32 btrfs_no_printk(fs_info, fmt, ##args) 34 #define btrfs_printk_rl_in_rcu(fs_info, level, fmt, args...) \ argument 35 btrfs_no_printk(fs_info, fmt, ##args) 42 #define btrfs_crit(fs_info, fmt, args...) \ argument 43 btrfs_printk_in_rcu(fs_info, LOGLEVEL_CRIT, fmt, ##args) 44 #define btrfs_err(fs_info, fmt, args...) \ argument 45 btrfs_printk_in_rcu(fs_info, LOGLEVEL_ERR, fmt, ##args) [all …]
|
| H A D | subpage.c | 38 int btrfs_attach_folio_state(const struct btrfs_fs_info *fs_info, in btrfs_attach_folio_state() argument 57 if (type == BTRFS_SUBPAGE_METADATA && !btrfs_meta_is_subpage(fs_info)) in btrfs_attach_folio_state() 59 if (type == BTRFS_SUBPAGE_DATA && !btrfs_is_subpage(fs_info, folio)) in btrfs_attach_folio_state() 62 bfs = btrfs_alloc_folio_state(fs_info, folio_size(folio), type, GFP_NOFS); in btrfs_attach_folio_state() 70 void btrfs_detach_folio_state(const struct btrfs_fs_info *fs_info, struct folio *folio, in btrfs_detach_folio_state() argument 78 if (type == BTRFS_SUBPAGE_METADATA && !btrfs_meta_is_subpage(fs_info)) in btrfs_detach_folio_state() 80 if (type == BTRFS_SUBPAGE_DATA && !btrfs_is_subpage(fs_info, folio)) in btrfs_detach_folio_state() 88 struct btrfs_folio_state *btrfs_alloc_folio_state(const struct btrfs_fs_info *fs_info, in btrfs_alloc_folio_state() argument 95 ASSERT(fs_info->sectorsize < fsize); in btrfs_alloc_folio_state() 99 (fsize >> fs_info->sectorsize_bits))); in btrfs_alloc_folio_state() [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_btrfs_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 | fs.c | 177 bool btrfs_exclop_start(struct btrfs_fs_info *fs_info, in btrfs_exclop_start() argument 182 spin_lock(&fs_info->super_lock); in btrfs_exclop_start() 183 if (fs_info->exclusive_operation == BTRFS_EXCLOP_NONE) { in btrfs_exclop_start() 184 fs_info->exclusive_operation = type; in btrfs_exclop_start() 187 spin_unlock(&fs_info->super_lock); in btrfs_exclop_start() 203 bool btrfs_exclop_start_try_lock(struct btrfs_fs_info *fs_info, in btrfs_exclop_start_try_lock() argument 206 spin_lock(&fs_info->super_lock); in btrfs_exclop_start_try_lock() 207 if (fs_info->exclusive_operation == type || in btrfs_exclop_start_try_lock() 208 (fs_info->exclusive_operation == BTRFS_EXCLOP_BALANCE_PAUSED && in btrfs_exclop_start_try_lock() 212 spin_unlock(&fs_info->super_lock); in btrfs_exclop_start_try_lock() [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 181 void btrfs_init_metadata_block_rsv(struct btrfs_fs_info *fs_info, in btrfs_init_metadata_block_rsv() argument 186 rsv->space_info = btrfs_find_space_info(fs_info, in btrfs_init_metadata_block_rsv() 190 struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_fs_info *fs_info, in btrfs_alloc_block_rsv() argument 199 btrfs_init_metadata_block_rsv(fs_info, block_rsv, type); in btrfs_alloc_block_rsv() 203 void btrfs_free_block_rsv(struct btrfs_fs_info *fs_info, in btrfs_free_block_rsv() argument 208 btrfs_block_rsv_release(fs_info, rsv, (u64)-1, NULL); in btrfs_free_block_rsv() 212 int btrfs_block_rsv_add(struct btrfs_fs_info *fs_info, in btrfs_block_rsv_add() argument 242 int btrfs_block_rsv_refill(struct btrfs_fs_info *fs_info, in btrfs_block_rsv_refill() argument 270 u64 btrfs_block_rsv_release(struct btrfs_fs_info *fs_info, in btrfs_block_rsv_release() argument [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() 101 if (unlikely(btrfs_find_device(fs_info->fs_devices, &args))) { in btrfs_init_dev_replace() 102 btrfs_err(fs_info, in btrfs_init_dev_replace() 130 btrfs_warn(fs_info, in btrfs_init_dev_replace() 161 if (unlikely(btrfs_find_device(fs_info->fs_devices, &args))) { in btrfs_init_dev_replace() 162 btrfs_err(fs_info, in btrfs_init_dev_replace() 172 dev_replace->tgtdev = btrfs_find_device(fs_info->fs_devices, &args); in btrfs_init_dev_replace() [all …]
|
| H A D | subpage.h | 94 static inline bool btrfs_meta_is_subpage(const struct btrfs_fs_info *fs_info) in btrfs_meta_is_subpage() argument 96 return fs_info->nodesize < PAGE_SIZE; in btrfs_meta_is_subpage() 98 static inline bool btrfs_is_subpage(const struct btrfs_fs_info *fs_info, in btrfs_is_subpage() argument 103 return fs_info->sectorsize < folio_size(folio); in btrfs_is_subpage() 106 int btrfs_attach_folio_state(const struct btrfs_fs_info *fs_info, 108 void btrfs_detach_folio_state(const struct btrfs_fs_info *fs_info, struct folio *folio, 112 struct btrfs_folio_state *btrfs_alloc_folio_state(const struct btrfs_fs_info *fs_info, 120 void btrfs_folio_inc_eb_refs(const struct btrfs_fs_info *fs_info, struct folio *folio); 121 void btrfs_folio_dec_eb_refs(const struct btrfs_fs_info *fs_info, struct folio *folio); 123 void btrfs_folio_end_lock(const struct btrfs_fs_info *fs_info, [all …]
|
| H A D | super.c | 73 struct btrfs_fs_info *fs_info = btrfs_sb(sb); in btrfs_put_super() local 75 btrfs_info(fs_info, "last unmount of filesystem %pU", fs_info->fs_devices->fsid); in btrfs_put_super() 76 close_ctree(fs_info); in btrfs_put_super() 660 static void btrfs_clear_oneshot_options(struct btrfs_fs_info *fs_info) in btrfs_clear_oneshot_options() argument 662 btrfs_clear_opt(fs_info->mount_opt, CLEAR_CACHE); in btrfs_clear_oneshot_options() 663 btrfs_clear_opt(fs_info->mount_opt, NOSPACECACHE); in btrfs_clear_oneshot_options() 666 static bool check_ro_option(const struct btrfs_fs_info *fs_info, in check_ro_option() argument 671 btrfs_err(fs_info, "%s must be used with ro mount option", in check_ro_option() 730 void btrfs_set_free_space_cache_settings(struct btrfs_fs_info *fs_info) in btrfs_set_free_space_cache_settings() argument 732 if (fs_info->sectorsize != PAGE_SIZE && btrfs_test_opt(fs_info, SPACE_CACHE)) { in btrfs_set_free_space_cache_settings() [all …]
|
| H A D | scrub.c | 188 struct btrfs_fs_info *fs_info; member 346 static int init_scrub_stripe(struct btrfs_fs_info *fs_info, in init_scrub_stripe() argument 351 stripe->nr_sectors = BTRFS_STRIPE_LEN >> fs_info->sectorsize_bits; in init_scrub_stripe() 368 stripe->csums = kcalloc(BTRFS_STRIPE_LEN >> fs_info->sectorsize_bits, in init_scrub_stripe() 369 fs_info->csum_size, GFP_KERNEL); in init_scrub_stripe() 385 static void __scrub_blocked_if_needed(struct btrfs_fs_info *fs_info) in __scrub_blocked_if_needed() argument 387 while (atomic_read(&fs_info->scrub_pause_req)) { in __scrub_blocked_if_needed() 388 mutex_unlock(&fs_info->scrub_lock); in __scrub_blocked_if_needed() 389 wait_event(fs_info->scrub_pause_wait, in __scrub_blocked_if_needed() 390 atomic_read(&fs_info in __scrub_blocked_if_needed() 395 scrub_pause_on(struct btrfs_fs_info * fs_info) scrub_pause_on() argument 401 scrub_pause_off(struct btrfs_fs_info * fs_info) scrub_pause_off() argument 411 scrub_blocked_if_needed(struct btrfs_fs_info * fs_info) scrub_blocked_if_needed() argument 437 scrub_setup_ctx(struct btrfs_fs_info * fs_info,bool is_dev_replace) scrub_setup_ctx() argument 492 struct btrfs_fs_info *fs_info = swarn->dev->fs_info; scrub_print_warning_inode() local 573 struct btrfs_fs_info *fs_info = dev->fs_info; scrub_print_common_warning() local 675 scrub_calc_vaddr_csum(struct btrfs_fs_info * fs_info,void * vaddr,unsigned int len,u8 * dest) scrub_calc_vaddr_csum() argument 687 struct btrfs_fs_info *fs_info = stripe->bg->fs_info; scrub_verify_one_metadata() local 756 struct btrfs_fs_info *fs_info = stripe->bg->fs_info; scrub_verify_one_sector() local 817 struct btrfs_fs_info *fs_info = stripe->bg->fs_info; scrub_verify_one_stripe() local 831 const struct btrfs_fs_info *fs_info = stripe->bg->fs_info; calc_sector_number() local 851 struct btrfs_fs_info *fs_info = stripe->bg->fs_info; scrub_read_endio_common() local 900 struct btrfs_fs_info *fs_info = bbio->inode->root->fs_info; scrub_bio_add_sector() local 916 alloc_scrub_bbio(struct btrfs_fs_info * fs_info,blk_opf_t opf,u64 logical,btrfs_bio_end_io_t end_io,void * private) alloc_scrub_bbio() argument 939 struct btrfs_fs_info *fs_info = stripe->bg->fs_info; scrub_stripe_submit_repair_read() local 982 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_stripe_report_errors() local 1144 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_stripe_read_repair_worker() local 1247 struct btrfs_fs_info *fs_info = stripe->bg->fs_info; scrub_write_endio() local 1272 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_submit_write_bio() local 1313 struct btrfs_fs_info *fs_info = stripe->bg->fs_info; scrub_write_sectors() local 1443 struct btrfs_fs_info *fs_info = path->nodes[0]->fs_info; compare_extent_item_range() local 1482 struct btrfs_fs_info *fs_info = extent_root->fs_info; find_first_extent_item() local 1568 struct btrfs_fs_info *fs_info = sctx->fs_info; sync_write_pointer_for_zoned() local 1588 fill_one_extent_info(struct btrfs_fs_info * fs_info,struct scrub_stripe * stripe,u64 extent_start,u64 extent_len,u64 extent_flags,u64 extent_gen) fill_one_extent_info() argument 1631 struct btrfs_fs_info *fs_info = bg->fs_info; scrub_find_fill_first_stripe() local 1765 struct btrfs_fs_info *fs_info = stripe->bg->fs_info; scrub_submit_extent_sector_read() local 1845 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_submit_initial_read() local 1889 struct btrfs_fs_info *fs_info = stripe->bg->fs_info; stripe_has_metadata_error() local 1925 struct btrfs_fs_info *fs_info = sctx->fs_info; flush_scrub_stripes() local 2047 struct btrfs_fs_info *fs_info = sctx->fs_info; should_cancel_scrub() local 2084 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_raid56_cached_parity() local 2133 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_raid56_parity_stripe() local 2276 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_simple_mirror() local 2405 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_stripe() local 2567 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_chunk() local 2607 struct btrfs_fs_info *fs_info = cache->fs_info; finish_extent_writes_for_zoned() local 2625 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_enumerate_chunks() local 2916 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_one_super() local 2950 struct btrfs_fs_info *fs_info = sctx->fs_info; scrub_supers() local 2998 scrub_workers_put(struct btrfs_fs_info * fs_info) scrub_workers_put() argument 3015 scrub_workers_get(struct btrfs_fs_info * fs_info) scrub_workers_get() argument 3047 btrfs_scrub_dev(struct btrfs_fs_info * fs_info,u64 devid,u64 start,u64 end,struct btrfs_scrub_progress * progress,bool readonly,bool is_dev_replace) btrfs_scrub_dev() argument 3216 btrfs_scrub_pause(struct btrfs_fs_info * fs_info) btrfs_scrub_pause() argument 3231 btrfs_scrub_continue(struct btrfs_fs_info * fs_info) btrfs_scrub_continue() argument 3237 btrfs_scrub_cancel(struct btrfs_fs_info * fs_info) btrfs_scrub_cancel() argument 3260 struct btrfs_fs_info *fs_info = dev->fs_info; btrfs_scrub_cancel_dev() local 3281 btrfs_scrub_progress(struct btrfs_fs_info * fs_info,u64 devid,struct btrfs_scrub_progress * progress) btrfs_scrub_progress() argument [all...] |
| H A D | space-info.c | 220 static u64 calc_chunk_size(const struct btrfs_fs_info *fs_info, u64 flags) in calc_chunk_size() argument 222 if (btrfs_is_zoned(fs_info)) in calc_chunk_size() 223 return fs_info->zone_size; in calc_chunk_size() 233 if (fs_info->fs_devices->total_rw_bytes > 50ULL * SZ_1G) in calc_chunk_size() 251 space_info->fs_info = info; in init_space_info() 272 struct btrfs_fs_info *fs_info = parent->fs_info; in create_space_info_sub_group() local 284 init_space_info(fs_info, sub_group, flags); in create_space_info_sub_group() 336 int btrfs_init_space_info(struct btrfs_fs_info *fs_info) in btrfs_init_space_info() argument 344 disk_super = fs_info->super_copy; in btrfs_init_space_info() 353 ret = create_space_info(fs_info, flags); in btrfs_init_space_info() [all …]
|
| H A D | block-group.c | 56 struct btrfs_fs_info *fs_info = block_group->fs_info; in btrfs_should_fragment_free_space() local 58 return (btrfs_test_opt(fs_info, FRAGMENT_METADATA) && in btrfs_should_fragment_free_space() 60 (btrfs_test_opt(fs_info, FRAGMENT_DATA) && in btrfs_should_fragment_free_space() 68 if (!btrfs_is_zoned(block_group->fs_info)) in has_unwritten_metadata() 84 static u64 get_restripe_target(const struct btrfs_fs_info *fs_info, u64 flags) in get_restripe_target() argument 86 const struct btrfs_balance_control *bctl = fs_info->balance_ctl; in get_restripe_target() 113 static u64 btrfs_reduce_alloc_profile(struct btrfs_fs_info *fs_info, u64 flags) in btrfs_reduce_alloc_profile() argument 115 u64 num_devices = fs_info->fs_devices->rw_devices; in btrfs_reduce_alloc_profile() 124 spin_lock(&fs_info->balance_lock); in btrfs_reduce_alloc_profile() 125 target = get_restripe_target(fs_info, flags); in btrfs_reduce_alloc_profile() [all …]
|
| H A D | fs.h | 981 #define folio_to_fs_info(_folio) (folio_to_inode(_folio)->root->fs_info) 984 struct inode *: (_inode)))->root->fs_info) 992 static inline unsigned int btrfs_min_folio_size(const struct btrfs_fs_info *fs_info) in btrfs_min_folio_size() argument 994 return 1U << (PAGE_SHIFT + fs_info->block_min_order); in btrfs_min_folio_size() 997 static inline u64 btrfs_get_fs_generation(const struct btrfs_fs_info *fs_info) in btrfs_get_fs_generation() argument 999 return READ_ONCE(fs_info->generation); in btrfs_get_fs_generation() 1002 static inline void btrfs_set_fs_generation(struct btrfs_fs_info *fs_info, u64 gen) in btrfs_set_fs_generation() argument 1004 WRITE_ONCE(fs_info->generation, gen); in btrfs_set_fs_generation() 1007 static inline u64 btrfs_get_last_trans_committed(const struct btrfs_fs_info *fs_info) in btrfs_get_last_trans_committed() argument 1009 return READ_ONCE(fs_info->last_trans_committed); in btrfs_get_last_trans_committed() [all …]
|
| H A D | disk-io.h | 46 void btrfs_check_leaked_roots(const struct btrfs_fs_info *fs_info); 47 void btrfs_init_fs_info(struct btrfs_fs_info *fs_info); 48 struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr, 51 struct btrfs_fs_info *fs_info, 55 int btrfs_start_pre_rw_mount(struct btrfs_fs_info *fs_info); 56 int btrfs_check_super_csum(struct btrfs_fs_info *fs_info, 59 void __cold close_ctree(struct btrfs_fs_info *fs_info); 60 int btrfs_validate_super(const struct btrfs_fs_info *fs_info, 62 int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount); 64 int btrfs_commit_super(struct btrfs_fs_info *fs_info); [all …]
|
| H A D | ref-verify.c | 196 static void __print_stack_trace(struct btrfs_fs_info *fs_info, in __print_stack_trace() argument 200 btrfs_err(fs_info, " ref-verify: no stacktrace"); in __print_stack_trace() 210 static inline void __print_stack_trace(struct btrfs_fs_info *fs_info, in __print_stack_trace() argument 213 btrfs_err(fs_info, " ref-verify: no stacktrace support"); in __print_stack_trace() 245 static struct block_entry *add_block_entry(struct btrfs_fs_info *fs_info, in add_block_entry() argument 265 spin_lock(&fs_info->ref_verify_lock); in add_block_entry() 266 exist = insert_block_entry(&fs_info->block_tree, be); in add_block_entry() 294 static int add_tree_block(struct btrfs_fs_info *fs_info, u64 ref_root, in add_tree_block() argument 314 be = add_block_entry(fs_info, bytenr, fs_info->nodesize, ref_root); in add_tree_block() 334 spin_unlock(&fs_info->ref_verify_lock); in add_tree_block() [all …]
|
| H A D | volumes.c | 262 static int btrfs_relocate_sys_chunks(struct btrfs_fs_info *fs_info); 1188 device->fs_info = NULL; in btrfs_close_one_device() 1228 fs_devices->fs_info = NULL; in close_fs_devices() 1559 lockdep_assert_held(&device->fs_info->chunk_mutex); in btrfs_first_pending_extent() 1604 lockdep_assert_held(&device->fs_info->chunk_mutex); in btrfs_find_hole_in_pending_extents() 1838 struct btrfs_fs_info *fs_info = device->fs_info; in find_free_dev_extent() local 1839 struct btrfs_root *root = fs_info->dev_root; in find_free_dev_extent() 1979 struct btrfs_fs_info *fs_info = device->fs_info; in btrfs_free_dev_extent() local 1980 struct btrfs_root *root = fs_info->dev_root; in btrfs_free_dev_extent() 2027 static u64 find_next_chunk(struct btrfs_fs_info *fs_info) in find_next_chunk() argument [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() 179 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_attr_show() local 181 if (fs_info) { in btrfs_feature_attr_show() 182 u64 features = get_features(fs_info, fa->feature_set); in btrfs_feature_attr_show() 195 struct btrfs_fs_info *fs_info; in btrfs_feature_attr_store() local 201 fs_info = to_fs_info(kobj); in btrfs_feature_attr_store() 202 if (!fs_info) in btrfs_feature_attr_store() [all …]
|
| H A D | messages.c | 118 void __btrfs_handle_fs_error(struct btrfs_fs_info *fs_info, const char *function, in __btrfs_handle_fs_error() argument 121 struct super_block *sb = fs_info->sb; in __btrfs_handle_fs_error() 141 btrfs_state_to_string(fs_info, statestr); in __btrfs_handle_fs_error() 163 WRITE_ONCE(fs_info->fs_error, error); in __btrfs_handle_fs_error() 172 btrfs_discard_stop(fs_info); in __btrfs_handle_fs_error() 176 btrfs_info(fs_info, "forced readonly"); in __btrfs_handle_fs_error() 215 void _btrfs_printk(const struct btrfs_fs_info *fs_info, unsigned int level, const char *fmt, ...) in _btrfs_printk() argument 232 if (fs_info) { in _btrfs_printk() 235 btrfs_state_to_string(fs_info, statestr); in _btrfs_printk() 237 fs_info->sb->s_id, statestr, &vaf); in _btrfs_printk() [all …]
|
| H A D | zoned.c | 204 const sector_t zone_sectors = device->fs_info->zone_size >> SECTOR_SHIFT; in emulate_report_zones() 274 btrfs_err(device->fs_info, in btrfs_get_dev_zones() 296 static int calculate_emulated_zone_size(struct btrfs_fs_info *fs_info) in calculate_emulated_zone_size() argument 299 struct btrfs_root *root = fs_info->dev_root; in calculate_emulated_zone_size() 328 fs_info->zone_size = btrfs_dev_extent_length(leaf, dext); in calculate_emulated_zone_size() 332 int btrfs_get_dev_zone_info_all_devices(struct btrfs_fs_info *fs_info) in btrfs_get_dev_zone_info_all_devices() argument 334 struct btrfs_fs_devices *fs_devices = fs_info->fs_devices; in btrfs_get_dev_zone_info_all_devices() 339 if (!btrfs_fs_incompat(fs_info, ZONED)) in btrfs_get_dev_zone_info_all_devices() 366 btrfs_err(device->fs_info, "zoned: not enough zones to mount filesystem: %u < %d", in btrfs_get_max_active_zones() 383 struct btrfs_fs_info *fs_info = device->fs_info; in btrfs_get_dev_zone_info() local [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 | extent_io.c | 45 struct btrfs_fs_info *fs_info = eb->fs_info; in btrfs_leak_debug_add_eb() local 48 spin_lock_irqsave(&fs_info->eb_leak_lock, flags); in btrfs_leak_debug_add_eb() 49 list_add(&eb->leak_list, &fs_info->allocated_ebs); in btrfs_leak_debug_add_eb() 50 spin_unlock_irqrestore(&fs_info->eb_leak_lock, flags); in btrfs_leak_debug_add_eb() 55 struct btrfs_fs_info *fs_info = eb->fs_info; in btrfs_leak_debug_del_eb() local 58 spin_lock_irqsave(&fs_info->eb_leak_lock, flags); in btrfs_leak_debug_del_eb() 60 spin_unlock_irqrestore(&fs_info->eb_leak_lock, flags); in btrfs_leak_debug_del_eb() 63 void btrfs_extent_buffer_leak_debug_check(struct btrfs_fs_info *fs_info) in btrfs_extent_buffer_leak_debug_check() argument 72 if (!fs_info->allocated_ebs.next) in btrfs_extent_buffer_leak_debug_check() 75 WARN_ON(!list_empty(&fs_info->allocated_ebs)); in btrfs_extent_buffer_leak_debug_check() [all …]
|
| H A D | ref-verify.h | 19 int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info); 20 void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info); 21 int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, 23 void btrfs_free_ref_tree_range(struct btrfs_fs_info *fs_info, u64 start, 26 static inline void btrfs_init_ref_verify(struct btrfs_fs_info *fs_info) in btrfs_init_ref_verify() argument 28 spin_lock_init(&fs_info->ref_verify_lock); in btrfs_init_ref_verify() 29 fs_info->block_tree = RB_ROOT; in btrfs_init_ref_verify() 32 static inline int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info) in btrfs_build_ref_tree() argument 37 static inline void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info) in btrfs_free_ref_cache() argument 41 static inline int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info, in btrfs_ref_tree_mod() argument [all …]
|
| H A D | relocation.c | 185 static struct reloc_control *get_reloc_control(struct btrfs_fs_info *fs_info) in get_reloc_control() argument 190 if (!data_race(fs_info->reloc_ctl)) in get_reloc_control() 193 spin_lock(&fs_info->reloc_ctl_lock); in get_reloc_control() 194 rc = fs_info->reloc_ctl; in get_reloc_control() 197 spin_unlock(&fs_info->reloc_ctl_lock); in get_reloc_control() 218 ASSERT(rc->extent_root->fs_info->reloc_ctl != rc); in put_reloc_control() 236 struct btrfs_fs_info *fs_info = root->fs_info; in __del_reloc_root() local 242 rc = get_reloc_control(fs_info); in __del_reloc_root() 264 spin_lock(&fs_info->trans_lock); in __del_reloc_root() 269 spin_unlock(&fs_info->trans_lock); in __del_reloc_root() [all …]
|
| /linux/fs/btrfs/tests/ |
| H A D | raid-stripe-tree-tests.c | 40 struct btrfs_fs_info *fs_info = trans->fs_info; in test_punch_hole_3extents() local 54 bioc = alloc_btrfs_io_context(fs_info, logical1, RST_TEST_NUM_DEVICES); in test_punch_hole_3extents() 61 io_stripe.dev = btrfs_device_by_devid(fs_info->fs_devices, 0); in test_punch_hole_3extents() 70 stripe->dev = btrfs_device_by_devid(fs_info->fs_devices, i); in test_punch_hole_3extents() 91 stripe->dev = btrfs_device_by_devid(fs_info->fs_devices, i); in test_punch_hole_3extents() 112 stripe->dev = btrfs_device_by_devid(fs_info->fs_devices, i); in test_punch_hole_3extents() 141 ret = btrfs_get_raid_extent_offset(fs_info, logical1, &len1, map_type, in test_punch_hole_3extents() 164 ret = btrfs_get_raid_extent_offset(fs_info, logical2, &len2, map_type, in test_punch_hole_3extents() 175 ret = btrfs_get_raid_extent_offset(fs_info, logical3, &len3, map_type, in test_punch_hole_3extents() 218 struct btrfs_fs_info *fs_info = trans->fs_info; in test_delete_two_extents() local [all …]
|