Whamcloud - gitweb
- Niu's changes are back in.
authorbraam <braam>
Thu, 18 Sep 2003 18:12:35 +0000 (18:12 +0000)
committerbraam <braam>
Thu, 18 Sep 2003 18:12:35 +0000 (18:12 +0000)
- Changed utime.c to use a non-null time

lustre/llite/llite_internal.h
lustre/tests/utime.c

index 5bc13f4..486d233 100644 (file)
@@ -158,6 +158,8 @@ int it_disposition(struct lookup_intent *it, int flag);
 void it_set_disposition(struct lookup_intent *it, int flag);
 void ll_read_inode2(struct inode *inode, void *opaque);
 void ll_umount_begin(struct super_block *sb);
+int ll_prep_inode(struct obd_export *exp, struct inode **inode, 
+                struct ptlrpc_request *req, int offset, struct super_block *sb);
 
 /* llite/symlink.c */
 extern struct inode_operations ll_fast_symlink_inode_operations;
index 9fe9f26..43a50e6 100644 (file)
@@ -21,12 +21,16 @@ void usage(char *prog)
 int main(int argc, char *argv[])
 {
        long before_mknod, after_mknod;
-       long before_utime, after_utime;
        const char *prog = argv[0];
        const char *filename = argv[1];
+        struct utimbuf utb;
        struct stat st;
        int rc;
 
+        utb.actime = 0x47114711;
+        utb.modtime = 0x11471147;
+                
+
        if (argc != 2)
                usage(argv[0]);
 
@@ -63,13 +67,10 @@ int main(int argc, char *argv[])
                       prog, before_mknod, before_mknod == st.st_mtime ? "*":"",
                       st.st_mtime, after_mknod);
 
-               sleep(5);
        }
 
        /* See above */
-       before_utime = time(0) - 1;
-       rc = utime(filename, NULL);
-       after_utime = time(0);
+       rc = utime(filename, &utb);
        if (rc) {
                fprintf(stderr, "%s: utime(%s) failed: rc %d: %s\n",
                        prog, filename, errno, strerror(errno));
@@ -83,15 +84,20 @@ int main(int argc, char *argv[])
                return 6;
        }
 
-       if (st.st_mtime < before_utime || st.st_mtime > after_utime) {
-               fprintf(stderr, "%s: bad utime times %lu <= %lu <= %lu false\n",
-                       prog, before_utime, st.st_mtime, after_utime);
+       if (st.st_mtime != utb.modtime ) {
+               fprintf(stderr, "%s: bad utime mtime %lu should be  %lu\n",
+                       prog, st.st_mtime, utb.modtime);
+               return 7;
+       }
+
+       if (st.st_atime != utb.actime ) {
+               fprintf(stderr, "%s: bad utime mtime %lu should be  %lu\n",
+                       prog, st.st_atime, utb.actime);
                return 7;
        }
 
-       printf("%s: good utime times %lu%s <= %lu <= %lu\n",
-              prog, before_utime, before_utime == st.st_mtime ? "*" : "",
-              st.st_mtime, after_utime);
+       printf("%s: good utime mtimes %lu, atime %lu\n",
+              prog, utb.modtime, utb.actime);
 
        return 0;
 }