diff options
author | Alex Elder <aelder@sgi.com> | 2009-09-15 21:37:47 -0500 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2009-09-15 21:37:47 -0500 |
commit | fdec29c5fcd2705d61c1d14a1d4c74be03e9627c (patch) | |
tree | bcf5d4dd46b4945f3b4bec6b763ff9a9484e4e59 /fs/xfs/linux-2.6/xfs_file.c | |
parent | 0cb583fd2862f19ea88b02eb307d11c09e51e2f8 (diff) | |
parent | 9ef96da6ec5e1b4cf7eb8e30852cd88ec7d5fdc0 (diff) | |
download | op-kernel-dev-fdec29c5fcd2705d61c1d14a1d4c74be03e9627c.zip op-kernel-dev-fdec29c5fcd2705d61c1d14a1d4c74be03e9627c.tar.gz |
Merge branch 'master' of git://oss.sgi.com/xfs/xfs into for-linus
Conflicts:
fs/xfs/linux-2.6/xfs_lrw.c
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_file.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_file.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c index 0542fd5..988d8f8 100644 --- a/fs/xfs/linux-2.6/xfs_file.c +++ b/fs/xfs/linux-2.6/xfs_file.c @@ -172,12 +172,21 @@ xfs_file_release( */ STATIC int xfs_file_fsync( - struct file *filp, - struct dentry *dentry, - int datasync) + struct file *file, + struct dentry *dentry, + int datasync) { - xfs_iflags_clear(XFS_I(dentry->d_inode), XFS_ITRUNCATED); - return -xfs_fsync(XFS_I(dentry->d_inode)); + struct inode *inode = dentry->d_inode; + struct xfs_inode *ip = XFS_I(inode); + int error; + + /* capture size updates in I/O completion before writing the inode. */ + error = filemap_fdatawait(inode->i_mapping); + if (error) + return error; + + xfs_iflags_clear(ip, XFS_ITRUNCATED); + return -xfs_fsync(ip); } STATIC int |