search for: btrfs_check_data_free_spac

Displaying 9 results from an estimated 9 matches for "btrfs_check_data_free_spac".

2009 Nov 02
0
[PATCH 7/8] Make fallocate(2) more ENOSPC friendly
...inode)->root->sectorsize - 1; struct extent_map *em; - struct btrfs_trans_handle *trans; - struct btrfs_root *root; int ret; alloc_start = offset & ~mask; @@ -5661,9 +5723,7 @@ static long btrfs_fallocate(struct inode goto out; } - root = BTRFS_I(inode)->root; - - ret = btrfs_check_data_free_space(root, inode, + ret = btrfs_check_data_free_space(BTRFS_I(inode)->root, inode, alloc_end - alloc_start); if (ret) goto out; @@ -5672,12 +5732,6 @@ static long btrfs_fallocate(struct inode while (1) { struct btrfs_ordered_extent *ordered; - trans = btrfs_start_transaction(BTR...
2012 Jan 22
0
Compiler warnings: cast from pointer to integer of different size
I encounter the following compiler warnings while compiling kernel 3.3.0-rc1+ ... CC fs/btrfs/super.o CC fs/btrfs/ctree.o CC fs/btrfs/extent-tree.o fs/btrfs/extent-tree.c: In function ‘btrfs_check_data_free_space’: fs/btrfs/extent-tree.c:3314:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] fs/btrfs/extent-tree.c: In function ‘btrfs_free_reserved_data_space’: fs/btrfs/extent-tree.c:3335:11: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] fs...
2010 Apr 26
0
[PATCH V2 11/12] Btrfs: Pre-allocate space for data relocation
...de *inode, + struct file_extent_cluster *cluster) +{ + u64 alloc_hint = 0; + u64 start; + u64 end; + u64 offset = BTRFS_I(inode)->index_cnt; + u64 num_bytes; + int nr = 0; + int ret = 0; + + BUG_ON(cluster->start != cluster->boundary[0]); + mutex_lock(&inode->i_mutex); + + ret = btrfs_check_data_free_space(inode, cluster->end + + 1 - cluster->start); + if (ret) + goto out; + + while (nr < cluster->nr) { + start = cluster->boundary[nr] - offset; + if (nr + 1 < cluster->nr) + end = cluster->boundary[nr + 1] - 1 - offset; + else + end = cluster->end - offset; +...
2009 Aug 24
0
[PATCH] Btrfs: proper metadata -ENOSPC handling
...btrfs_root *root, u64 flags); void btrfs_set_inode_space_info(struct btrfs_root *root, struct inode *ionde); void btrfs_clear_space_info_full(struct btrfs_fs_info *info); -int btrfs_check_metadata_free_space(struct btrfs_root *root); +u64 btrfs_metadata_free_space(struct btrfs_root *root); int btrfs_check_data_free_space(struct btrfs_root *root, struct inode *inode, u64 bytes); void btrfs_free_reserved_data_space(struct btrfs_root *root, diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index fafd6f2..dbd2f13 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1456,7 +1456,6 @@ static int cleaner...
2011 Jul 26
0
[PATCH] Btrfs: use bytes_may_use for all ENOSPC reservations
...m_pages); + else + btrfs_free_reserved_data_space(inode, num_pages); out_put: iput(inode); out_free: @@ -3119,9 +3137,7 @@ commit_trans: } /* - * called when we are clearing an delalloc extent from the - * inode''s io_tree or there was an error for whatever reason - * after calling btrfs_check_data_free_space + * Called if we need to clear a data reservation for this inode. */ void btrfs_free_reserved_data_space(struct inode *inode, u64 bytes) { @@ -3154,6 +3170,7 @@ static int should_alloc_chunk(struct btrfs_root *root, struct btrfs_space_info *sinfo, u64 alloc_bytes, int force...
2011 Jul 27
0
[PATCH] Btrfs: use bytes_may_use for all ENOSPC reservations V2
...m_pages); + else + btrfs_free_reserved_data_space(inode, num_pages); out_put: iput(inode); out_free: @@ -3119,9 +3137,7 @@ commit_trans: } /* - * called when we are clearing an delalloc extent from the - * inode''s io_tree or there was an error for whatever reason - * after calling btrfs_check_data_free_space + * Called if we need to clear a data reservation for this inode. */ void btrfs_free_reserved_data_space(struct inode *inode, u64 bytes) { @@ -3154,6 +3170,7 @@ static int should_alloc_chunk(struct btrfs_root *root, struct btrfs_space_info *sinfo, u64 alloc_bytes, int force...
2010 Apr 19
0
[PATCH 08/12] Btrfs: Introduce global metadata reservation
...(root->fs_info->cleaner_kthread); + fs_info->closing = 2; smp_mb(); diff -urp 8/fs/btrfs/extent-tree.c 9/fs/btrfs/extent-tree.c --- 8/fs/btrfs/extent-tree.c 2010-04-18 11:28:09.532699748 +0800 +++ 9/fs/btrfs/extent-tree.c 2010-04-18 10:30:30.926698723 +0800 @@ -2787,10 +2787,9 @@ int btrfs_check_data_free_space(struct i again: /* make sure we have enough space to handle the data first */ spin_lock(&data_sinfo->lock); - used = data_sinfo->bytes_used + data_sinfo->bytes_delalloc + - data_sinfo->bytes_reserved + data_sinfo->bytes_pinned + - data_sinfo->bytes_readonly + data_sinf...
2010 May 07
6
[PATCH 1/5] fs: allow short direct-io reads to be completed via buffered IO V2
V1->V2: Check to see if our current ppos is >= i_size after a short DIO read, just in case it was actually a short read and we need to just return. This is similar to what already happens in the write case. If we have a short read while doing O_DIRECT, instead of just returning, fallthrough and try to read the rest via buffered IO. BTRFS needs this because if we encounter a compressed or
2012 Dec 13
22
[PATCH] Btrfs: fix a deadlock on chunk mutex
An user reported that he has hit an annoying deadlock while playing with ceph based on btrfs. Current updating device tree requires space from METADATA chunk, so we -may- need to do a recursive chunk allocation when adding/updating dev extent, that is where the deadlock comes from. If we use SYSTEM metadata to update device tree, we can avoid the recursive stuff. Reported-by: Jim Schutt