Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108331
b: refs/heads/master
c: 8e5975c
h: refs/heads/master
i:
  108329: cf78262
  108327: c489eca
v: v3
  • Loading branch information
Christoph Hellwig authored and Lachlan McIlroy committed Aug 13, 2008
1 parent 3ca7fcf commit 634aa77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dff35fd41f252476cba7f761d7204dd9f47d739e
refs/heads/master: 8e5975c82f66bce36955f38e9abc259d5143a72a
19 changes: 13 additions & 6 deletions trunk/fs/xfs/linux-2.6/xfs_iops.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,23 @@ xfs_ichgtime(
{
struct inode *inode = VFS_I(ip);
timespec_t tv;
int sync_it = 0;

nanotime(&tv);
if (flags & XFS_ICHGTIME_MOD) {
tv = current_fs_time(inode->i_sb);

if ((flags & XFS_ICHGTIME_MOD) &&
!timespec_equal(&inode->i_mtime, &tv)) {
inode->i_mtime = tv;
ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec;
ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec;
sync_it = 1;
}
if (flags & XFS_ICHGTIME_CHG) {
if ((flags & XFS_ICHGTIME_CHG) &&
!timespec_equal(&inode->i_ctime, &tv)) {
inode->i_ctime = tv;
ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec;
ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec;
sync_it = 1;
}

/*
Expand All @@ -119,10 +125,11 @@ xfs_ichgtime(
* ensure that the compiler does not reorder the update
* of i_update_core above the timestamp updates above.
*/
SYNCHRONIZE();
ip->i_update_core = 1;
if (!(inode->i_state & I_NEW))
if (sync_it) {
SYNCHRONIZE();
ip->i_update_core = 1;
mark_inode_dirty_sync(inode);
}
}

/*
Expand Down

0 comments on commit 634aa77

Please sign in to comment.