Re: [RFC] remove delalloc accounting for __btrfs_remove_ordered_extent

Josef Bacik
2010-02-24T15:45:12Z

> Signed-off-by: Shaohua Li <shaohua.li@intel.com>
> ---
> fs/btrfs/ordered-data.c | 6 ------
> 1 files changed, 0 insertions(+), 6 deletions(-)
>
> diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
> index 5c2a9e7..eb7a2f9 100644
> --- a/fs/btrfs/ordered-data.c
> +++ b/fs/btrfs/ordered-data.c
> @@ -306,12 +306,6 @@ static int __btrfs_remove_ordered_extent(struct inode *inode,
> tree->last = NULL;
> set_bit(BTRFS_ORDERED_COMPLETE, &entry->flags);
>
> - spin_lock(&BTRFS_I(inode)->accounting_lock);
> - BTRFS_I(inode)->outstanding_extents--;
> - spin_unlock(&BTRFS_I(inode)->accounting_lock);
> - btrfs_unreserve_metadata_for_delalloc(BTRFS_I(inode)->root,
> - inode, 1);
> -
> spin_lock(&BTRFS_I(inode)->root->fs_info->ordered_extent_lock);
> list_del_init(&entry->root_extent_list);
>

We don't want to remove the accounting until the data is actually on the disk,
thats why its done here. Thanks,

Josef