mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
btrfs: convert pr_* to btrfs_* where possible
For many printks, we want to know which file system issued the message. This patch converts most pr_* calls to use the btrfs_* versions instead. In some cases, this means adding plumbing to allow call sites access to an fs_info pointer. fs/btrfs/check-integrity.c is left alone for another day. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
62e855771d
commit
ab8d0fc48d
20 changed files with 231 additions and 177 deletions
|
@ -104,7 +104,7 @@ again:
|
|||
break;
|
||||
|
||||
if (last != (u64)-1 && last + 1 != key.objectid) {
|
||||
__btrfs_add_free_space(ctl, last + 1,
|
||||
__btrfs_add_free_space(fs_info, ctl, last + 1,
|
||||
key.objectid - last - 1);
|
||||
wake_up(&root->ino_cache_wait);
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ next:
|
|||
}
|
||||
|
||||
if (last < root->highest_objectid - 1) {
|
||||
__btrfs_add_free_space(ctl, last + 1,
|
||||
__btrfs_add_free_space(fs_info, ctl, last + 1,
|
||||
root->highest_objectid - last - 1);
|
||||
}
|
||||
|
||||
|
@ -136,12 +136,13 @@ out:
|
|||
|
||||
static void start_caching(struct btrfs_root *root)
|
||||
{
|
||||
struct btrfs_fs_info *fs_info = root->fs_info;
|
||||
struct btrfs_free_space_ctl *ctl = root->free_ino_ctl;
|
||||
struct task_struct *tsk;
|
||||
int ret;
|
||||
u64 objectid;
|
||||
|
||||
if (!btrfs_test_opt(root->fs_info, INODE_MAP_CACHE))
|
||||
if (!btrfs_test_opt(fs_info, INODE_MAP_CACHE))
|
||||
return;
|
||||
|
||||
spin_lock(&root->ino_cache_lock);
|
||||
|
@ -153,7 +154,7 @@ static void start_caching(struct btrfs_root *root)
|
|||
root->ino_cache_state = BTRFS_CACHE_STARTED;
|
||||
spin_unlock(&root->ino_cache_lock);
|
||||
|
||||
ret = load_free_ino_cache(root->fs_info, root);
|
||||
ret = load_free_ino_cache(fs_info, root);
|
||||
if (ret == 1) {
|
||||
spin_lock(&root->ino_cache_lock);
|
||||
root->ino_cache_state = BTRFS_CACHE_FINISHED;
|
||||
|
@ -170,15 +171,15 @@ static void start_caching(struct btrfs_root *root)
|
|||
*/
|
||||
ret = btrfs_find_free_objectid(root, &objectid);
|
||||
if (!ret && objectid <= BTRFS_LAST_FREE_OBJECTID) {
|
||||
__btrfs_add_free_space(ctl, objectid,
|
||||
__btrfs_add_free_space(fs_info, ctl, objectid,
|
||||
BTRFS_LAST_FREE_OBJECTID - objectid + 1);
|
||||
}
|
||||
|
||||
tsk = kthread_run(caching_kthread, root, "btrfs-ino-cache-%llu",
|
||||
root->root_key.objectid);
|
||||
if (IS_ERR(tsk)) {
|
||||
btrfs_warn(root->fs_info, "failed to start inode caching task");
|
||||
btrfs_clear_pending_and_info(root->fs_info, INODE_MAP_CACHE,
|
||||
btrfs_warn(fs_info, "failed to start inode caching task");
|
||||
btrfs_clear_pending_and_info(fs_info, INODE_MAP_CACHE,
|
||||
"disabling inode map caching");
|
||||
}
|
||||
}
|
||||
|
@ -209,28 +210,29 @@ again:
|
|||
|
||||
void btrfs_return_ino(struct btrfs_root *root, u64 objectid)
|
||||
{
|
||||
struct btrfs_fs_info *fs_info = root->fs_info;
|
||||
struct btrfs_free_space_ctl *pinned = root->free_ino_pinned;
|
||||
|
||||
if (!btrfs_test_opt(root->fs_info, INODE_MAP_CACHE))
|
||||
if (!btrfs_test_opt(fs_info, INODE_MAP_CACHE))
|
||||
return;
|
||||
again:
|
||||
if (root->ino_cache_state == BTRFS_CACHE_FINISHED) {
|
||||
__btrfs_add_free_space(pinned, objectid, 1);
|
||||
__btrfs_add_free_space(fs_info, pinned, objectid, 1);
|
||||
} else {
|
||||
down_write(&root->fs_info->commit_root_sem);
|
||||
down_write(&fs_info->commit_root_sem);
|
||||
spin_lock(&root->ino_cache_lock);
|
||||
if (root->ino_cache_state == BTRFS_CACHE_FINISHED) {
|
||||
spin_unlock(&root->ino_cache_lock);
|
||||
up_write(&root->fs_info->commit_root_sem);
|
||||
up_write(&fs_info->commit_root_sem);
|
||||
goto again;
|
||||
}
|
||||
spin_unlock(&root->ino_cache_lock);
|
||||
|
||||
start_caching(root);
|
||||
|
||||
__btrfs_add_free_space(pinned, objectid, 1);
|
||||
__btrfs_add_free_space(fs_info, pinned, objectid, 1);
|
||||
|
||||
up_write(&root->fs_info->commit_root_sem);
|
||||
up_write(&fs_info->commit_root_sem);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -277,7 +279,8 @@ void btrfs_unpin_free_ino(struct btrfs_root *root)
|
|||
rb_erase(&info->offset_index, rbroot);
|
||||
spin_unlock(rbroot_lock);
|
||||
if (add_to_ctl)
|
||||
__btrfs_add_free_space(ctl, info->offset, count);
|
||||
__btrfs_add_free_space(root->fs_info, ctl,
|
||||
info->offset, count);
|
||||
kmem_cache_free(btrfs_free_space_cachep, info);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue