mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugang <hugang@soulinfo.com>
To: Bart Samwel <bart@samwel.tk>,
	linux-kernel@vger.kernel.org, Jens Axboe <axboe@suse.de>
Subject: Re: [PATCH] laptop-mode for 2.6, version 2
Date: Wed, 24 Dec 2003 21:51:20 +0800	[thread overview]
Message-ID: <20031224215120.66b74f66.hugang@soulinfo.com> (raw)
In-Reply-To: <3FE92517.1000306@samwel.tk>

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

On Wed, 24 Dec 2003 06:33:11 +0100
Bart Samwel <bart@samwel.tk> wrote:

> Here's a new version of the laptop-mode patch (and control script). I've
> made a couple of improvements because of your comments. The block_dump
> functionality (including block dirtying) is back, and my alternative
> functionality has gone. There's just one bit of the block dumping patch 
> that I couldn't place, the bit in filemap.c. The 2.6 code is so 
> different here that I really couldn't figure out what I should do with 
> it. Do you have any idea where this has gone (and if it is still needed)?

Here is hacker patch do laptop mode on reiserfs file system. Any comments are welcome.

-- 
Hu Gang / Steve
RLU#          : 204016 [1999] (Registered Linux user)
GPG Public Key: http://soulinfo.com/~hugang/HuGang.asc

[-- Attachment #2: reiserfs_laptop_mode --]
[-- Type: application/octet-stream, Size: 2445 bytes --]

Index: linux-2.6.0/fs/reiserfs/super.c
===================================================================
--- linux-2.6.0/fs/reiserfs/super.c	(revision 94)
+++ linux-2.6.0/fs/reiserfs/super.c	(working copy)
@@ -662,6 +662,7 @@
 	{"resize", 'r', 0, 0, 0},
 	{"jdev", 'j', 0, 0, 0},
 	{"nolargeio", 'w', 0, 0, 0},
+	{"commit", 'c', 0, 0, 0},
 	{NULL, 0, 0, 0, 0}
     };
 	
@@ -690,6 +691,21 @@
 	    }
 	}
 
+	if ( c == 'c' ) {
+		extern int reiserfs_default_max_commit_age;
+		char *p = 0;
+		int val = simple_strtoul (arg, &p, 0);
+
+		if ( *p != '\0') {
+			printk ("reiserfs_parse_options: bad value %s\n", arg);
+			return 0;
+		}
+		if ( val ) 
+			reiserfs_default_max_commit_age = val;
+		else 
+			reiserfs_default_max_commit_age = -1;
+	}
+
 	if ( c == 'w' ) {
 		char *p=0;
 		int val = simple_strtoul (arg, &p, 0);
Index: linux-2.6.0/fs/reiserfs/journal.c
===================================================================
--- linux-2.6.0/fs/reiserfs/journal.c	(revision 94)
+++ linux-2.6.0/fs/reiserfs/journal.c	(working copy)
@@ -1964,6 +1964,8 @@
 	return result;
 }
 
+int reiserfs_default_max_commit_age = -1;
+
 /*
 ** must be called once on fs mount.  calls journal_read for you
 */
@@ -2032,7 +2034,11 @@
      
   SB_JOURNAL_TRANS_MAX(p_s_sb)      = le32_to_cpu (jh->jh_journal.jp_journal_trans_max);
   SB_JOURNAL_MAX_BATCH(p_s_sb)      = le32_to_cpu (jh->jh_journal.jp_journal_max_batch);
-  SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb) = le32_to_cpu (jh->jh_journal.jp_journal_max_commit_age);
+  if (reiserfs_default_max_commit_age != -1) {
+	  SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb) = reiserfs_default_max_commit_age;
+  } else {
+	  SB_JOURNAL_MAX_COMMIT_AGE(p_s_sb) = le32_to_cpu (jh->jh_journal.jp_journal_max_commit_age);
+  }
   SB_JOURNAL_MAX_TRANS_AGE(p_s_sb)  = JOURNAL_MAX_TRANS_AGE;
 
   if (SB_JOURNAL_TRANS_MAX(p_s_sb)) {
Index: linux-2.6.0/fs/reiserfs/procfs.c
===================================================================
--- linux-2.6.0/fs/reiserfs/procfs.c	(revision 94)
+++ linux-2.6.0/fs/reiserfs/procfs.c	(working copy)
@@ -401,7 +401,7 @@
                         DJP( jp_journal_trans_max ),
                         DJP( jp_journal_magic ),
                         DJP( jp_journal_max_batch ),
-                        DJP( jp_journal_max_commit_age ),
+                        SB_JOURNAL_MAX_COMMIT_AGE(sb), 
                         DJP( jp_journal_max_trans_age ),
 
 			JF( j_1st_reserved_block ),			

  parent reply	other threads:[~2003-12-24 13:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-24  5:33 Bart Samwel
2003-12-24 11:16 ` Jens Axboe
2003-12-24 15:25   ` [PATCH] laptop-mode for 2.6, version 3 Bart Samwel
2003-12-25 10:06     ` Arnaldo Carvalho de Melo
2003-12-25 15:12       ` [PATCH] laptop-mode for 2.6, version 4 + smart_spindown Bart Samwel
2003-12-25 17:04         ` John Bradford
2003-12-25 21:39           ` Bart Samwel
2003-12-27 10:57         ` A couple of questions about laptop-mode for 2.6, version 4 Kiko Piris
2003-12-24 13:51 ` Hugang [this message]
2003-12-24 14:24   ` [PATCH] laptop-mode for 2.6, version 2 Nikita Danilov
2003-12-25  2:59     ` Hugang
     [not found]       ` <16362.43831.569086.825899@laputa.namesys.com>
2003-12-25  9:40         ` Hugang
2003-12-25 10:27           ` Nikita Danilov
2003-12-25 10:59             ` Hugang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20031224215120.66b74f66.hugang@soulinfo.com \
    --to=hugang@soulinfo.com \
    --cc=axboe@suse.de \
    --cc=bart@samwel.tk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®