Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > by-pkgid > 7f9e18511336b1bbbdf914d376d524ba > files > 19

mkinitrd-6.0.63-17.1mnb2.src.rpm

diff -p -up mkinitrd-6.0.62/nash/mount_constants.h.relatime mkinitrd-6.0.62/nash/mount_constants.h
--- mkinitrd-6.0.62/nash/mount_constants.h.relatime	2008-08-11 18:14:54.000000000 +0200
+++ mkinitrd-6.0.62/nash/mount_constants.h	2008-08-19 16:26:35.000000000 +0200
@@ -26,6 +26,7 @@
 #define MS_MANDLOCK	64	/* Allow mandatory locks on an FS */
 #define MS_NOATIME	1024	/* Do not update access times. */
 #define MS_NODIRATIME   2048    /* Do not update directory access times */
+#define MS_RELATIME	(1<<21)	/* Update atime relative to mtime/ctime. */
 /*
  * Magic mount flag number. Has to be or-ed to the flag values.
  */
diff -p -up mkinitrd-6.0.62/nash/nash.c.relatime mkinitrd-6.0.62/nash/nash.c
--- mkinitrd-6.0.62/nash/nash.c.relatime	2008-08-19 16:26:35.000000000 +0200
+++ mkinitrd-6.0.62/nash/nash.c	2008-08-19 16:29:40.000000000 +0200
@@ -118,6 +118,10 @@
 #define MS_MOVE 8192
 #endif
 
+#ifndef MS_RELATIME
+#define MS_RELATIME (1<<21)
+#endif
+
 #ifndef MNT_FORCE
 #define MNT_FORCE 0x1
 #endif
@@ -455,6 +459,10 @@ mountCommand(char * cmd, char * end)
                 flags |= MS_NOATIME;
             else if (!strcmp(start, "atime"))
                 flags &= ~MS_NOATIME;
+	    else if (!strcmp(start, "relatime"))
+		flags |= MS_RELATIME;
+	    else if (!strcmp(start, "norelatime"))
+		flags &= ~MS_RELATIME;
             else if (!strcmp(start, "remount"))
                 flags |= MS_REMOUNT;
             else if (!strcmp(start, "bind"))
@@ -485,7 +493,7 @@ mountCommand(char * cmd, char * end)
     }
 
     if (_nash_context->testing) {
-        printf("mount %s%s%s-t '%s' '%s' '%s' (%s%s%s%s%s%s%s)\n",
+        printf("mount %s%s%s-t '%s' '%s' '%s' (%s%s%s%s%s%s%s%s)\n",
                 nfs_opts ? "-o '" : "",
                 nfs_opts ? nfs_opts : "",
                 nfs_opts ? "\' " : "",
@@ -496,7 +504,8 @@ mountCommand(char * cmd, char * end)
                 (flags & MS_NOEXEC) ? "noexec " : "",
                 (flags & MS_SYNCHRONOUS) ? "sync " : "",
                 (flags & MS_REMOUNT) ? "remount " : "",
-                (flags & MS_NOATIME) ? "noatime " : ""
+                (flags & MS_NOATIME) ? "noatime " : "",
+                (flags & MS_RELATIME) ? "relatime " : ""
             );
     } else {
         char *mount_opts = NULL;