add patch add-support-for-avoiding-data-writes-during-transaction-commits
[ext4-patch-queue.git] / remove-EXT4_STATE_ORDERED_MODE
blob39dcb53ef452f1dd486cfc1841f985b196d1d4c4
1 ext4: remove EXT4_STATE_ORDERED_MODE
3 From: Jan Kara <jack@suse.cz>
5 This flag is just duplicating what ext4_should_order_data() tells you
6 and is used in a single place. Furthermore it doesn't reflect changes to
7 inode data journalling flag so it may be possibly misleading. Just
8 remove it.
10 Signed-off-by: Jan Kara <jack@suse.cz>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 ---
13  fs/ext4/ext4.h  | 1 -
14  fs/ext4/inode.c | 5 +----
15  2 files changed, 1 insertion(+), 5 deletions(-)
17 diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
18 index c04743519865..8647d1253903 100644
19 --- a/fs/ext4/ext4.h
20 +++ b/fs/ext4/ext4.h
21 @@ -1526,7 +1526,6 @@ enum {
22         EXT4_STATE_DIOREAD_LOCK,        /* Disable support for dio read
23                                            nolocking */
24         EXT4_STATE_MAY_INLINE_DATA,     /* may have in-inode data */
25 -       EXT4_STATE_ORDERED_MODE,        /* data=ordered mode */
26         EXT4_STATE_EXT_PRECACHED,       /* extents have been precached */
27  };
29 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
30 index 747b0e64b9d2..8ffba0ec3b80 100644
31 --- a/fs/ext4/inode.c
32 +++ b/fs/ext4/inode.c
33 @@ -3541,10 +3541,7 @@ void ext4_set_aops(struct inode *inode)
34  {
35         switch (ext4_inode_journal_mode(inode)) {
36         case EXT4_INODE_ORDERED_DATA_MODE:
37 -               ext4_set_inode_state(inode, EXT4_STATE_ORDERED_MODE);
38 -               break;
39         case EXT4_INODE_WRITEBACK_DATA_MODE:
40 -               ext4_clear_inode_state(inode, EXT4_STATE_ORDERED_MODE);
41                 break;
42         case EXT4_INODE_JOURNAL_DATA_MODE:
43                 inode->i_mapping->a_ops = &ext4_journalled_aops;
44 @@ -3637,7 +3634,7 @@ static int __ext4_block_zero_page_range(handle_t *handle,
45         } else {
46                 err = 0;
47                 mark_buffer_dirty(bh);
48 -               if (ext4_test_inode_state(inode, EXT4_STATE_ORDERED_MODE))
49 +               if (ext4_should_order_data(inode))
50                         err = ext4_jbd2_file_inode(handle, inode);
51         }
53 -- 
54 2.6.2