relocation.c (b6c60c8018c4e9beb2f83fc82c09f9d033766571) relocation.c (c1c9ff7c94e83fae89a742df74db51156869bad5)
1/*
2 * Copyright (C) 2009 Oracle. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 321 unchanged lines hidden (view full) ---

330{
331
332 struct btrfs_fs_info *fs_info = NULL;
333 struct backref_node *bnode = rb_entry(rb_node, struct backref_node,
334 rb_node);
335 if (bnode->root)
336 fs_info = bnode->root->fs_info;
337 btrfs_panic(fs_info, errno, "Inconsistency in backref cache "
1/*
2 * Copyright (C) 2009 Oracle. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public
6 * License v2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,

--- 321 unchanged lines hidden (view full) ---

330{
331
332 struct btrfs_fs_info *fs_info = NULL;
333 struct backref_node *bnode = rb_entry(rb_node, struct backref_node,
334 rb_node);
335 if (bnode->root)
336 fs_info = bnode->root->fs_info;
337 btrfs_panic(fs_info, errno, "Inconsistency in backref cache "
338 "found at offset %llu\n", (unsigned long long)bytenr);
338 "found at offset %llu\n", bytenr);
339}
340
341/*
342 * walk up backref nodes until reach node presents tree root
343 */
344static struct backref_node *walk_up_backref(struct backref_node *node,
345 struct backref_edge *edges[],
346 int *index)

--- 3882 unchanged lines hidden (view full) ---

4229 rc->data_inode = create_reloc_inode(fs_info, rc->block_group);
4230 if (IS_ERR(rc->data_inode)) {
4231 err = PTR_ERR(rc->data_inode);
4232 rc->data_inode = NULL;
4233 goto out;
4234 }
4235
4236 printk(KERN_INFO "btrfs: relocating block group %llu flags %llu\n",
339}
340
341/*
342 * walk up backref nodes until reach node presents tree root
343 */
344static struct backref_node *walk_up_backref(struct backref_node *node,
345 struct backref_edge *edges[],
346 int *index)

--- 3882 unchanged lines hidden (view full) ---

4229 rc->data_inode = create_reloc_inode(fs_info, rc->block_group);
4230 if (IS_ERR(rc->data_inode)) {
4231 err = PTR_ERR(rc->data_inode);
4232 rc->data_inode = NULL;
4233 goto out;
4234 }
4235
4236 printk(KERN_INFO "btrfs: relocating block group %llu flags %llu\n",
4237 (unsigned long long)rc->block_group->key.objectid,
4238 (unsigned long long)rc->block_group->flags);
4237 rc->block_group->key.objectid, rc->block_group->flags);
4239
4240 ret = btrfs_start_all_delalloc_inodes(fs_info, 0);
4241 if (ret < 0) {
4242 err = ret;
4243 goto out;
4244 }
4245 btrfs_wait_all_ordered_extents(fs_info, 0);
4246

--- 5 unchanged lines hidden (view full) ---

4252 err = ret;
4253 goto out;
4254 }
4255
4256 if (rc->extents_found == 0)
4257 break;
4258
4259 printk(KERN_INFO "btrfs: found %llu extents\n",
4238
4239 ret = btrfs_start_all_delalloc_inodes(fs_info, 0);
4240 if (ret < 0) {
4241 err = ret;
4242 goto out;
4243 }
4244 btrfs_wait_all_ordered_extents(fs_info, 0);
4245

--- 5 unchanged lines hidden (view full) ---

4251 err = ret;
4252 goto out;
4253 }
4254
4255 if (rc->extents_found == 0)
4256 break;
4257
4258 printk(KERN_INFO "btrfs: found %llu extents\n",
4260 (unsigned long long)rc->extents_found);
4259 rc->extents_found);
4261
4262 if (rc->stage == MOVE_DATA_EXTENTS && rc->found_file_extent) {
4263 btrfs_wait_ordered_range(rc->data_inode, 0, (u64)-1);
4264 invalidate_mapping_pages(rc->data_inode->i_mapping,
4265 0, -1);
4266 rc->stage = UPDATE_DATA_PTRS;
4267 }
4268 }

--- 366 unchanged lines hidden ---
4260
4261 if (rc->stage == MOVE_DATA_EXTENTS && rc->found_file_extent) {
4262 btrfs_wait_ordered_range(rc->data_inode, 0, (u64)-1);
4263 invalidate_mapping_pages(rc->data_inode->i_mapping,
4264 0, -1);
4265 rc->stage = UPDATE_DATA_PTRS;
4266 }
4267 }

--- 366 unchanged lines hidden ---