ext4: remove EXT4_STATE_ORDERED_MODE
authorJan Kara <jack@suse.cz>
Sun, 24 Apr 2016 04:56:05 +0000 (00:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 24 Apr 2016 04:56:05 +0000 (00:56 -0400)
This flag is just duplicating what ext4_should_order_data() tells you
and is used in a single place. Furthermore it doesn't reflect changes to
inode data journalling flag so it may be possibly misleading. Just
remove it.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/inode.c

index 349afebe21ee192a3cd6596438dd7502d7d16c80..f75e9ebd4ca2c1ba90b0d0f1f449cda6993177ad 100644 (file)
@@ -1549,7 +1549,6 @@ enum {
        EXT4_STATE_DIOREAD_LOCK,        /* Disable support for dio read
                                           nolocking */
        EXT4_STATE_MAY_INLINE_DATA,     /* may have in-inode data */
        EXT4_STATE_DIOREAD_LOCK,        /* Disable support for dio read
                                           nolocking */
        EXT4_STATE_MAY_INLINE_DATA,     /* may have in-inode data */
-       EXT4_STATE_ORDERED_MODE,        /* data=ordered mode */
        EXT4_STATE_EXT_PRECACHED,       /* extents have been precached */
 };
 
        EXT4_STATE_EXT_PRECACHED,       /* extents have been precached */
 };
 
index 250c2df04a92c5feee85c6e07c75940dc0af5392..8ba46ad06aedb9f8f6c7ee56b2979e541c9ce51c 100644 (file)
@@ -3540,10 +3540,7 @@ void ext4_set_aops(struct inode *inode)
 {
        switch (ext4_inode_journal_mode(inode)) {
        case EXT4_INODE_ORDERED_DATA_MODE:
 {
        switch (ext4_inode_journal_mode(inode)) {
        case EXT4_INODE_ORDERED_DATA_MODE:
-               ext4_set_inode_state(inode, EXT4_STATE_ORDERED_MODE);
-               break;
        case EXT4_INODE_WRITEBACK_DATA_MODE:
        case EXT4_INODE_WRITEBACK_DATA_MODE:
-               ext4_clear_inode_state(inode, EXT4_STATE_ORDERED_MODE);
                break;
        case EXT4_INODE_JOURNAL_DATA_MODE:
                inode->i_mapping->a_ops = &ext4_journalled_aops;
                break;
        case EXT4_INODE_JOURNAL_DATA_MODE:
                inode->i_mapping->a_ops = &ext4_journalled_aops;
@@ -3636,7 +3633,7 @@ static int __ext4_block_zero_page_range(handle_t *handle,
        } else {
                err = 0;
                mark_buffer_dirty(bh);
        } else {
                err = 0;
                mark_buffer_dirty(bh);
-               if (ext4_test_inode_state(inode, EXT4_STATE_ORDERED_MODE))
+               if (ext4_should_order_data(inode))
                        err = ext4_jbd2_file_inode(handle, inode);
        }
 
                        err = ext4_jbd2_file_inode(handle, inode);
        }