extent-tree.c (75eff68ea6959efd999b125fc3dcf73931a3b30b) extent-tree.c (dcbdd4dcb9793b00b46ab023e9330922c8c7c54c)
1/*
2 * Copyright (C) 2007 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,

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

2472 /* block accounting for root item */
2473 root_used = btrfs_root_used(&root->root_item);
2474 btrfs_set_root_used(&root->root_item,
2475 root_used - num_bytes);
2476 ret = btrfs_del_items(trans, extent_root, path, path->slots[0],
2477 num_to_del);
2478 BUG_ON(ret);
2479 btrfs_release_path(extent_root, path);
1/*
2 * Copyright (C) 2007 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,

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

2472 /* block accounting for root item */
2473 root_used = btrfs_root_used(&root->root_item);
2474 btrfs_set_root_used(&root->root_item,
2475 root_used - num_bytes);
2476 ret = btrfs_del_items(trans, extent_root, path, path->slots[0],
2477 num_to_del);
2478 BUG_ON(ret);
2479 btrfs_release_path(extent_root, path);
2480 ret = update_block_group(trans, root, bytenr, num_bytes, 0,
2481 mark_free);
2482 BUG_ON(ret);
2483
2484 if (owner_objectid >= BTRFS_FIRST_FREE_OBJECTID) {
2485 ret = btrfs_del_csums(trans, root, bytenr, num_bytes);
2486 BUG_ON(ret);
2487 }
2488
2480
2481 if (owner_objectid >= BTRFS_FIRST_FREE_OBJECTID) {
2482 ret = btrfs_del_csums(trans, root, bytenr, num_bytes);
2483 BUG_ON(ret);
2484 }
2485
2486 ret = update_block_group(trans, root, bytenr, num_bytes, 0,
2487 mark_free);
2488 BUG_ON(ret);
2489#ifdef BIO_RW_DISCARD
2490 /* Tell the block device(s) that the sectors can be discarded */
2491 ret = btrfs_map_block(&root->fs_info->mapping_tree, READ,
2492 bytenr, &map_length, &multi, 0);
2493 if (!ret) {
2494 struct btrfs_bio_stripe *stripe = multi->stripes;
2495 int i;
2496

--- 3477 unchanged lines hidden ---
2489#ifdef BIO_RW_DISCARD
2490 /* Tell the block device(s) that the sectors can be discarded */
2491 ret = btrfs_map_block(&root->fs_info->mapping_tree, READ,
2492 bytenr, &map_length, &multi, 0);
2493 if (!ret) {
2494 struct btrfs_bio_stripe *stripe = multi->stripes;
2495 int i;
2496

--- 3477 unchanged lines hidden ---