Lines Matching refs:fs_info

347 #define BTRFS_MAX_EXTENT_ITEM_SIZE(r) ((BTRFS_LEAF_DATA_SIZE(r->fs_info) >> 4) - \
547 struct btrfs_fs_info *fs_info; member
568 struct btrfs_fs_info *fs_info; member
1174 struct btrfs_fs_info *fs_info; member
1372 #define btrfs_test_opt(fs_info, opt) ((fs_info)->mount_opt & \ argument
1375 #define btrfs_set_and_info(fs_info, opt, fmt, args...) \ argument
1377 if (!btrfs_test_opt(fs_info, opt)) \
1378 btrfs_info(fs_info, fmt, ##args); \
1379 btrfs_set_opt(fs_info->mount_opt, opt); \
1382 #define btrfs_clear_and_info(fs_info, opt, fmt, args...) \ argument
1384 if (btrfs_test_opt(fs_info, opt)) \
1385 btrfs_info(fs_info, fmt, ##args); \
1386 btrfs_clear_opt(fs_info->mount_opt, opt); \
1393 struct btrfs_fs_info *fs_info = block_group->fs_info; in btrfs_should_fragment_free_space() local
1395 return (btrfs_test_opt(fs_info, FRAGMENT_METADATA) && in btrfs_should_fragment_free_space()
1397 (btrfs_test_opt(fs_info, FRAGMENT_DATA) && in btrfs_should_fragment_free_space()
1469 #define BTRFS_BYTES_TO_BLKS(fs_info, bytes) \ argument
1470 ((bytes) >> (fs_info)->sb->s_blocksize_bits)
1588 WARN_ON(!IS_ALIGNED(val, eb->fs_info->sectorsize)); in btrfs_set_device_total_bytes()
2368 static inline unsigned int leaf_data_end(const struct btrfs_fs_info *fs_info, in leaf_data_end() argument
2374 return BTRFS_LEAF_DATA_SIZE(fs_info); in leaf_data_end()
2592 u64 btrfs_csum_bytes_to_leaves(struct btrfs_fs_info *fs_info, u64 csum_bytes);
2594 static inline u64 btrfs_calc_trans_metadata_size(struct btrfs_fs_info *fs_info, in btrfs_calc_trans_metadata_size() argument
2597 return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * 2 * num_items; in btrfs_calc_trans_metadata_size()
2604 static inline u64 btrfs_calc_trunc_metadata_size(struct btrfs_fs_info *fs_info, in btrfs_calc_trunc_metadata_size() argument
2607 return (u64)fs_info->nodesize * BTRFS_MAX_LEVEL * num_items; in btrfs_calc_trunc_metadata_size()
2611 struct btrfs_fs_info *fs_info);
2613 struct btrfs_fs_info *fs_info);
2614 void btrfs_dec_block_group_reservations(struct btrfs_fs_info *fs_info,
2617 bool btrfs_inc_nocow_writers(struct btrfs_fs_info *fs_info, u64 bytenr);
2618 void btrfs_dec_nocow_writers(struct btrfs_fs_info *fs_info, u64 bytenr);
2623 int btrfs_async_run_delayed_refs(struct btrfs_fs_info *fs_info,
2625 int btrfs_lookup_data_extent(struct btrfs_fs_info *fs_info, u64 start, u64 len);
2627 struct btrfs_fs_info *fs_info, u64 bytenr,
2629 int btrfs_pin_extent(struct btrfs_fs_info *fs_info,
2631 int btrfs_pin_extent_for_log_replay(struct btrfs_fs_info *fs_info,
2633 int btrfs_exclude_logged_extents(struct btrfs_fs_info *fs_info,
2667 struct btrfs_fs_info *fs_info,
2675 int btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info,
2677 int btrfs_free_and_pin_reserved_extent(struct btrfs_fs_info *fs_info,
2679 void btrfs_prepare_extent_commit(struct btrfs_fs_info *fs_info);
2688 struct btrfs_fs_info *fs_info);
2690 struct btrfs_fs_info *fs_info);
2691 int btrfs_extent_readonly(struct btrfs_fs_info *fs_info, u64 bytenr);
2694 int btrfs_can_relocate(struct btrfs_fs_info *fs_info, u64 bytenr);
2698 void btrfs_add_raid_kobjects(struct btrfs_fs_info *fs_info);
2700 struct btrfs_fs_info *fs_info,
2704 void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info);
2708 u64 btrfs_data_alloc_profile(struct btrfs_fs_info *fs_info);
2709 u64 btrfs_metadata_alloc_profile(struct btrfs_fs_info *fs_info);
2710 u64 btrfs_system_alloc_profile(struct btrfs_fs_info *fs_info);
2747 void btrfs_subvolume_release_metadata(struct btrfs_fs_info *fs_info,
2758 struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_fs_info *fs_info,
2760 void btrfs_init_metadata_block_rsv(struct btrfs_fs_info *fs_info,
2763 void btrfs_free_block_rsv(struct btrfs_fs_info *fs_info,
2775 int btrfs_cond_migrate_bytes(struct btrfs_fs_info *fs_info,
2778 void btrfs_block_rsv_release(struct btrfs_fs_info *fs_info,
2785 int btrfs_error_unpin_extent_range(struct btrfs_fs_info *fs_info,
2787 int btrfs_discard_extent(struct btrfs_fs_info *fs_info, u64 bytenr,
2790 int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range);
2792 int btrfs_init_space_info(struct btrfs_fs_info *fs_info);
2794 struct btrfs_fs_info *fs_info);
2812 void btrfs_set_item_key_safe(struct btrfs_fs_info *fs_info,
2848 void btrfs_extend_item(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
2850 void btrfs_truncate_item(struct btrfs_fs_info *fs_info,
2929 int btrfs_leaf_free_space(struct btrfs_fs_info *fs_info,
2938 static inline int btrfs_fs_closing(struct btrfs_fs_info *fs_info) in btrfs_fs_closing() argument
2943 if (test_bit(BTRFS_FS_CLOSING_START, &fs_info->flags)) { in btrfs_fs_closing()
2944 if (test_bit(BTRFS_FS_CLOSING_DONE, &fs_info->flags)) in btrfs_fs_closing()
2956 static inline int btrfs_need_cleaner_sleep(struct btrfs_fs_info *fs_info) in btrfs_need_cleaner_sleep() argument
2958 return fs_info->sb->s_flags & SB_RDONLY || btrfs_fs_closing(fs_info); in btrfs_need_cleaner_sleep()
2961 static inline void free_fs_info(struct btrfs_fs_info *fs_info) in free_fs_info() argument
2963 kfree(fs_info->balance_ctl); in free_fs_info()
2964 kfree(fs_info->delayed_root); in free_fs_info()
2965 kfree(fs_info->extent_root); in free_fs_info()
2966 kfree(fs_info->tree_root); in free_fs_info()
2967 kfree(fs_info->chunk_root); in free_fs_info()
2968 kfree(fs_info->dev_root); in free_fs_info()
2969 kfree(fs_info->csum_root); in free_fs_info()
2970 kfree(fs_info->quota_root); in free_fs_info()
2971 kfree(fs_info->uuid_root); in free_fs_info()
2972 kfree(fs_info->free_space_root); in free_fs_info()
2973 kfree(fs_info->super_copy); in free_fs_info()
2974 kfree(fs_info->super_for_commit); in free_fs_info()
2975 security_free_mnt_opts(&fs_info->security_opts); in free_fs_info()
2976 kvfree(fs_info); in free_fs_info()
2980 u64 btrfs_get_tree_mod_seq(struct btrfs_fs_info *fs_info,
2982 void btrfs_put_tree_mod_seq(struct btrfs_fs_info *fs_info,
3005 int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info);
3017 int btrfs_uuid_tree_iterate(struct btrfs_fs_info *fs_info,
3057 struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_fs_info *fs_info,
3104 struct btrfs_fs_info *fs_info, u64 bytenr, u64 len);
3159 int btrfs_start_delalloc_roots(struct btrfs_fs_info *fs_info, int nr);
3195 void btrfs_run_delayed_iputs(struct btrfs_fs_info *fs_info);
3219 void btrfs_update_ioctl_balance_args(struct btrfs_fs_info *fs_info,
3230 int btrfs_run_defrag_inodes(struct btrfs_fs_info *fs_info);
3231 void btrfs_cleanup_defrag_inodes(struct btrfs_fs_info *fs_info);
3263 int btrfs_sysfs_add_mounted(struct btrfs_fs_info *fs_info);
3264 void btrfs_sysfs_remove_mounted(struct btrfs_fs_info *fs_info);
3272 void btrfs_no_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...) in btrfs_no_printk() argument
3279 void btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
3281 #define btrfs_printk(fs_info, fmt, args...) \ argument
3282 btrfs_no_printk(fs_info, fmt, ##args)
3285 #define btrfs_emerg(fs_info, fmt, args...) \ argument
3286 btrfs_printk(fs_info, KERN_EMERG fmt, ##args)
3287 #define btrfs_alert(fs_info, fmt, args...) \ argument
3288 btrfs_printk(fs_info, KERN_ALERT fmt, ##args)
3289 #define btrfs_crit(fs_info, fmt, args...) \ argument
3290 btrfs_printk(fs_info, KERN_CRIT fmt, ##args)
3291 #define btrfs_err(fs_info, fmt, args...) \ argument
3292 btrfs_printk(fs_info, KERN_ERR fmt, ##args)
3293 #define btrfs_warn(fs_info, fmt, args...) \ argument
3294 btrfs_printk(fs_info, KERN_WARNING fmt, ##args)
3295 #define btrfs_notice(fs_info, fmt, args...) \ argument
3296 btrfs_printk(fs_info, KERN_NOTICE fmt, ##args)
3297 #define btrfs_info(fs_info, fmt, args...) \ argument
3298 btrfs_printk(fs_info, KERN_INFO fmt, ##args)
3303 #define btrfs_emerg_in_rcu(fs_info, fmt, args...) \ argument
3304 btrfs_printk_in_rcu(fs_info, KERN_EMERG fmt, ##args)
3305 #define btrfs_alert_in_rcu(fs_info, fmt, args...) \ argument
3306 btrfs_printk_in_rcu(fs_info, KERN_ALERT fmt, ##args)
3307 #define btrfs_crit_in_rcu(fs_info, fmt, args...) \ argument
3308 btrfs_printk_in_rcu(fs_info, KERN_CRIT fmt, ##args)
3309 #define btrfs_err_in_rcu(fs_info, fmt, args...) \ argument
3310 btrfs_printk_in_rcu(fs_info, KERN_ERR fmt, ##args)
3311 #define btrfs_warn_in_rcu(fs_info, fmt, args...) \ argument
3312 btrfs_printk_in_rcu(fs_info, KERN_WARNING fmt, ##args)
3313 #define btrfs_notice_in_rcu(fs_info, fmt, args...) \ argument
3314 btrfs_printk_in_rcu(fs_info, KERN_NOTICE fmt, ##args)
3315 #define btrfs_info_in_rcu(fs_info, fmt, args...) \ argument
3316 btrfs_printk_in_rcu(fs_info, KERN_INFO fmt, ##args)
3321 #define btrfs_emerg_rl_in_rcu(fs_info, fmt, args...) \ argument
3322 btrfs_printk_rl_in_rcu(fs_info, KERN_EMERG fmt, ##args)
3323 #define btrfs_alert_rl_in_rcu(fs_info, fmt, args...) \ argument
3324 btrfs_printk_rl_in_rcu(fs_info, KERN_ALERT fmt, ##args)
3325 #define btrfs_crit_rl_in_rcu(fs_info, fmt, args...) \ argument
3326 btrfs_printk_rl_in_rcu(fs_info, KERN_CRIT fmt, ##args)
3327 #define btrfs_err_rl_in_rcu(fs_info, fmt, args...) \ argument
3328 btrfs_printk_rl_in_rcu(fs_info, KERN_ERR fmt, ##args)
3329 #define btrfs_warn_rl_in_rcu(fs_info, fmt, args...) \ argument
3330 btrfs_printk_rl_in_rcu(fs_info, KERN_WARNING fmt, ##args)
3331 #define btrfs_notice_rl_in_rcu(fs_info, fmt, args...) \ argument
3332 btrfs_printk_rl_in_rcu(fs_info, KERN_NOTICE fmt, ##args)
3333 #define btrfs_info_rl_in_rcu(fs_info, fmt, args...) \ argument
3334 btrfs_printk_rl_in_rcu(fs_info, KERN_INFO fmt, ##args)
3339 #define btrfs_emerg_rl(fs_info, fmt, args...) \ argument
3340 btrfs_printk_ratelimited(fs_info, KERN_EMERG fmt, ##args)
3341 #define btrfs_alert_rl(fs_info, fmt, args...) \ argument
3342 btrfs_printk_ratelimited(fs_info, KERN_ALERT fmt, ##args)
3343 #define btrfs_crit_rl(fs_info, fmt, args...) \ argument
3344 btrfs_printk_ratelimited(fs_info, KERN_CRIT fmt, ##args)
3345 #define btrfs_err_rl(fs_info, fmt, args...) \ argument
3346 btrfs_printk_ratelimited(fs_info, KERN_ERR fmt, ##args)
3347 #define btrfs_warn_rl(fs_info, fmt, args...) \ argument
3348 btrfs_printk_ratelimited(fs_info, KERN_WARNING fmt, ##args)
3349 #define btrfs_notice_rl(fs_info, fmt, args...) \ argument
3350 btrfs_printk_ratelimited(fs_info, KERN_NOTICE fmt, ##args)
3351 #define btrfs_info_rl(fs_info, fmt, args...) \ argument
3352 btrfs_printk_ratelimited(fs_info, KERN_INFO fmt, ##args)
3355 #define btrfs_debug(fs_info, fmt, args...) \ argument
3359 btrfs_printk(fs_info, KERN_DEBUG fmt, ##args); \
3361 #define btrfs_debug_in_rcu(fs_info, fmt, args...) \ argument
3365 btrfs_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args); \
3367 #define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \ argument
3371 btrfs_printk_rl_in_rcu(fs_info, KERN_DEBUG fmt, \
3374 #define btrfs_debug_rl(fs_info, fmt, args...) \ argument
3378 btrfs_printk_ratelimited(fs_info, KERN_DEBUG fmt, \
3382 #define btrfs_debug(fs_info, fmt, args...) \ argument
3383 btrfs_printk(fs_info, KERN_DEBUG fmt, ##args)
3384 #define btrfs_debug_in_rcu(fs_info, fmt, args...) \ argument
3385 btrfs_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
3386 #define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \ argument
3387 btrfs_printk_rl_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
3388 #define btrfs_debug_rl(fs_info, fmt, args...) \ argument
3389 btrfs_printk_ratelimited(fs_info, KERN_DEBUG fmt, ##args)
3391 #define btrfs_debug(fs_info, fmt, args...) \ argument
3392 btrfs_no_printk(fs_info, KERN_DEBUG fmt, ##args)
3393 #define btrfs_debug_in_rcu(fs_info, fmt, args...) \ argument
3394 btrfs_no_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
3395 #define btrfs_debug_rl_in_rcu(fs_info, fmt, args...) \ argument
3396 btrfs_no_printk_in_rcu(fs_info, KERN_DEBUG fmt, ##args)
3397 #define btrfs_debug_rl(fs_info, fmt, args...) \ argument
3398 btrfs_no_printk(fs_info, KERN_DEBUG fmt, ##args)
3401 #define btrfs_printk_in_rcu(fs_info, fmt, args...) \ argument
3404 btrfs_printk(fs_info, fmt, ##args); \
3408 #define btrfs_no_printk_in_rcu(fs_info, fmt, args...) \ argument
3411 btrfs_no_printk(fs_info, fmt, ##args); \
3415 #define btrfs_printk_ratelimited(fs_info, fmt, args...) \ argument
3421 btrfs_printk(fs_info, fmt, ##args); \
3424 #define btrfs_printk_rl_in_rcu(fs_info, fmt, args...) \ argument
3427 btrfs_printk_ratelimited(fs_info, fmt, ##args); \
3448 static inline void btrfs_print_v0_err(struct btrfs_fs_info *fs_info) in btrfs_print_v0_err() argument
3450 btrfs_err(fs_info, in btrfs_print_v0_err()
3456 void __btrfs_handle_fs_error(struct btrfs_fs_info *fs_info, const char *function,
3474 &((trans)->fs_info->fs_state))) { \
3480 btrfs_debug((trans)->fs_info, \
3489 #define btrfs_handle_fs_error(fs_info, errno, fmt, args...) \ argument
3491 __btrfs_handle_fs_error((fs_info), __func__, __LINE__, \
3497 void __btrfs_panic(struct btrfs_fs_info *fs_info, const char *function,
3503 #define btrfs_panic(fs_info, errno, fmt, args...) \ argument
3505 __btrfs_panic(fs_info, __func__, __LINE__, errno, fmt, ##args); \
3515 static inline void __btrfs_set_fs_incompat(struct btrfs_fs_info *fs_info, in __btrfs_set_fs_incompat() argument
3521 disk_super = fs_info->super_copy; in __btrfs_set_fs_incompat()
3524 spin_lock(&fs_info->super_lock); in __btrfs_set_fs_incompat()
3529 btrfs_info(fs_info, "setting %llu feature flag", in __btrfs_set_fs_incompat()
3532 spin_unlock(&fs_info->super_lock); in __btrfs_set_fs_incompat()
3539 static inline void __btrfs_clear_fs_incompat(struct btrfs_fs_info *fs_info, in __btrfs_clear_fs_incompat() argument
3545 disk_super = fs_info->super_copy; in __btrfs_clear_fs_incompat()
3548 spin_lock(&fs_info->super_lock); in __btrfs_clear_fs_incompat()
3553 btrfs_info(fs_info, "clearing %llu feature flag", in __btrfs_clear_fs_incompat()
3556 spin_unlock(&fs_info->super_lock); in __btrfs_clear_fs_incompat()
3560 #define btrfs_fs_incompat(fs_info, opt) \ argument
3561 __btrfs_fs_incompat((fs_info), BTRFS_FEATURE_INCOMPAT_##opt)
3563 static inline bool __btrfs_fs_incompat(struct btrfs_fs_info *fs_info, u64 flag) in __btrfs_fs_incompat() argument
3566 disk_super = fs_info->super_copy; in __btrfs_fs_incompat()
3573 static inline void __btrfs_set_fs_compat_ro(struct btrfs_fs_info *fs_info, in __btrfs_set_fs_compat_ro() argument
3579 disk_super = fs_info->super_copy; in __btrfs_set_fs_compat_ro()
3582 spin_lock(&fs_info->super_lock); in __btrfs_set_fs_compat_ro()
3587 btrfs_info(fs_info, "setting %llu ro feature flag", in __btrfs_set_fs_compat_ro()
3590 spin_unlock(&fs_info->super_lock); in __btrfs_set_fs_compat_ro()
3597 static inline void __btrfs_clear_fs_compat_ro(struct btrfs_fs_info *fs_info, in __btrfs_clear_fs_compat_ro() argument
3603 disk_super = fs_info->super_copy; in __btrfs_clear_fs_compat_ro()
3606 spin_lock(&fs_info->super_lock); in __btrfs_clear_fs_compat_ro()
3611 btrfs_info(fs_info, "clearing %llu ro feature flag", in __btrfs_clear_fs_compat_ro()
3614 spin_unlock(&fs_info->super_lock); in __btrfs_clear_fs_compat_ro()
3618 #define btrfs_fs_compat_ro(fs_info, opt) \ argument
3619 __btrfs_fs_compat_ro((fs_info), BTRFS_FEATURE_COMPAT_RO_##opt)
3621 static inline int __btrfs_fs_compat_ro(struct btrfs_fs_info *fs_info, u64 flag) in __btrfs_fs_compat_ro() argument
3624 disk_super = fs_info->super_copy; in __btrfs_fs_compat_ro()
3645 int btrfs_relocate_block_group(struct btrfs_fs_info *fs_info, u64 group_start);
3661 int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
3664 void btrfs_scrub_pause(struct btrfs_fs_info *fs_info);
3665 void btrfs_scrub_continue(struct btrfs_fs_info *fs_info);
3669 int btrfs_scrub_progress(struct btrfs_fs_info *fs_info, u64 devid,
3679 void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info);
3680 void btrfs_bio_counter_inc_noblocked(struct btrfs_fs_info *fs_info);
3681 void btrfs_bio_counter_sub(struct btrfs_fs_info *fs_info, s64 amount);
3683 static inline void btrfs_bio_counter_dec(struct btrfs_fs_info *fs_info) in btrfs_bio_counter_dec() argument
3685 btrfs_bio_counter_sub(fs_info, 1); in btrfs_bio_counter_dec()
3690 struct btrfs_fs_info *fs_info; /* tree to prefetch */ member
3712 static inline int btrfs_defrag_cancelled(struct btrfs_fs_info *fs_info) in btrfs_defrag_cancelled() argument
3722 static inline int btrfs_is_testing(struct btrfs_fs_info *fs_info) in btrfs_is_testing() argument
3726 &fs_info->fs_state))) in btrfs_is_testing()