diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2007-06-05 04:39:18 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2007-07-09 03:23:12 -0400 |
commit | 4bd91ba18198eee42c39d4c334c825d1a0a4b445 (patch) | |
tree | f385969756303a17a7ce3d24280fc6bd64063c87 /fs/gfs2/dir.c | |
parent | bb8d8a6f54c1c84d7c74623491bab043b36a38c5 (diff) |
[GFS2] Add nanosecond timestamp feature
This adds a nanosecond timestamp feature to the GFS2 filesystem. Due
to the way that the on-disk format works, older filesystems will just
appear to have this field set to zero. When mounted by an older version
of GFS2, the filesystem will simply ignore the extra fields so that
it will again appear to have whole second resolution, so that its
trivially backward compatible.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/dir.c')
-rw-r--r-- | fs/gfs2/dir.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 2f154049b59d..f793e31a050e 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c | |||
@@ -130,7 +130,7 @@ static int gfs2_dir_write_stuffed(struct gfs2_inode *ip, const char *buf, | |||
130 | memcpy(dibh->b_data + offset + sizeof(struct gfs2_dinode), buf, size); | 130 | memcpy(dibh->b_data + offset + sizeof(struct gfs2_dinode), buf, size); |
131 | if (ip->i_di.di_size < offset + size) | 131 | if (ip->i_di.di_size < offset + size) |
132 | ip->i_di.di_size = offset + size; | 132 | ip->i_di.di_size = offset + size; |
133 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME_SEC; | 133 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; |
134 | gfs2_dinode_out(ip, dibh->b_data); | 134 | gfs2_dinode_out(ip, dibh->b_data); |
135 | 135 | ||
136 | brelse(dibh); | 136 | brelse(dibh); |
@@ -228,7 +228,7 @@ out: | |||
228 | 228 | ||
229 | if (ip->i_di.di_size < offset + copied) | 229 | if (ip->i_di.di_size < offset + copied) |
230 | ip->i_di.di_size = offset + copied; | 230 | ip->i_di.di_size = offset + copied; |
231 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME_SEC; | 231 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; |
232 | 232 | ||
233 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); | 233 | gfs2_trans_add_bh(ip->i_gl, dibh, 1); |
234 | gfs2_dinode_out(ip, dibh->b_data); | 234 | gfs2_dinode_out(ip, dibh->b_data); |
@@ -1622,7 +1622,7 @@ int gfs2_dir_add(struct inode *inode, const struct qstr *name, | |||
1622 | break; | 1622 | break; |
1623 | gfs2_trans_add_bh(ip->i_gl, bh, 1); | 1623 | gfs2_trans_add_bh(ip->i_gl, bh, 1); |
1624 | ip->i_di.di_entries++; | 1624 | ip->i_di.di_entries++; |
1625 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME_SEC; | 1625 | ip->i_inode.i_mtime = ip->i_inode.i_ctime = CURRENT_TIME; |
1626 | gfs2_dinode_out(ip, bh->b_data); | 1626 | gfs2_dinode_out(ip, bh->b_data); |
1627 | brelse(bh); | 1627 | brelse(bh); |
1628 | error = 0; | 1628 | error = 0; |
@@ -1708,7 +1708,7 @@ int gfs2_dir_del(struct gfs2_inode *dip, const struct qstr *name) | |||
1708 | gfs2_consist_inode(dip); | 1708 | gfs2_consist_inode(dip); |
1709 | gfs2_trans_add_bh(dip->i_gl, bh, 1); | 1709 | gfs2_trans_add_bh(dip->i_gl, bh, 1); |
1710 | dip->i_di.di_entries--; | 1710 | dip->i_di.di_entries--; |
1711 | dip->i_inode.i_mtime = dip->i_inode.i_ctime = CURRENT_TIME_SEC; | 1711 | dip->i_inode.i_mtime = dip->i_inode.i_ctime = CURRENT_TIME; |
1712 | gfs2_dinode_out(dip, bh->b_data); | 1712 | gfs2_dinode_out(dip, bh->b_data); |
1713 | brelse(bh); | 1713 | brelse(bh); |
1714 | mark_inode_dirty(&dip->i_inode); | 1714 | mark_inode_dirty(&dip->i_inode); |
@@ -1756,7 +1756,7 @@ int gfs2_dir_mvino(struct gfs2_inode *dip, const struct qstr *filename, | |||
1756 | gfs2_trans_add_bh(dip->i_gl, bh, 1); | 1756 | gfs2_trans_add_bh(dip->i_gl, bh, 1); |
1757 | } | 1757 | } |
1758 | 1758 | ||
1759 | dip->i_inode.i_mtime = dip->i_inode.i_ctime = CURRENT_TIME_SEC; | 1759 | dip->i_inode.i_mtime = dip->i_inode.i_ctime = CURRENT_TIME; |
1760 | gfs2_dinode_out(dip, bh->b_data); | 1760 | gfs2_dinode_out(dip, bh->b_data); |
1761 | brelse(bh); | 1761 | brelse(bh); |
1762 | return 0; | 1762 | return 0; |