Skip to content

Commit 0e393a9

Browse files
committed
orangefs: don't mess with I_DIRTY_TIMES in orangefs_flush
Christoph Hellwig noticed that we were doing some unnecessary work in orangefs_flush: orangefs_flush just writes out data on every close(2) call. There is no need to change anything about the dirty state, especially as orangefs doesn't treat I_DIRTY_TIMES special in any way. The code seems to come from partially open coding vfs_fsync. He sent in a patch with the above commit message and also a patch that was a reversion of another Orangefs patch I had sent upstream a while ago. I had to fix his reversion patch so that it would compile which caused his "don't mess with I_DIRTY_TIMES" patch to fail to apply. So here I have just remade his patch and applied it after the fixed reversion patch. Signed-off-by: Mike Marshall <[email protected]>
1 parent ec95f1d commit 0e393a9

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

fs/orangefs/file.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -645,16 +645,8 @@ static int orangefs_flush(struct file *file, fl_owner_t id)
645645
* on an explicit fsync call. This duplicates historical OrangeFS
646646
* behavior.
647647
*/
648-
struct inode *inode = file->f_mapping->host;
649648
int r;
650649

651-
if (inode->i_state & I_DIRTY_TIME) {
652-
spin_lock(&inode->i_lock);
653-
inode->i_state &= ~I_DIRTY_TIME;
654-
spin_unlock(&inode->i_lock);
655-
mark_inode_dirty_sync(inode);
656-
}
657-
658650
r = filemap_write_and_wait_range(file->f_mapping, 0, LLONG_MAX);
659651
if (r > 0)
660652
return 0;

0 commit comments

Comments
 (0)