staging/lustre: use 64-bit inode timestamps internally
authorArnd Bergmann <arnd@arndb.de>
Sun, 27 Sep 2015 20:45:02 +0000 (16:45 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 02:03:33 +0000 (04:03 +0200)
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>
drivers/staging/lustre/lustre/include/cl_object.h
drivers/staging/lustre/lustre/llite/llite_internal.h
drivers/staging/lustre/lustre/llite/vvp_io.c
drivers/staging/lustre/lustre/llite/vvp_object.c
drivers/staging/lustre/lustre/osc/osc_io.c

index 04dcb51117569e40d51fffa582c4528e8581d9bd..90fbaa22e5106784fce6ae4c9342adb8b9b71c8d 100644 (file)
@@ -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.
         *
index 37bf331be5c2c9919824627f99113c853f22e428..fdd0a58286c18e617c98aa9fe3bb21ada13725f3 100644 (file)
@@ -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
index 75a8ea21bc240644984007cb1af54dc78fe5bf97..cf264de0e531657cd34026c745ca942e0172cf59 100644 (file)
@@ -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)));
index b6f6d4cb6e41c2eae11850ce3b08af740cb0ccd6..cb2811b9aae73259da82bd71ffaff9388531ec3c 100644 (file)
@@ -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 */
index fa24e9ed1831427f8ec47c43043a7314d48795cf..be058c289d765c4f1668107f4b8e7c67f25800ba 100644 (file)
@@ -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);