mirror of https://gitee.com/openkylin/linux.git
staging/lustre: use 64-bit inode timestamps internally
Lustre has 64-bit timestamps in its network data structures, but on 32 bit systems, it converts them directly into time_t, which is 32 bit wide. This changes the code to use 64-bit time stamps for files. The Linux VFS code still uses time_t though, and will be changed in a separate patch series. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
9f088dba3c
commit
46c360f9d3
|
@ -173,11 +173,11 @@ struct cl_attr {
|
|||
*/
|
||||
loff_t cat_kms;
|
||||
/** Modification time. Measured in seconds since epoch. */
|
||||
time_t cat_mtime;
|
||||
time64_t cat_mtime;
|
||||
/** Access time. Measured in seconds since epoch. */
|
||||
time_t cat_atime;
|
||||
time64_t cat_atime;
|
||||
/** Change time. Measured in seconds since epoch. */
|
||||
time_t cat_ctime;
|
||||
time64_t cat_ctime;
|
||||
/**
|
||||
* Blocks allocated to this cl_object on the server file system.
|
||||
*
|
||||
|
|
|
@ -851,7 +851,7 @@ struct vvp_io {
|
|||
* Inode modification time that is checked across DLM
|
||||
* lock request.
|
||||
*/
|
||||
time_t ft_mtime;
|
||||
time64_t ft_mtime;
|
||||
struct vm_area_struct *ft_vma;
|
||||
/**
|
||||
* locked page returned from vvp_io
|
||||
|
|
|
@ -109,7 +109,7 @@ static int vvp_io_fault_iter_init(const struct lu_env *env,
|
|||
|
||||
LASSERT(inode ==
|
||||
file_inode(cl2ccc_io(env, ios)->cui_fd->fd_file));
|
||||
vio->u.fault.ft_mtime = LTIME_S(inode->i_mtime);
|
||||
vio->u.fault.ft_mtime = inode->i_mtime.tv_sec;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -661,7 +661,7 @@ static int vvp_io_fault_start(const struct lu_env *env,
|
|||
pgoff_t last; /* last page in a file data region */
|
||||
|
||||
if (fio->ft_executable &&
|
||||
LTIME_S(inode->i_mtime) != vio->u.fault.ft_mtime)
|
||||
inode->i_mtime.tv_sec != vio->u.fault.ft_mtime)
|
||||
CWARN("binary "DFID
|
||||
" changed while waiting for the page fault lock\n",
|
||||
PFID(lu_object_fid(&obj->co_lu)));
|
||||
|
|
|
@ -87,9 +87,9 @@ static int vvp_attr_get(const struct lu_env *env, struct cl_object *obj,
|
|||
*/
|
||||
|
||||
attr->cat_size = i_size_read(inode);
|
||||
attr->cat_mtime = LTIME_S(inode->i_mtime);
|
||||
attr->cat_atime = LTIME_S(inode->i_atime);
|
||||
attr->cat_ctime = LTIME_S(inode->i_ctime);
|
||||
attr->cat_mtime = inode->i_mtime.tv_sec;
|
||||
attr->cat_atime = inode->i_atime.tv_sec;
|
||||
attr->cat_ctime = inode->i_ctime.tv_sec;
|
||||
attr->cat_blocks = inode->i_blocks;
|
||||
attr->cat_uid = from_kuid(&init_user_ns, inode->i_uid);
|
||||
attr->cat_gid = from_kgid(&init_user_ns, inode->i_gid);
|
||||
|
@ -107,11 +107,11 @@ static int vvp_attr_set(const struct lu_env *env, struct cl_object *obj,
|
|||
if (valid & CAT_GID)
|
||||
inode->i_gid = make_kgid(&init_user_ns, attr->cat_gid);
|
||||
if (valid & CAT_ATIME)
|
||||
LTIME_S(inode->i_atime) = attr->cat_atime;
|
||||
inode->i_atime.tv_sec = attr->cat_atime;
|
||||
if (valid & CAT_MTIME)
|
||||
LTIME_S(inode->i_mtime) = attr->cat_mtime;
|
||||
inode->i_mtime.tv_sec = attr->cat_mtime;
|
||||
if (valid & CAT_CTIME)
|
||||
LTIME_S(inode->i_ctime) = attr->cat_ctime;
|
||||
inode->i_ctime.tv_sec = attr->cat_ctime;
|
||||
if (0 && valid & CAT_SIZE)
|
||||
cl_isize_write_nolock(inode, attr->cat_size);
|
||||
/* not currently necessary */
|
||||
|
|
|
@ -518,7 +518,7 @@ static int osc_io_read_start(const struct lu_env *env,
|
|||
|
||||
if (!slice->cis_io->ci_noatime) {
|
||||
cl_object_attr_lock(obj);
|
||||
attr->cat_atime = LTIME_S(CURRENT_TIME);
|
||||
attr->cat_atime = ktime_get_real_seconds();
|
||||
rc = cl_object_attr_set(env, obj, attr, CAT_ATIME);
|
||||
cl_object_attr_unlock(obj);
|
||||
}
|
||||
|
@ -534,7 +534,7 @@ static int osc_io_write_start(const struct lu_env *env,
|
|||
|
||||
OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_SETTIME, 1);
|
||||
cl_object_attr_lock(obj);
|
||||
attr->cat_mtime = attr->cat_ctime = LTIME_S(CURRENT_TIME);
|
||||
attr->cat_mtime = attr->cat_ctime = ktime_get_real_seconds();
|
||||
rc = cl_object_attr_set(env, obj, attr, CAT_MTIME | CAT_CTIME);
|
||||
cl_object_attr_unlock(obj);
|
||||
|
||||
|
|
Loading…
Reference in New Issue