diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_file.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_file.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index 65e78c13d4ae..5f60363b9343 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c | |||
@@ -184,19 +184,24 @@ xfs_file_release( | |||
184 | return -xfs_release(XFS_I(inode)); | 184 | return -xfs_release(XFS_I(inode)); |
185 | } | 185 | } |
186 | 186 | ||
187 | /* | ||
188 | * We ignore the datasync flag here because a datasync is effectively | ||
189 | * identical to an fsync. That is, datasync implies that we need to write | ||
190 | * only the metadata needed to be able to access the data that is written | ||
191 | * if we crash after the call completes. Hence if we are writing beyond | ||
192 | * EOF we have to log the inode size change as well, which makes it a | ||
193 | * full fsync. If we don't write beyond EOF, the inode core will be | ||
194 | * clean in memory and so we don't need to log the inode, just like | ||
195 | * fsync. | ||
196 | */ | ||
187 | STATIC int | 197 | STATIC int |
188 | xfs_file_fsync( | 198 | xfs_file_fsync( |
189 | struct file *filp, | 199 | struct file *filp, |
190 | struct dentry *dentry, | 200 | struct dentry *dentry, |
191 | int datasync) | 201 | int datasync) |
192 | { | 202 | { |
193 | int flags = FSYNC_WAIT; | ||
194 | |||
195 | if (datasync) | ||
196 | flags |= FSYNC_DATA; | ||
197 | xfs_iflags_clear(XFS_I(dentry->d_inode), XFS_ITRUNCATED); | 203 | xfs_iflags_clear(XFS_I(dentry->d_inode), XFS_ITRUNCATED); |
198 | return -xfs_fsync(XFS_I(dentry->d_inode), flags, | 204 | return -xfs_fsync(XFS_I(dentry->d_inode)); |
199 | (xfs_off_t)0, (xfs_off_t)-1); | ||
200 | } | 205 | } |
201 | 206 | ||
202 | /* | 207 | /* |