🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #15065

noatime patch for linux.2.0.27

#15065
From: Dan Swartzendruber
Date: Sat, 15 Feb 1997 00:00
103 lines
4022 bytes

As promised, here is the noatime patch for Linux 2.0.27.  I've not done
a lot of patchfile generation, so this might not be the best format.  I'd
be grateful if someone could review this (cleaning it up if necessary, and
suggest somewhere useful to upload it...)

--- linux/mm/filemap.c.orig   Wed Jan 29 08:39:20 1997
+++ linux/mm/filemap.c  Sat Feb  1 16:21:37 1997
@@ -743,7 +743,7 @@
   filp->f_reada = 1;
   if (page_cache)
      free_page(page_cache);
-  if (!IS_RDONLY(inode)) {
+  if (!IS_RDONLY(inode) && !IS_NOATIME(inode)) {
      inode->i_atime = CURRENT_TIME;
      inode->i_dirt = 1;
   }
@@ -1178,7 +1178,7 @@
      return -EACCES;
   if (!inode->i_op || !inode->i_op->readpage)
      return -ENOEXEC;
-  if (!IS_RDONLY(inode)) {
+  if (!IS_RDONLY(inode) && !IS_NOATIME(inode)) {
      inode->i_atime = CURRENT_TIME;
      inode->i_dirt = 1;
   }
--- linux/fs/ext2/dir.c.orig  Fri Dec 22 06:00:19 1995
+++ linux/fs/ext2/dir.c Sat Feb  1 16:12:11 1997
@@ -206,7 +206,7 @@
      offset = 0;
      brelse (bh);
   }
-  if (!IS_RDONLY(inode)) {
+  if (!IS_RDONLY(inode) && !IS_NOATIME(inode)) {
      inode->i_atime = CURRENT_TIME;
      inode->i_dirt = 1;
   }
--- linux/fs/ext2/super.c.orig   Mon Feb  3 12:45:05 1997
+++ linux/fs/ext2/super.c  Mon Feb  3 12:57:23 1997
@@ -140,7 +140,8 @@
  */
 static int parse_options (char * options, unsigned long * sb_block,
           unsigned short *resuid, unsigned short * resgid,
-          unsigned long * mount_options)
+          unsigned long * mount_options,
+          unsigned long * super_flags)
 {
   char * this_char;
   char * value;
@@ -214,6 +215,9 @@
      else if (!strcmp (this_char, "nogrpid") ||
          !strcmp (this_char, "sysvgroups"))
         clear_opt (*mount_options, GRPID);
+     else if (!strcmp (this_char, "noatime")) {
+        *super_flags |= MS_NOATIME;
+     }
      else if (!strcmp (this_char, "resgid")) {
         if (!value || !*value) {
            printk ("EXT2-fs: the resgid option requires "
@@ -378,7 +382,7 @@
   sb->u.ext2_sb.s_mount_opt = 0;
   set_opt (sb->u.ext2_sb.s_mount_opt, CHECK_NORMAL);
   if (!parse_options ((char *) data, &sb_block, &resuid, &resgid,
-      &sb->u.ext2_sb.s_mount_opt)) {
+      &sb->u.ext2_sb.s_mount_opt, &sb->s_flags)) {
      sb->s_dev = 0;
      return NULL;
   }
@@ -643,7 +647,7 @@
    */
   new_mount_opt = EXT2_MOUNT_CHECK_NORMAL;
   if (!parse_options (data, &tmp, &resuid, &resgid,
-            &new_mount_opt))
+            &new_mount_opt, &sb->s_flags))
      return -EINVAL;
 
   sb->u.ext2_sb.s_mount_opt = new_mount_opt;
--- linux/include/linux/fs.h.orig   Sat Feb  1 15:21:33 1997
+++ linux/include/linux/fs.h  Sat Feb  1 15:59:59 1997
@@ -72,6 +72,7 @@
 #define S_WRITE     128   /* Write on file/directory/symlink */
 #define S_APPEND 256   /* Append-only file */
 #define S_IMMUTABLE 512   /* Immutable file */
+#define MS_NOATIME  1024  /* Don't update atime */
 
 /*
  * Flags that can be altered by MS_REMOUNT
@@ -101,6 +102,7 @@
 #define IS_WRITABLE(inode) ((inode)->i_flags & S_WRITE)
 #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
 #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
+#define IS_NOATIME(inode) ((inode)->i_flags & MS_NOATIME)
 
 /* the read-only stuff doesn't really belong here, but any other place is
    probably as bad and I don't want to create yet another include file. */

-- 

Dan Swartzendruber


Technical Details
Message-ID: <dswartz-1502972104150001@accord.druber.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <dswartz-1502972104150001@accord.druber.com>
Subject: noatime patch for linux.2.0.27
Date: Sat, 15 Feb 1997 00:00:00 +0000
From: dswartz@druber.com (Dan Swartzendruber)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 219085035
Organization: Swartzendruber Consulting
Newsgroups: news.software.nntp