aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2014-09-04 18:08:22 -0400
committerTheodore Ts'o <tytso@mit.edu>2014-09-04 18:08:22 -0400
commit754cfed6bbcfdea6afb14f2686f7f8d71e94d4e2 (patch)
treeb55990b0fb6fbabde6dacb0c9d628e6531cbd8f0 /fs
parente3cf5d5d9a86df1c5e413bdd3725c25a16ff854c (diff)
ext4: drop the EXT4_STATE_DELALLOC_RESERVED flag
Having done a full regression test, we can now drop the DELALLOC_RESERVED state flag. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext4/ext4.h1
-rw-r--r--fs/ext4/inode.c20
-rw-r--r--fs/ext4/mballoc.c10
3 files changed, 4 insertions, 27 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 00fd822ac6e4..4855800fcc5d 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -1400,7 +1400,6 @@ enum {
1400 EXT4_STATE_EXT_MIGRATE, /* Inode is migrating */ 1400 EXT4_STATE_EXT_MIGRATE, /* Inode is migrating */
1401 EXT4_STATE_DIO_UNWRITTEN, /* need convert on dio done*/ 1401 EXT4_STATE_DIO_UNWRITTEN, /* need convert on dio done*/
1402 EXT4_STATE_NEWENTRY, /* File just added to dir */ 1402 EXT4_STATE_NEWENTRY, /* File just added to dir */
1403 EXT4_STATE_DELALLOC_RESERVED, /* blks already reserved for delalloc */
1404 EXT4_STATE_DIOREAD_LOCK, /* Disable support for dio read 1403 EXT4_STATE_DIOREAD_LOCK, /* Disable support for dio read
1405 nolocking */ 1404 nolocking */
1406 EXT4_STATE_MAY_INLINE_DATA, /* may have in-inode data */ 1405 EXT4_STATE_MAY_INLINE_DATA, /* may have in-inode data */
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 4a16b0cc02de..d5dd7d46844e 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -596,14 +596,6 @@ found:
596 down_write(&EXT4_I(inode)->i_data_sem); 596 down_write(&EXT4_I(inode)->i_data_sem);
597 597
598 /* 598 /*
599 * if the caller is from delayed allocation writeout path
600 * we have already reserved fs blocks for allocation
601 * let the underlying get_block() function know to
602 * avoid double accounting
603 */
604 if (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE)
605 ext4_set_inode_state(inode, EXT4_STATE_DELALLOC_RESERVED);
606 /*
607 * We need to check for EXT4 here because migrate 599 * We need to check for EXT4 here because migrate
608 * could have changed the inode type in between 600 * could have changed the inode type in between
609 */ 601 */
@@ -631,8 +623,6 @@ found:
631 (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE)) 623 (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE))
632 ext4_da_update_reserve_space(inode, retval, 1); 624 ext4_da_update_reserve_space(inode, retval, 1);
633 } 625 }
634 if (flags & EXT4_GET_BLOCKS_DELALLOC_RESERVE)
635 ext4_clear_inode_state(inode, EXT4_STATE_DELALLOC_RESERVED);
636 626
637 if (retval > 0) { 627 if (retval > 0) {
638 unsigned int status; 628 unsigned int status;
@@ -2004,12 +1994,10 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd)
2004 * in data loss. So use reserved blocks to allocate metadata if 1994 * in data loss. So use reserved blocks to allocate metadata if
2005 * possible. 1995 * possible.
2006 * 1996 *
2007 * We pass in the magic EXT4_GET_BLOCKS_DELALLOC_RESERVE if the blocks 1997 * We pass in the magic EXT4_GET_BLOCKS_DELALLOC_RESERVE if
2008 * in question are delalloc blocks. This affects functions in many 1998 * the blocks in question are delalloc blocks. This indicates
2009 * different parts of the allocation call path. This flag exists 1999 * that the blocks and quotas has already been checked when
2010 * primarily because we don't want to change *many* call functions, so 2000 * the data was copied into the page cache.
2011 * ext4_map_blocks() will set the EXT4_STATE_DELALLOC_RESERVED flag
2012 * once the inode's allocation semaphore is taken.
2013 */ 2001 */
2014 get_blocks_flags = EXT4_GET_BLOCKS_CREATE | 2002 get_blocks_flags = EXT4_GET_BLOCKS_CREATE |
2015 EXT4_GET_BLOCKS_METADATA_NOFAIL; 2003 EXT4_GET_BLOCKS_METADATA_NOFAIL;
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 15dffdac5907..65cca2881d71 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -4410,16 +4410,6 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
4410 if (IS_NOQUOTA(ar->inode)) 4410 if (IS_NOQUOTA(ar->inode))
4411 ar->flags |= EXT4_MB_USE_ROOT_BLOCKS; 4411 ar->flags |= EXT4_MB_USE_ROOT_BLOCKS;
4412 4412
4413 /*
4414 * For delayed allocation, we could skip the ENOSPC and
4415 * EDQUOT check, as blocks and quotas have been already
4416 * reserved when data being copied into pagecache.
4417 */
4418 if (ext4_test_inode_state(ar->inode, EXT4_STATE_DELALLOC_RESERVED)) {
4419 WARN_ON((ar->flags & EXT4_MB_DELALLOC_RESERVED) == 0);
4420 ar->flags |= EXT4_MB_DELALLOC_RESERVED;
4421 }
4422
4423 if ((ar->flags & EXT4_MB_DELALLOC_RESERVED) == 0) { 4413 if ((ar->flags & EXT4_MB_DELALLOC_RESERVED) == 0) {
4424 /* Without delayed allocation we need to verify 4414 /* Without delayed allocation we need to verify
4425 * there is enough free blocks to do block allocation 4415 * there is enough free blocks to do block allocation