Btrfs: add a new "type" field into the block reservation structure
[linux-2.6-block.git] / fs / btrfs / delayed-inode.c
index 07d5eeb1e6f1df1f8ae2ddf94218b1f45298aeda..eb768c4c1358e73f208f8fae3af199dd136558c0 100644 (file)
@@ -650,7 +650,7 @@ static int btrfs_delayed_inode_reserve_metadata(
         * we're accounted for.
         */
        if (!src_rsv || (!trans->bytes_reserved &&
-           src_rsv != &root->fs_info->delalloc_block_rsv)) {
+                        src_rsv->type != BTRFS_BLOCK_RSV_DELALLOC)) {
                ret = btrfs_block_rsv_add_noflush(root, dst_rsv, num_bytes);
                /*
                 * Since we're under a transaction reserve_metadata_bytes could
@@ -668,7 +668,7 @@ static int btrfs_delayed_inode_reserve_metadata(
                                                      num_bytes, 1);
                }
                return ret;
-       } else if (src_rsv == &root->fs_info->delalloc_block_rsv) {
+       } else if (src_rsv->type == BTRFS_BLOCK_RSV_DELALLOC) {
                spin_lock(&BTRFS_I(inode)->lock);
                if (test_and_clear_bit(BTRFS_INODE_DELALLOC_META_RESERVED,
                                       &BTRFS_I(inode)->runtime_flags)) {