diff options
author | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:34:26 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:34:26 -0400 |
commit | 681b120018e3c7e2680c93e8188c5ee34215df2f (patch) | |
tree | ac9ac585405ce263d1dcb170b3e201e44688aa66 /fs/xfs | |
parent | c4ed4243c40f97ed5b7b121777bbbc6aeaa722f0 (diff) |
xfs: always log timestamp updates in xfs_setattr_size
Get rid of the special case where we use unlogged timestamp updates for
a truncate to the current inode size, and just call xfs_setattr_nonsize
for it to treat it like a utimes calls.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 65d3bf8266e7..5a0fcb09fc7e 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -773,14 +773,15 @@ xfs_setattr_size( | |||
773 | */ | 773 | */ |
774 | if (iattr->ia_size == 0 && | 774 | if (iattr->ia_size == 0 && |
775 | ip->i_size == 0 && ip->i_d.di_nextents == 0) { | 775 | ip->i_size == 0 && ip->i_d.di_nextents == 0) { |
776 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | 776 | if (!(mask & (ATTR_CTIME|ATTR_MTIME))) |
777 | lock_flags &= ~XFS_ILOCK_EXCL; | 777 | goto out_unlock; |
778 | if (mask & ATTR_CTIME) { | 778 | |
779 | inode->i_mtime = inode->i_ctime = | 779 | /* |
780 | current_fs_time(inode->i_sb); | 780 | * Use the regular setattr path to update the timestamps. |
781 | xfs_mark_inode_dirty_sync(ip); | 781 | */ |
782 | } | 782 | xfs_iunlock(ip, lock_flags); |
783 | goto out_unlock; | 783 | iattr->ia_valid &= ~ATTR_SIZE; |
784 | return xfs_setattr_nonsize(ip, iattr, 0); | ||
784 | } | 785 | } |
785 | 786 | ||
786 | /* | 787 | /* |