aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2010-01-15 01:27:59 -0500
committerTheodore Ts'o <tytso@mit.edu>2010-01-15 01:27:59 -0500
commit1296cc85c26e94eb865d03f82140f27d598de467 (patch)
treeb8a2bc06ecd992a86179ebcd9c087994c676c291
parent5f634d064c709ea02c3cdaa850a08323a4a4bf28 (diff)
ext4: Drop EXT4_GET_BLOCKS_UPDATE_RESERVE_SPACE flag
We should update reserve space if it is delalloc buffer and that is indicated by EXT4_GET_BLOCKS_DELALLOC_RESERVE flag. So use EXT4_GET_BLOCKS_DELALLOC_RESERVE in place of EXT4_GET_BLOCKS_UPDATE_RESERVE_SPACE Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
-rw-r--r--fs/ext4/ext4.h7
-rw-r--r--fs/ext4/extents.c4
-rw-r--r--fs/ext4/inode.c8
3 files changed, 8 insertions, 11 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index b98de17e542a..874d169a193e 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -361,14 +361,11 @@ struct ext4_new_group_data {
361 so set the magic i_delalloc_reserve_flag after taking the 361 so set the magic i_delalloc_reserve_flag after taking the
362 inode allocation semaphore for */ 362 inode allocation semaphore for */
363#define EXT4_GET_BLOCKS_DELALLOC_RESERVE 0x0004 363#define EXT4_GET_BLOCKS_DELALLOC_RESERVE 0x0004
364 /* Call ext4_da_update_reserve_space() after successfully
365 allocating the blocks */
366#define EXT4_GET_BLOCKS_UPDATE_RESERVE_SPACE 0x0008
367 /* caller is from the direct IO path, request to creation of an 364 /* caller is from the direct IO path, request to creation of an
368 unitialized extents if not allocated, split the uninitialized 365 unitialized extents if not allocated, split the uninitialized
369 extent if blocks has been preallocated already*/ 366 extent if blocks has been preallocated already*/
370#define EXT4_GET_BLOCKS_DIO 0x0010 367#define EXT4_GET_BLOCKS_DIO 0x0008
371#define EXT4_GET_BLOCKS_CONVERT 0x0020 368#define EXT4_GET_BLOCKS_CONVERT 0x0010
372#define EXT4_GET_BLOCKS_DIO_CREATE_EXT (EXT4_GET_BLOCKS_DIO|\ 369#define EXT4_GET_BLOCKS_DIO_CREATE_EXT (EXT4_GET_BLOCKS_DIO|\
373 EXT4_GET_BLOCKS_CREATE_UNINIT_EXT) 370 EXT4_GET_BLOCKS_CREATE_UNINIT_EXT)
374 /* Convert extent to initialized after direct IO complete */ 371 /* Convert extent to initialized after direct IO complete */
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 3b6ff72026f0..765a4826b118 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3142,7 +3142,7 @@ out:
3142 * But fallocate would have already updated quota and block 3142 * But fallocate would have already updated quota and block
3143 * count for this offset. So cancel these reservation 3143 * count for this offset. So cancel these reservation
3144 */ 3144 */
3145 if (flags & EXT4_GET_BLOCKS_UPDATE_RESERVE_SPACE) 3145 if (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE)
3146 ext4_da_update_reserve_space(inode, allocated, 0); 3146 ext4_da_update_reserve_space(inode, allocated, 0);
3147 3147
3148map_out: 3148map_out:
@@ -3388,7 +3388,7 @@ int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
3388 * Update reserved blocks/metadata blocks after successful 3388 * Update reserved blocks/metadata blocks after successful
3389 * block allocation which had been deferred till now. 3389 * block allocation which had been deferred till now.
3390 */ 3390 */
3391 if (flags & EXT4_GET_BLOCKS_UPDATE_RESERVE_SPACE) 3391 if (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE)
3392 ext4_da_update_reserve_space(inode, allocated, 1); 3392 ext4_da_update_reserve_space(inode, allocated, 1);
3393 3393
3394 /* 3394 /*
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index c955f6490b78..e11952404e02 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1316,7 +1316,7 @@ int ext4_get_blocks(handle_t *handle, struct inode *inode, sector_t block,
1316 * reserve space here. 1316 * reserve space here.
1317 */ 1317 */
1318 if ((retval > 0) && 1318 if ((retval > 0) &&
1319 (flags & EXT4_GET_BLOCKS_UPDATE_RESERVE_SPACE)) 1319 (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE))
1320 ext4_da_update_reserve_space(inode, retval, 1); 1320 ext4_da_update_reserve_space(inode, retval, 1);
1321 } 1321 }
1322 if (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE) 1322 if (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE)
@@ -2219,10 +2219,10 @@ static int mpage_da_map_blocks(struct mpage_da_data *mpd)
2219 * variables are updated after the blocks have been allocated. 2219 * variables are updated after the blocks have been allocated.
2220 */ 2220 */
2221 new.b_state = 0; 2221 new.b_state = 0;
2222 get_blocks_flags = (EXT4_GET_BLOCKS_CREATE | 2222 get_blocks_flags = EXT4_GET_BLOCKS_CREATE;
2223 EXT4_GET_BLOCKS_DELALLOC_RESERVE);
2224 if (mpd->b_state & (1 << BH_Delay)) 2223 if (mpd->b_state & (1 << BH_Delay))
2225 get_blocks_flags |= EXT4_GET_BLOCKS_UPDATE_RESERVE_SPACE; 2224 get_blocks_flags |= EXT4_GET_BLOCKS_DELALLOC_RESERVE;
2225
2226 blks = ext4_get_blocks(handle, mpd->inode, next, max_blocks, 2226 blks = ext4_get_blocks(handle, mpd->inode, next, max_blocks,
2227 &new, get_blocks_flags); 2227 &new, get_blocks_flags);
2228 if (blks < 0) { 2228 if (blks < 0) {