diff options
Diffstat (limited to 'fs/ext4/fsync.c')
-rw-r--r-- | fs/ext4/fsync.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ext4/fsync.c b/fs/ext4/fsync.c index b6a74f991bf4..40f345201737 100644 --- a/fs/ext4/fsync.c +++ b/fs/ext4/fsync.c | |||
@@ -71,9 +71,9 @@ static void ext4_sync_parent(struct inode *inode) | |||
71 | * i_mutex lock is held when entering and exiting this function | 71 | * i_mutex lock is held when entering and exiting this function |
72 | */ | 72 | */ |
73 | 73 | ||
74 | int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync) | 74 | int ext4_sync_file(struct file *file, int datasync) |
75 | { | 75 | { |
76 | struct inode *inode = dentry->d_inode; | 76 | struct inode *inode = file->f_mapping->host; |
77 | struct ext4_inode_info *ei = EXT4_I(inode); | 77 | struct ext4_inode_info *ei = EXT4_I(inode); |
78 | journal_t *journal = EXT4_SB(inode->i_sb)->s_journal; | 78 | journal_t *journal = EXT4_SB(inode->i_sb)->s_journal; |
79 | int ret; | 79 | int ret; |
@@ -81,7 +81,7 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync) | |||
81 | 81 | ||
82 | J_ASSERT(ext4_journal_current_handle() == NULL); | 82 | J_ASSERT(ext4_journal_current_handle() == NULL); |
83 | 83 | ||
84 | trace_ext4_sync_file(file, dentry, datasync); | 84 | trace_ext4_sync_file(file, datasync); |
85 | 85 | ||
86 | if (inode->i_sb->s_flags & MS_RDONLY) | 86 | if (inode->i_sb->s_flags & MS_RDONLY) |
87 | return 0; | 87 | return 0; |
@@ -91,7 +91,7 @@ int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync) | |||
91 | return ret; | 91 | return ret; |
92 | 92 | ||
93 | if (!journal) { | 93 | if (!journal) { |
94 | ret = simple_fsync(file, dentry, datasync); | 94 | ret = simple_fsync(file, datasync); |
95 | if (!ret && !list_empty(&inode->i_dentry)) | 95 | if (!ret && !list_empty(&inode->i_dentry)) |
96 | ext4_sync_parent(inode); | 96 | ext4_sync_parent(inode); |
97 | return ret; | 97 | return ret; |