Whamcloud - gitweb
LU-11838 lustre: discard LTIME_S macro
[fs/lustre-release.git] / lustre / llite / llite_lib.c
index a7e8672..b4cbe57 100644 (file)
@@ -1016,7 +1016,7 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt)
        char    *profilenm = get_profile_name(sb);
        struct config_llog_instance *cfg;
        /* %p for void* in printf needs 16+2 characters: 0xffffffffffffffff */
-       const int instlen = sizeof(cfg->cfg_instance) * 2 + 2;
+       const int instlen = 16 + 2;
        unsigned long cfg_instance = ll_get_cfg_instance(sb);
        char name[MAX_STRING_SIZE];
        int md_len = 0;
@@ -1290,9 +1290,9 @@ static struct inode *ll_iget_anon_dir(struct super_block *sb,
                LASSERTF(S_ISDIR(inode->i_mode), "Not slave inode "DFID"\n",
                         PFID(fid));
 
-               LTIME_S(inode->i_mtime) = 0;
-               LTIME_S(inode->i_atime) = 0;
-               LTIME_S(inode->i_ctime) = 0;
+               inode->i_mtime.tv_sec = 0;
+               inode->i_atime.tv_sec = 0;
+               inode->i_ctime.tv_sec = 0;
                inode->i_rdev = 0;
 
 #ifdef HAVE_BACKING_DEV_INFO
@@ -1651,9 +1651,9 @@ int ll_setattr_raw(struct dentry *dentry, struct iattr *attr,
         }
 
         if (attr->ia_valid & (ATTR_MTIME | ATTR_CTIME))
-               CDEBUG(D_INODE, "setting mtime %lu, ctime %lu, now = %llu\n",
-                       LTIME_S(attr->ia_mtime), LTIME_S(attr->ia_ctime),
-                      (s64)ktime_get_real_seconds());
+               CDEBUG(D_INODE, "setting mtime %lld, ctime %lld, now = %lld\n",
+                      (s64)attr->ia_mtime.tv_sec, (s64)attr->ia_ctime.tv_sec,
+                      ktime_get_real_seconds());
 
        if (S_ISREG(inode->i_mode)) {
                if (attr->ia_valid & ATTR_SIZE)
@@ -1946,24 +1946,25 @@ int ll_update_inode(struct inode *inode, struct lustre_md *md)
        inode->i_generation = cl_fid_build_gen(&body->mbo_fid1);
 
        if (body->mbo_valid & OBD_MD_FLATIME) {
-               if (body->mbo_atime > LTIME_S(inode->i_atime))
-                       LTIME_S(inode->i_atime) = body->mbo_atime;
+               if (body->mbo_atime > inode->i_atime.tv_sec)
+                       inode->i_atime.tv_sec = body->mbo_atime;
                lli->lli_atime = body->mbo_atime;
        }
 
        if (body->mbo_valid & OBD_MD_FLMTIME) {
-               if (body->mbo_mtime > LTIME_S(inode->i_mtime)) {
-                       CDEBUG(D_INODE, "setting ino %lu mtime from %lu "
-                              "to %llu\n", inode->i_ino,
-                              LTIME_S(inode->i_mtime), body->mbo_mtime);
-                       LTIME_S(inode->i_mtime) = body->mbo_mtime;
+               if (body->mbo_mtime > inode->i_mtime.tv_sec) {
+                       CDEBUG(D_INODE,
+                              "setting ino %lu mtime from %lld to %llu\n",
+                              inode->i_ino, (s64)inode->i_mtime.tv_sec,
+                              body->mbo_mtime);
+                       inode->i_mtime.tv_sec = body->mbo_mtime;
                }
                lli->lli_mtime = body->mbo_mtime;
        }
 
        if (body->mbo_valid & OBD_MD_FLCTIME) {
-               if (body->mbo_ctime > LTIME_S(inode->i_ctime))
-                       LTIME_S(inode->i_ctime) = body->mbo_ctime;
+               if (body->mbo_ctime > inode->i_ctime.tv_sec)
+                       inode->i_ctime.tv_sec = body->mbo_ctime;
                lli->lli_ctime = body->mbo_ctime;
        }
 
@@ -2049,11 +2050,12 @@ int ll_read_inode2(struct inode *inode, void *opaque)
         /* Core attributes from the MDS first.  This is a new inode, and
          * the VFS doesn't zero times in the core inode so we have to do
          * it ourselves.  They will be overwritten by either MDS or OST
-         * attributes - we just need to make sure they aren't newer. */
-        LTIME_S(inode->i_mtime) = 0;
-        LTIME_S(inode->i_atime) = 0;
-        LTIME_S(inode->i_ctime) = 0;
-        inode->i_rdev = 0;
+        * attributes - we just need to make sure they aren't newer.
+        */
+       inode->i_mtime.tv_sec = 0;
+       inode->i_atime.tv_sec = 0;
+       inode->i_ctime.tv_sec = 0;
+       inode->i_rdev = 0;
        rc = ll_update_inode(inode, md);
        if (rc != 0)
                RETURN(rc);