Home
last modified time | relevance | path

Searched refs:fs_info (Results 1 – 25 of 73) sorted by relevance

123

/fs/btrfs/
Ddisk-io.c61 static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
230 BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev; in btree_get_extent()
245 em->bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev; in btree_get_extent()
278 static int csum_tree_block(struct btrfs_fs_info *fs_info, in csum_tree_block() argument
282 u16 csum_size = btrfs_super_csum_size(fs_info->super_copy); in csum_tree_block()
323 btrfs_warn_rl(fs_info, in csum_tree_block()
326 fs_info->sb->s_id, buf->start, in csum_tree_block()
372 btrfs_err_rl(eb->fs_info, in verify_parent_transid()
449 io_tree = &BTRFS_I(root->fs_info->btree_inode)->io_tree; in btree_read_extent_buffer_pages()
463 num_copies = btrfs_num_copies(root->fs_info, in btree_read_extent_buffer_pages()
[all …]
Dqgroup.c138 qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid,
140 static void qgroup_rescan_zero_tracking(struct btrfs_fs_info *fs_info);
143 static struct btrfs_qgroup *find_qgroup_rb(struct btrfs_fs_info *fs_info, in find_qgroup_rb() argument
146 struct rb_node *n = fs_info->qgroup_tree.rb_node; in find_qgroup_rb()
162 static struct btrfs_qgroup *add_qgroup_rb(struct btrfs_fs_info *fs_info, in add_qgroup_rb() argument
165 struct rb_node **p = &fs_info->qgroup_tree.rb_node; in add_qgroup_rb()
191 rb_insert_color(&qgroup->node, &fs_info->qgroup_tree); in add_qgroup_rb()
220 static int del_qgroup_rb(struct btrfs_fs_info *fs_info, u64 qgroupid) in del_qgroup_rb() argument
222 struct btrfs_qgroup *qgroup = find_qgroup_rb(fs_info, qgroupid); in del_qgroup_rb()
227 rb_erase(&qgroup->node, &fs_info->qgroup_tree); in del_qgroup_rb()
[all …]
Ddev-replace.c41 static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
44 struct btrfs_fs_info *fs_info,
50 static u64 __btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info);
52 static int btrfs_dev_replace_continue_on_mount(struct btrfs_fs_info *fs_info);
55 int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info) in btrfs_init_dev_replace() argument
58 struct btrfs_root *dev_root = fs_info->dev_root; in btrfs_init_dev_replace()
59 struct btrfs_dev_replace *dev_replace = &fs_info->dev_replace; in btrfs_init_dev_replace()
106 btrfs_warn(fs_info, in btrfs_init_dev_replace()
138 dev_replace->srcdev = btrfs_find_device(fs_info, src_devid, in btrfs_init_dev_replace()
140 dev_replace->tgtdev = btrfs_find_device(fs_info, in btrfs_init_dev_replace()
[all …]
Dtransaction.c112 struct btrfs_fs_info *fs_info) in switch_commit_roots() argument
116 down_write(&fs_info->commit_root_sem); in switch_commit_roots()
134 btrfs_drop_and_free_fs_root(fs_info, root); in switch_commit_roots()
138 up_write(&fs_info->commit_root_sem); in switch_commit_roots()
172 struct btrfs_fs_info *fs_info = root->fs_info; in join_transaction() local
174 spin_lock(&fs_info->trans_lock); in join_transaction()
177 if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) { in join_transaction()
178 spin_unlock(&fs_info->trans_lock); in join_transaction()
182 cur_trans = fs_info->running_transaction; in join_transaction()
185 spin_unlock(&fs_info->trans_lock); in join_transaction()
[all …]
Dsuper.c100 static void save_error_info(struct btrfs_fs_info *fs_info) in save_error_info() argument
106 set_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state); in save_error_info()
110 static void btrfs_handle_error(struct btrfs_fs_info *fs_info) in btrfs_handle_error() argument
112 struct super_block *sb = fs_info->sb; in btrfs_handle_error()
117 if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) { in btrfs_handle_error()
119 btrfs_info(fs_info, "forced readonly"); in btrfs_handle_error()
138 void __btrfs_std_error(struct btrfs_fs_info *fs_info, const char *function, in __btrfs_std_error() argument
141 struct super_block *sb = fs_info->sb; in __btrfs_std_error()
174 save_error_info(fs_info); in __btrfs_std_error()
176 btrfs_handle_error(fs_info); in __btrfs_std_error()
[all …]
Dreada.c94 struct btrfs_fs_info *fs_info; member
100 static void reada_start_machine(struct btrfs_fs_info *fs_info);
101 static void __reada_start_machine(struct btrfs_fs_info *fs_info);
117 struct btrfs_fs_info *fs_info = root->fs_info; in __readahead_hook() local
126 spin_lock(&fs_info->reada_lock); in __readahead_hook()
127 re = radix_tree_lookup(&fs_info->reada_tree, index); in __readahead_hook()
130 spin_unlock(&fs_info->reada_lock); in __readahead_hook()
191 btrfs_debug(root->fs_info, in __readahead_hook()
223 reada_extent_put(fs_info, re); /* one ref for each entry */ in __readahead_hook()
225 reada_extent_put(fs_info, re); /* our ref */ in __readahead_hook()
[all …]
Dvolumes.c333 struct btrfs_fs_info *fs_info; in run_scheduled_bios() local
355 fs_info = device->dev_root->fs_info; in run_scheduled_bios()
356 limit = btrfs_async_submit_limit(fs_info); in run_scheduled_bios()
427 if (atomic_dec_return(&fs_info->nr_async_bios) < limit && in run_scheduled_bios()
428 waitqueue_active(&fs_info->async_submit_wait)) in run_scheduled_bios()
429 wake_up(&fs_info->async_submit_wait); in run_scheduled_bios()
461 fs_info->fs_devices->open_devices > 1) { in run_scheduled_bios()
494 btrfs_queue_work(fs_info->submit_workers, in run_scheduled_bios()
1174 struct btrfs_fs_info *fs_info = device->dev_root->fs_info; in contains_pending_extent() local
1176 struct list_head *search_list = &fs_info->pinned_chunks; in contains_pending_extent()
[all …]
Dqgroup.h44 struct btrfs_fs_info *fs_info);
46 struct btrfs_fs_info *fs_info);
47 int btrfs_qgroup_rescan(struct btrfs_fs_info *fs_info);
48 void btrfs_qgroup_rescan_resume(struct btrfs_fs_info *fs_info);
49 int btrfs_qgroup_wait_for_completion(struct btrfs_fs_info *fs_info,
52 struct btrfs_fs_info *fs_info, u64 src, u64 dst);
54 struct btrfs_fs_info *fs_info, u64 src, u64 dst);
56 struct btrfs_fs_info *fs_info, u64 qgroupid);
58 struct btrfs_fs_info *fs_info, u64 qgroupid);
60 struct btrfs_fs_info *fs_info, u64 qgroupid,
[all …]
Dsysfs.c38 static u64 get_features(struct btrfs_fs_info *fs_info, in get_features() argument
41 struct btrfs_super_block *disk_super = fs_info->super_copy; in get_features()
50 static void set_features(struct btrfs_fs_info *fs_info, in set_features() argument
53 struct btrfs_super_block *disk_super = fs_info->super_copy; in set_features()
97 struct btrfs_fs_info *fs_info = to_fs_info(kobj); in btrfs_feature_attr_show() local
99 if (fs_info) { in btrfs_feature_attr_show()
100 u64 features = get_features(fs_info, fa->feature_set); in btrfs_feature_attr_show()
113 struct btrfs_fs_info *fs_info; in btrfs_feature_attr_store() local
119 fs_info = to_fs_info(kobj); in btrfs_feature_attr_store()
120 if (!fs_info) in btrfs_feature_attr_store()
[all …]
Dscrub.c250 static void scrub_recheck_block(struct btrfs_fs_info *fs_info,
280 static void scrub_remap_extent(struct btrfs_fs_info *fs_info,
287 struct btrfs_fs_info *fs_info,
303 static void __scrub_blocked_if_needed(struct btrfs_fs_info *fs_info);
304 static void scrub_blocked_if_needed(struct btrfs_fs_info *fs_info);
321 static void __scrub_blocked_if_needed(struct btrfs_fs_info *fs_info) in __scrub_blocked_if_needed() argument
323 while (atomic_read(&fs_info->scrub_pause_req)) { in __scrub_blocked_if_needed()
324 mutex_unlock(&fs_info->scrub_lock); in __scrub_blocked_if_needed()
325 wait_event(fs_info->scrub_pause_wait, in __scrub_blocked_if_needed()
326 atomic_read(&fs_info->scrub_pause_req) == 0); in __scrub_blocked_if_needed()
[all …]
Dextent-tree.c232 set_extent_bits(&root->fs_info->freed_extents[0], in add_excluded_extent()
234 set_extent_bits(&root->fs_info->freed_extents[1], in add_excluded_extent()
247 clear_extent_bits(&root->fs_info->freed_extents[0], in free_excluded_extents()
249 clear_extent_bits(&root->fs_info->freed_extents[1], in free_excluded_extents()
272 ret = btrfs_rmap_block(&root->fs_info->mapping_tree, in exclude_super_stripes()
401 struct btrfs_fs_info *fs_info; in caching_thread() local
415 fs_info = block_group->fs_info; in caching_thread()
416 extent_root = fs_info->extent_root; in caching_thread()
449 down_read(&fs_info->commit_root_sem); in caching_thread()
460 if (btrfs_fs_closing(fs_info) > 1) { in caching_thread()
[all …]
Dvolumes.h264 struct btrfs_fs_info *fs_info; member
311 struct btrfs_fs_info *fs_info; member
415 struct btrfs_fs_info *fs_info; member
430 int btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
433 int btrfs_map_sblock(struct btrfs_fs_info *fs_info, int rw,
457 struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info,
462 int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len);
465 struct btrfs_device *btrfs_find_device(struct btrfs_fs_info *fs_info, u64 devid,
474 int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info);
475 int btrfs_recover_balance(struct btrfs_fs_info *fs_info);
[all …]
Ddisk-io.h55 struct btrfs_fs_info *fs_info, struct extent_buffer *buf);
66 struct extent_buffer *btrfs_find_tree_block(struct btrfs_fs_info *fs_info,
71 struct btrfs_root *btrfs_lookup_fs_root(struct btrfs_fs_info *fs_info,
73 int btrfs_insert_fs_root(struct btrfs_fs_info *fs_info,
75 void btrfs_free_fs_roots(struct btrfs_fs_info *fs_info);
77 struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info,
81 btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info, in btrfs_read_fs_root_no_name() argument
84 return btrfs_get_fs_root(fs_info, location, true); in btrfs_read_fs_root_no_name()
87 int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info);
90 void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info,
[all …]
Dctree.h1318 struct btrfs_fs_info *fs_info; member
1862 struct btrfs_fs_info *fs_info; member
2195 #define btrfs_test_opt(root, opt) ((root)->fs_info->mount_opt & \
2201 btrfs_info(root->fs_info, fmt, ##args); \
2202 btrfs_set_opt(root->fs_info->mount_opt, opt); \
2208 btrfs_info(root->fs_info, fmt, ##args); \
2209 btrfs_clear_opt(root->fs_info->mount_opt, opt); \
3508 struct btrfs_fs_info *fs_info,
3513 void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info);
3571 int btrfs_cond_migrate_bytes(struct btrfs_fs_info *fs_info,
[all …]
Dioctl.c327 if (root->fs_info->compress_type == BTRFS_COMPRESS_LZO) in btrfs_ioctl_setflags()
376 struct btrfs_fs_info *fs_info = btrfs_sb(file_inode(file)->i_sb); in btrfs_ioctl_fitrim() local
388 list_for_each_entry_rcu(device, &fs_info->fs_devices->devices, in btrfs_ioctl_fitrim()
411 if (range.len < fs_info->sb->s_blocksize) in btrfs_ioctl_fitrim()
415 ret = btrfs_trim_fs(fs_info->tree_root, &range); in btrfs_ioctl_fitrim()
460 ret = btrfs_find_free_objectid(root->fs_info->tree_root, &objectid); in create_subvol()
491 ret = btrfs_qgroup_inherit(trans, root->fs_info, 0, objectid, inherit); in create_subvol()
507 write_extent_buffer(leaf, root->fs_info->fsid, btrfs_header_fsid(), in create_subvol()
509 write_extent_buffer(leaf, root->fs_info->chunk_tree_uuid, in create_subvol()
553 ret = btrfs_insert_root(trans, root->fs_info->tree_root, &key, in create_subvol()
[all …]
Ddev-replace.h24 int btrfs_init_dev_replace(struct btrfs_fs_info *fs_info);
26 struct btrfs_fs_info *fs_info);
27 void btrfs_after_dev_replace_commit(struct btrfs_fs_info *fs_info);
30 void btrfs_dev_replace_status(struct btrfs_fs_info *fs_info,
32 int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info,
34 void btrfs_dev_replace_suspend_for_unmount(struct btrfs_fs_info *fs_info);
35 int btrfs_resume_dev_replace_async(struct btrfs_fs_info *fs_info);
Dctree.c42 static int tree_mod_log_free_eb(struct btrfs_fs_info *fs_info,
220 spin_lock(&root->fs_info->trans_lock); in add_root_to_dirty_list()
225 &root->fs_info->dirty_cowonly_roots); in add_root_to_dirty_list()
228 &root->fs_info->dirty_cowonly_roots); in add_root_to_dirty_list()
230 spin_unlock(&root->fs_info->trans_lock); in add_root_to_dirty_list()
249 trans->transid != root->fs_info->running_transaction->transid); in btrfs_copy_root()
275 write_extent_buffer(cow, root->fs_info->fsid, btrfs_header_fsid(), in btrfs_copy_root()
338 static inline u64 btrfs_inc_tree_mod_seq(struct btrfs_fs_info *fs_info) in btrfs_inc_tree_mod_seq() argument
340 return atomic64_inc_return(&fs_info->tree_mod_seq); in btrfs_inc_tree_mod_seq()
351 u64 btrfs_get_tree_mod_seq(struct btrfs_fs_info *fs_info, in btrfs_get_tree_mod_seq() argument
[all …]
Dbackref.c338 static int __resolve_indirect_ref(struct btrfs_fs_info *fs_info, in __resolve_indirect_ref() argument
356 index = srcu_read_lock(&fs_info->subvol_srcu); in __resolve_indirect_ref()
358 root = btrfs_get_fs_root(fs_info, &root_key, false); in __resolve_indirect_ref()
360 srcu_read_unlock(&fs_info->subvol_srcu, index); in __resolve_indirect_ref()
366 srcu_read_unlock(&fs_info->subvol_srcu, index); in __resolve_indirect_ref()
379 srcu_read_unlock(&fs_info->subvol_srcu, index); in __resolve_indirect_ref()
392 srcu_read_unlock(&fs_info->subvol_srcu, index); in __resolve_indirect_ref()
423 static int __resolve_indirect_refs(struct btrfs_fs_info *fs_info, in __resolve_indirect_refs() argument
456 err = __resolve_indirect_ref(fs_info, path, time_seq, ref, in __resolve_indirect_refs()
520 static int __add_missing_keys(struct btrfs_fs_info *fs_info, in __add_missing_keys() argument
[all …]
Ddelayed-ref.c266 struct btrfs_fs_info *fs_info, in btrfs_merge_delayed_refs() argument
282 read_lock(&fs_info->tree_mod_log_lock); in btrfs_merge_delayed_refs()
283 if (!list_empty(&fs_info->tree_mod_seq_list)) { in btrfs_merge_delayed_refs()
286 elem = list_first_entry(&fs_info->tree_mod_seq_list, in btrfs_merge_delayed_refs()
290 read_unlock(&fs_info->tree_mod_log_lock); in btrfs_merge_delayed_refs()
311 int btrfs_check_delayed_seq(struct btrfs_fs_info *fs_info, in btrfs_check_delayed_seq() argument
318 read_lock(&fs_info->tree_mod_log_lock); in btrfs_check_delayed_seq()
319 if (!list_empty(&fs_info->tree_mod_seq_list)) { in btrfs_check_delayed_seq()
320 elem = list_first_entry(&fs_info->tree_mod_seq_list, in btrfs_check_delayed_seq()
331 read_unlock(&fs_info->tree_mod_log_lock); in btrfs_check_delayed_seq()
[all …]
Dtree-checker.c37 btrfs_crit(root->fs_info, \
75 btrfs_crit(root->fs_info, in generic_err()
163 u32 csumsize = btrfs_super_csum_size(root->fs_info->super_copy); in check_csum_item()
199 btrfs_crit(root->fs_info, in dir_item_err()
318 static void block_group_err(const struct btrfs_fs_info *fs_info, in block_group_err() argument
332 btrfs_crit(fs_info, in block_group_err()
340 static int check_block_group_item(struct btrfs_fs_info *fs_info, in check_block_group_item() argument
355 block_group_err(fs_info, leaf, slot, in check_block_group_item()
362 block_group_err(fs_info, leaf, slot, in check_block_group_item()
372 block_group_err(fs_info, leaf, slot, in check_block_group_item()
[all …]
Dinode-map.c32 struct btrfs_fs_info *fs_info = root->fs_info; in caching_kthread() local
58 down_read(&fs_info->commit_root_sem); in caching_kthread()
65 if (btrfs_fs_closing(fs_info)) in caching_kthread()
78 btrfs_transaction_in_commit(fs_info)) { in caching_kthread()
91 up_read(&fs_info->commit_root_sem); in caching_kthread()
130 up_read(&fs_info->commit_root_sem); in caching_kthread()
156 ret = load_free_ino_cache(root->fs_info, root); in start_caching()
181 btrfs_warn(root->fs_info, "failed to start inode caching task"); in start_caching()
182 btrfs_clear_pending_and_info(root->fs_info, INODE_MAP_CACHE, in start_caching()
221 down_write(&root->fs_info->commit_root_sem); in btrfs_return_ino()
[all …]
Dtree-log.h45 static inline void btrfs_set_log_full_commit(struct btrfs_fs_info *fs_info, in btrfs_set_log_full_commit() argument
48 ACCESS_ONCE(fs_info->last_trans_log_full_commit) = trans->transid; in btrfs_set_log_full_commit()
51 static inline int btrfs_need_log_full_commit(struct btrfs_fs_info *fs_info, in btrfs_need_log_full_commit() argument
54 return ACCESS_ONCE(fs_info->last_trans_log_full_commit) == in btrfs_need_log_full_commit()
62 struct btrfs_fs_info *fs_info);
Dordered-data.c68 struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); in ordered_data_tree_panic() local
69 btrfs_panic(fs_info, errno, "Inconsistency in ordered tree at offset " in ordered_data_tree_panic()
236 spin_lock(&root->fs_info->ordered_root_lock); in __btrfs_add_ordered_extent()
239 &root->fs_info->ordered_roots); in __btrfs_add_ordered_extent()
240 spin_unlock(&root->fs_info->ordered_root_lock); in __btrfs_add_ordered_extent()
333 btrfs_crit(BTRFS_I(inode)->root->fs_info, in btrfs_dec_test_first_ordered_pending()
338 btrfs_crit(BTRFS_I(inode)->root->fs_info, in btrfs_dec_test_first_ordered_pending()
405 btrfs_crit(BTRFS_I(inode)->root->fs_info, in btrfs_dec_test_ordered_pending()
620 spin_lock(&root->fs_info->trans_lock); in btrfs_remove_ordered_extent()
621 trans = root->fs_info->running_transaction; in btrfs_remove_ordered_extent()
[all …]
/fs/btrfs/tests/
Dbtrfs-tests.c87 struct btrfs_fs_info *fs_info = kzalloc(sizeof(struct btrfs_fs_info), in btrfs_alloc_dummy_fs_info() local
90 if (!fs_info) in btrfs_alloc_dummy_fs_info()
91 return fs_info; in btrfs_alloc_dummy_fs_info()
92 fs_info->fs_devices = kzalloc(sizeof(struct btrfs_fs_devices), in btrfs_alloc_dummy_fs_info()
94 if (!fs_info->fs_devices) { in btrfs_alloc_dummy_fs_info()
95 kfree(fs_info); in btrfs_alloc_dummy_fs_info()
98 fs_info->super_copy = kzalloc(sizeof(struct btrfs_super_block), in btrfs_alloc_dummy_fs_info()
100 if (!fs_info->super_copy) { in btrfs_alloc_dummy_fs_info()
101 kfree(fs_info->fs_devices); in btrfs_alloc_dummy_fs_info()
102 kfree(fs_info); in btrfs_alloc_dummy_fs_info()
[all …]
Dqgroup-tests.c230 struct btrfs_fs_info *fs_info = root->fs_info; in test_no_shared_qgroup() local
238 ret = btrfs_create_qgroup(NULL, fs_info, 5); in test_no_shared_qgroup()
249 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &old_roots); in test_no_shared_qgroup()
260 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &new_roots); in test_no_shared_qgroup()
268 ret = btrfs_qgroup_account_extent(&trans, fs_info, 4096, 4096, in test_no_shared_qgroup()
275 if (btrfs_verify_qgroup_counts(fs_info, 5, 4096, 4096)) { in test_no_shared_qgroup()
282 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &old_roots); in test_no_shared_qgroup()
293 ret = btrfs_find_all_roots(&trans, fs_info, 4096, 0, &new_roots); in test_no_shared_qgroup()
301 ret = btrfs_qgroup_account_extent(&trans, fs_info, 4096, 4096, in test_no_shared_qgroup()
308 if (btrfs_verify_qgroup_counts(fs_info, 5, 0, 0)) { in test_no_shared_qgroup()
[all …]

123