diff options
author | Kalpak Shah <kalpak@clusterfs.com> | 2007-07-18 09:15:20 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2007-07-18 09:15:20 -0400 |
commit | ef7f38359ea8b3e9c7f2cae9a4d4935f55ca9e80 (patch) | |
tree | ee34a5821332cf70b89827eb872f08bc0dd43f89 /fs/ext4/namei.c | |
parent | 0f49d5d019afa4e94253bfc92f0daca3badb990b (diff) |
ext4: Add nanosecond timestamps
This patch adds nanosecond timestamps for ext4. This involves adding
*time_extra fields to the ext4_inode to extend the timestamps to
64-bits. Creation time is also added by this patch.
These extended fields will fit into an inode if the filesystem was
formatted with large inodes (-I 256 or larger) and there are currently
no EAs consuming all of the available space. For new inodes we always
reserve enough space for the kernel's known extended fields, but for
inodes created with an old kernel this might not have been the case. So
this patch also adds the EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE feature
flag(ro-compat so that older kernels can't create inodes with a smaller
extra_isize). which indicates if the fields fitting inside
s_min_extra_isize are available or not. If the expansion of inodes if
unsuccessful then this feature will be disabled. This feature is only
enabled if requested by the sysadmin.
None of the extended inode fields is critical for correct filesystem
operation.
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>
Signed-off-by: Kalpak Shah <kalpak@clusterfs.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/namei.c')
-rw-r--r-- | fs/ext4/namei.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 2de339dd7554..40106b7ea4b8 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -1295,7 +1295,7 @@ static int add_dirent_to_buf(handle_t *handle, struct dentry *dentry, | |||
1295 | * happen is that the times are slightly out of date | 1295 | * happen is that the times are slightly out of date |
1296 | * and/or different from the directory change time. | 1296 | * and/or different from the directory change time. |
1297 | */ | 1297 | */ |
1298 | dir->i_mtime = dir->i_ctime = CURRENT_TIME_SEC; | 1298 | dir->i_mtime = dir->i_ctime = ext4_current_time(dir); |
1299 | ext4_update_dx_flag(dir); | 1299 | ext4_update_dx_flag(dir); |
1300 | dir->i_version++; | 1300 | dir->i_version++; |
1301 | ext4_mark_inode_dirty(handle, dir); | 1301 | ext4_mark_inode_dirty(handle, dir); |
@@ -2056,7 +2056,7 @@ static int ext4_rmdir (struct inode * dir, struct dentry *dentry) | |||
2056 | * recovery. */ | 2056 | * recovery. */ |
2057 | inode->i_size = 0; | 2057 | inode->i_size = 0; |
2058 | ext4_orphan_add(handle, inode); | 2058 | ext4_orphan_add(handle, inode); |
2059 | inode->i_ctime = dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; | 2059 | inode->i_ctime = dir->i_ctime = dir->i_mtime = ext4_current_time(inode); |
2060 | ext4_mark_inode_dirty(handle, inode); | 2060 | ext4_mark_inode_dirty(handle, inode); |
2061 | drop_nlink(dir); | 2061 | drop_nlink(dir); |
2062 | ext4_update_dx_flag(dir); | 2062 | ext4_update_dx_flag(dir); |
@@ -2106,13 +2106,13 @@ static int ext4_unlink(struct inode * dir, struct dentry *dentry) | |||
2106 | retval = ext4_delete_entry(handle, dir, de, bh); | 2106 | retval = ext4_delete_entry(handle, dir, de, bh); |
2107 | if (retval) | 2107 | if (retval) |
2108 | goto end_unlink; | 2108 | goto end_unlink; |
2109 | dir->i_ctime = dir->i_mtime = CURRENT_TIME_SEC; | 2109 | dir->i_ctime = dir->i_mtime = ext4_current_time(dir); |
2110 | ext4_update_dx_flag(dir); | 2110 | ext4_update_dx_flag(dir); |
2111 | ext4_mark_inode_dirty(handle, dir); | 2111 | ext4_mark_inode_dirty(handle, dir); |
2112 | drop_nlink(inode); | 2112 | drop_nlink(inode); |
2113 | if (!inode->i_nlink) | 2113 | if (!inode->i_nlink) |
2114 | ext4_orphan_add(handle, inode); | 2114 | ext4_orphan_add(handle, inode); |
2115 | inode->i_ctime = dir->i_ctime; | 2115 | inode->i_ctime = ext4_current_time(inode); |
2116 | ext4_mark_inode_dirty(handle, inode); | 2116 | ext4_mark_inode_dirty(handle, inode); |
2117 | retval = 0; | 2117 | retval = 0; |
2118 | 2118 | ||
@@ -2203,7 +2203,7 @@ retry: | |||
2203 | if (IS_DIRSYNC(dir)) | 2203 | if (IS_DIRSYNC(dir)) |
2204 | handle->h_sync = 1; | 2204 | handle->h_sync = 1; |
2205 | 2205 | ||
2206 | inode->i_ctime = CURRENT_TIME_SEC; | 2206 | inode->i_ctime = ext4_current_time(inode); |
2207 | inc_nlink(inode); | 2207 | inc_nlink(inode); |
2208 | atomic_inc(&inode->i_count); | 2208 | atomic_inc(&inode->i_count); |
2209 | 2209 | ||
@@ -2305,7 +2305,7 @@ static int ext4_rename (struct inode * old_dir, struct dentry *old_dentry, | |||
2305 | * Like most other Unix systems, set the ctime for inodes on a | 2305 | * Like most other Unix systems, set the ctime for inodes on a |
2306 | * rename. | 2306 | * rename. |
2307 | */ | 2307 | */ |
2308 | old_inode->i_ctime = CURRENT_TIME_SEC; | 2308 | old_inode->i_ctime = ext4_current_time(old_inode); |
2309 | ext4_mark_inode_dirty(handle, old_inode); | 2309 | ext4_mark_inode_dirty(handle, old_inode); |
2310 | 2310 | ||
2311 | /* | 2311 | /* |
@@ -2338,9 +2338,9 @@ static int ext4_rename (struct inode * old_dir, struct dentry *old_dentry, | |||
2338 | 2338 | ||
2339 | if (new_inode) { | 2339 | if (new_inode) { |
2340 | drop_nlink(new_inode); | 2340 | drop_nlink(new_inode); |
2341 | new_inode->i_ctime = CURRENT_TIME_SEC; | 2341 | new_inode->i_ctime = ext4_current_time(new_inode); |
2342 | } | 2342 | } |
2343 | old_dir->i_ctime = old_dir->i_mtime = CURRENT_TIME_SEC; | 2343 | old_dir->i_ctime = old_dir->i_mtime = ext4_current_time(old_dir); |
2344 | ext4_update_dx_flag(old_dir); | 2344 | ext4_update_dx_flag(old_dir); |
2345 | if (dir_bh) { | 2345 | if (dir_bh) { |
2346 | BUFFER_TRACE(dir_bh, "get_write_access"); | 2346 | BUFFER_TRACE(dir_bh, "get_write_access"); |