diff options
author | Christoph Hellwig <hch@infradead.org> | 2008-08-13 02:44:15 -0400 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-08-13 02:44:15 -0400 |
commit | dff35fd41f252476cba7f761d7204dd9f47d739e (patch) | |
tree | 3f4da55c3e5aede3de6d97a11bd0d53656aa6781 | |
parent | ab4a9b04a33c97dd17495f943447f5a15ecf2b51 (diff) |
[XFS] update timestamp in xfs_ialloc manually
In xfs_ialloc we just want to set all timestamps to the current time. We
don't need to mark the inode dirty like xfs_ichgtime does, and we don't
need nor want the opimizations in xfs_ichgtime that I will introduce in
the next patch.
So just opencode the timestamp update in xfs_ialloc, and remove the new
unused XFS_ICHGTIME_ACC case in xfs_ichgtime.
SGI-PV: 981498
SGI-Modid: xfs-linux-melb:xfs-kern:31825a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
-rw-r--r-- | fs/xfs/linux-2.6/xfs_iops.c | 17 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 9 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.h | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 1 |
4 files changed, 9 insertions, 21 deletions
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index ace56bd3a5fb..d6947f818f29 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c | |||
@@ -89,12 +89,6 @@ xfs_mark_inode_dirty_sync( | |||
89 | * Change the requested timestamp in the given inode. | 89 | * Change the requested timestamp in the given inode. |
90 | * We don't lock across timestamp updates, and we don't log them but | 90 | * We don't lock across timestamp updates, and we don't log them but |
91 | * we do record the fact that there is dirty information in core. | 91 | * we do record the fact that there is dirty information in core. |
92 | * | ||
93 | * NOTE -- callers MUST combine XFS_ICHGTIME_MOD or XFS_ICHGTIME_CHG | ||
94 | * with XFS_ICHGTIME_ACC to be sure that access time | ||
95 | * update will take. Calling first with XFS_ICHGTIME_ACC | ||
96 | * and then XFS_ICHGTIME_MOD may fail to modify the access | ||
97 | * timestamp if the filesystem is mounted noacctm. | ||
98 | */ | 92 | */ |
99 | void | 93 | void |
100 | xfs_ichgtime( | 94 | xfs_ichgtime( |
@@ -110,11 +104,6 @@ xfs_ichgtime( | |||
110 | ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; | 104 | ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; |
111 | ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; | 105 | ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; |
112 | } | 106 | } |
113 | if (flags & XFS_ICHGTIME_ACC) { | ||
114 | inode->i_atime = tv; | ||
115 | ip->i_d.di_atime.t_sec = (__int32_t)tv.tv_sec; | ||
116 | ip->i_d.di_atime.t_nsec = (__int32_t)tv.tv_nsec; | ||
117 | } | ||
118 | if (flags & XFS_ICHGTIME_CHG) { | 107 | if (flags & XFS_ICHGTIME_CHG) { |
119 | inode->i_ctime = tv; | 108 | inode->i_ctime = tv; |
120 | ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec; | 109 | ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec; |
@@ -149,12 +138,6 @@ xfs_ichgtime_fast( | |||
149 | { | 138 | { |
150 | timespec_t *tvp; | 139 | timespec_t *tvp; |
151 | 140 | ||
152 | /* | ||
153 | * Atime updates for read() & friends are handled lazily now, and | ||
154 | * explicit updates must go through xfs_ichgtime() | ||
155 | */ | ||
156 | ASSERT((flags & XFS_ICHGTIME_ACC) == 0); | ||
157 | |||
158 | if (flags & XFS_ICHGTIME_MOD) { | 141 | if (flags & XFS_ICHGTIME_MOD) { |
159 | tvp = &inode->i_mtime; | 142 | tvp = &inode->i_mtime; |
160 | ip->i_d.di_mtime.t_sec = (__int32_t)tvp->tv_sec; | 143 | ip->i_d.di_mtime.t_sec = (__int32_t)tvp->tv_sec; |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index aea62222b3a1..41371c56f360 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -1048,6 +1048,7 @@ xfs_ialloc( | |||
1048 | xfs_inode_t *ip; | 1048 | xfs_inode_t *ip; |
1049 | uint flags; | 1049 | uint flags; |
1050 | int error; | 1050 | int error; |
1051 | timespec_t tv; | ||
1051 | 1052 | ||
1052 | /* | 1053 | /* |
1053 | * Call the space management code to pick | 1054 | * Call the space management code to pick |
@@ -1128,7 +1129,13 @@ xfs_ialloc( | |||
1128 | ip->i_size = 0; | 1129 | ip->i_size = 0; |
1129 | ip->i_d.di_nextents = 0; | 1130 | ip->i_d.di_nextents = 0; |
1130 | ASSERT(ip->i_d.di_nblocks == 0); | 1131 | ASSERT(ip->i_d.di_nblocks == 0); |
1131 | xfs_ichgtime(ip, XFS_ICHGTIME_CHG|XFS_ICHGTIME_ACC|XFS_ICHGTIME_MOD); | 1132 | |
1133 | nanotime(&tv); | ||
1134 | ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; | ||
1135 | ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; | ||
1136 | ip->i_d.di_atime = ip->i_d.di_mtime; | ||
1137 | ip->i_d.di_ctime = ip->i_d.di_mtime; | ||
1138 | |||
1132 | /* | 1139 | /* |
1133 | * di_gen will have been taken care of in xfs_iread. | 1140 | * di_gen will have been taken care of in xfs_iread. |
1134 | */ | 1141 | */ |
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index f771df6bfa6f..1420c49674d7 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -87,8 +87,7 @@ typedef struct xfs_ifork { | |||
87 | * Flags for xfs_ichgtime(). | 87 | * Flags for xfs_ichgtime(). |
88 | */ | 88 | */ |
89 | #define XFS_ICHGTIME_MOD 0x1 /* data fork modification timestamp */ | 89 | #define XFS_ICHGTIME_MOD 0x1 /* data fork modification timestamp */ |
90 | #define XFS_ICHGTIME_ACC 0x2 /* data fork access timestamp */ | 90 | #define XFS_ICHGTIME_CHG 0x2 /* inode field change timestamp */ |
91 | #define XFS_ICHGTIME_CHG 0x4 /* inode field change timestamp */ | ||
92 | 91 | ||
93 | /* | 92 | /* |
94 | * Per-fork incore inode flags. | 93 | * Per-fork incore inode flags. |
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 7b967c096d03..588bb4aa215d 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -513,7 +513,6 @@ xfs_setattr( | |||
513 | ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; | 513 | ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; |
514 | ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; | 514 | ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; |
515 | ip->i_update_core = 1; | 515 | ip->i_update_core = 1; |
516 | timeflags &= ~XFS_ICHGTIME_ACC; | ||
517 | } | 516 | } |
518 | if (mask & ATTR_MTIME) { | 517 | if (mask & ATTR_MTIME) { |
519 | inode->i_mtime = iattr->ia_mtime; | 518 | inode->i_mtime = iattr->ia_mtime; |