]> Pileus Git - ~andy/linux/blobdiff - fs/ext4/page-io.c
ext4: don't wait for extent conversion in ext4_punch_hole()
[~andy/linux] / fs / ext4 / page-io.c
index 755741c211a4a1f1f8ebc85ee51d2cdd92887bf1..6ee5bd389405c7faf540c5780fa97f71498553d7 100644 (file)
@@ -158,7 +158,14 @@ static void ext4_clear_io_unwritten_flag(ext4_io_end_t *io_end)
                wake_up_all(ext4_ioend_wq(inode));
 }
 
-/* check a range of space and convert unwritten extents to written. */
+/*
+ * Check a range of space and convert unwritten extents to written. Note that
+ * we are protected from truncate touching same part of extent tree by the
+ * fact that truncate code waits for all DIO to finish (thus exclusion from
+ * direct IO is achieved) and also waits for PageWriteback bits. Thus we
+ * cannot get to ext4_ext_truncate() before all IOs overlapping that range are
+ * completed (happens from ext4_free_ioend()).
+ */
 static int ext4_end_io(ext4_io_end_t *io)
 {
        struct inode *inode = io->inode;
@@ -274,22 +281,6 @@ void ext4_end_io_unrsv_work(struct work_struct *work)
        ext4_do_flush_completed_IO(&ei->vfs_inode, &ei->i_unrsv_conversion_list);
 }
 
-int ext4_flush_unwritten_io(struct inode *inode)
-{
-       int ret, err;
-
-       WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex) &&
-                    !(inode->i_state & I_FREEING));
-       ret = ext4_do_flush_completed_IO(inode,
-                                        &EXT4_I(inode)->i_rsv_conversion_list);
-       err = ext4_do_flush_completed_IO(inode,
-                                        &EXT4_I(inode)->i_unrsv_conversion_list);
-       if (!ret)
-               ret = err;
-       ext4_unwritten_wait(inode);
-       return ret;
-}
-
 ext4_io_end_t *ext4_init_io_end(struct inode *inode, gfp_t flags)
 {
        ext4_io_end_t *io = kmem_cache_zalloc(io_end_cachep, flags);