|
@@ -1358,6 +1358,8 @@ enum {
|
|
|
EXT4_STATE_DIO_UNWRITTEN, /* need convert on dio done*/
|
|
|
EXT4_STATE_NEWENTRY, /* File just added to dir */
|
|
|
EXT4_STATE_DELALLOC_RESERVED, /* blks already reserved for delalloc */
|
|
|
+ EXT4_STATE_DIOREAD_LOCK, /* Disable support for dio read
|
|
|
+ nolocking */
|
|
|
};
|
|
|
|
|
|
#define EXT4_INODE_BIT_FNS(name, field, offset) \
|
|
@@ -2469,6 +2471,21 @@ static inline void set_bitmap_uptodate(struct buffer_head *bh)
|
|
|
set_bit(BH_BITMAP_UPTODATE, &(bh)->b_state);
|
|
|
}
|
|
|
|
|
|
+/*
|
|
|
+ * Disable DIO read nolock optimization, so new dioreaders will be forced
|
|
|
+ * to grab i_mutex
|
|
|
+ */
|
|
|
+static inline void ext4_inode_block_unlocked_dio(struct inode *inode)
|
|
|
+{
|
|
|
+ ext4_set_inode_state(inode, EXT4_STATE_DIOREAD_LOCK);
|
|
|
+ smp_mb();
|
|
|
+}
|
|
|
+static inline void ext4_inode_resume_unlocked_dio(struct inode *inode)
|
|
|
+{
|
|
|
+ smp_mb();
|
|
|
+ ext4_clear_inode_state(inode, EXT4_STATE_DIOREAD_LOCK);
|
|
|
+}
|
|
|
+
|
|
|
#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1)
|
|
|
|
|
|
/* For ioend & aio unwritten conversion wait queues */
|