mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Andrew Morton <akpm@osdl.org>, Wu Fengguang <wfg@mail.ustc.edu.cn>
Cc: linux-kernel@vger.kernel.org
Subject: [-mm patch] mm/readahead.c: cleanups
Date: Fri, 23 Jun 2006 12:56:17 +0200	[thread overview]
Message-ID: <20060623105617.GS9111@stusta.de> (raw)
In-Reply-To: <20060621034857.35cfe36f.akpm@osdl.org>

This patch contains the following cleanups:
- make needlessly global code static
- rename the global variable debug_level (sic) to readahead_debug_level
- proper extern declaration for readahead_debug_level in 
  include/linux/mm.h

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 include/linux/mm.h |    6 ++++++
 mm/filemap.c       |   12 +++---------
 mm/readahead.c     |   19 +++++++++----------
 3 files changed, 18 insertions(+), 19 deletions(-)

--- linux-2.6.17-mm1-full/include/linux/mm.h.old	2006-06-22 22:04:21.000000000 +0200
+++ linux-2.6.17-mm1-full/include/linux/mm.h	2006-06-22 22:09:13.000000000 +0200
@@ -1062,6 +1062,12 @@
 #endif
 }
 
+#ifdef CONFIG_DEBUG_READAHEAD
+extern u32 readahead_debug_level;
+#else
+#define readahead_debug_level 0
+#endif /* CONFIG_DEBUG_READAHEAD */
+
 /* Do stack extension */
 extern int expand_stack(struct vm_area_struct *vma, unsigned long address);
 #ifdef CONFIG_IA64
--- linux-2.6.17-mm1-full/mm/readahead.c.old	2006-06-22 20:57:07.000000000 +0200
+++ linux-2.6.17-mm1-full/mm/readahead.c	2006-06-23 00:31:25.000000000 +0200
@@ -102,10 +102,10 @@
 };
 
 #ifdef CONFIG_DEBUG_READAHEAD
-u32 initial_ra_hit;
-u32 initial_ra_miss;
-u32 debug_level = 1;
-u32 disable_stateful_method = 0;
+static u32 initial_ra_hit;
+static u32 initial_ra_miss;
+u32 readahead_debug_level = 1;
+static u32 disable_stateful_method = 0;
 static const char * const ra_class_name[];
 static void ra_account(struct file_ra_state *ra, enum ra_event e, int pages);
 #  define debug_inc(var)		do { var++; } while (0)
@@ -114,13 +114,12 @@
 #  define ra_account(ra, e, pages)	do { } while (0)
 #  define debug_inc(var)		do { } while (0)
 #  define debug_option(o)		(0)
-#  define debug_level 			(0)
 #endif /* CONFIG_DEBUG_READAHEAD */
 
 #define dprintk(args...) \
-	do { if (debug_level >= 2) printk(KERN_DEBUG args); } while(0)
+	do { if (readahead_debug_level >= 2) printk(KERN_DEBUG args); } while(0)
 #define ddprintk(args...) \
-	do { if (debug_level >= 3) printk(KERN_DEBUG args); } while(0)
+	do { if (readahead_debug_level >= 3) printk(KERN_DEBUG args); } while(0)
 
 void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page)
 {
@@ -2011,7 +2010,7 @@
 {
 	enum ra_class c;
 
-	if (!debug_level)
+	if (!readahead_debug_level)
 		return;
 
 	if (e == RA_EVENT_READAHEAD_HIT && pages < 0) {
@@ -2142,7 +2141,7 @@
 	return 1;
 }
 
-struct file_operations ra_events_fops = {
+static struct file_operations ra_events_fops = {
 	.owner		= THIS_MODULE,
 	.open		= ra_events_open,
 	.write		= ra_events_write,
@@ -2168,7 +2167,7 @@
 	READAHEAD_DEBUGFS_ENTRY_U32(initial_ra_hit);
 	READAHEAD_DEBUGFS_ENTRY_U32(initial_ra_miss);
 
-	READAHEAD_DEBUGFS_ENTRY_U32(debug_level);
+	debugfs_create_u32("debug_level", 0644, root, &readahead_debug_level);
 	READAHEAD_DEBUGFS_ENTRY_BOOL(disable_stateful_method);
 
 	return 0;
--- linux-2.6.17-mm1-full/mm/filemap.c.old	2006-06-22 22:03:34.000000000 +0200
+++ linux-2.6.17-mm1-full/mm/filemap.c	2006-06-22 22:06:37.000000000 +0200
@@ -45,12 +45,6 @@
 generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
 	loff_t offset, unsigned long nr_segs);
 
-#ifdef CONFIG_DEBUG_READAHEAD
-extern u32 debug_level;
-#else
-#define debug_level 0
-#endif /* CONFIG_DEBUG_READAHEAD */
-
 /*
  * Shared mappings implemented 30.11.1994. It's not fully working yet,
  * though.
@@ -937,7 +931,7 @@
 	if (!isize)
 		goto out;
 
-	if (debug_level >= 5)
+	if (readahead_debug_level >= 5)
 		printk(KERN_DEBUG "read-file(ino=%lu, req=%lu+%lu)\n",
 			inode->i_ino, index, last_index - index);
 
@@ -995,7 +989,7 @@
 		if (prefer_adaptive_readahead())
 			readahead_cache_hit(&ra, page);
 
-		if (debug_level >= 7)
+		if (readahead_debug_level >= 7)
 			printk(KERN_DEBUG "read-page(ino=%lu, idx=%lu, io=%s)\n",
 				inode->i_ino, index,
 				PageUptodate(page) ? "hit" : "miss");
@@ -1524,7 +1518,7 @@
 	if (prefer_adaptive_readahead())
 		readahead_cache_hit(ra, page);
 
-	if (debug_level >= 6)
+	if (readahead_debug_level >= 6)
 		printk(KERN_DEBUG "read-mmap(ino=%lu, idx=%lu, hint=%s, io=%s)\n",
 			inode->i_ino, pgoff,
 			VM_RandomReadHint(area) ? "random" :


  parent reply	other threads:[~2006-06-23 10:57 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21 10:48 2.6.17-mm1 Andrew Morton
2006-06-21 11:07 ` 2.6.17-mm1 Michal Piotrowski
2006-06-21 11:17   ` 2.6.17-mm1 Andrew Morton
2006-06-21 11:29     ` 2.6.17-mm1 Michal Piotrowski
2006-06-21 13:53       ` 2.6.17-mm1 Cedric Le Goater
2006-06-21 14:13         ` 2.6.17-mm1 Michal Piotrowski
2006-06-21 16:44         ` 2.6.17-mm1 H. Peter Anvin
2006-06-21 19:26           ` 2.6.17-mm1 Cedric Le Goater
2006-06-21 21:46           ` 2.6.17-mm1 Michal Piotrowski
2006-06-21 11:28 ` 2.6.17-mm1 Andrew Morton
2006-06-21 15:35   ` 2.6.17-mm1 Christoph Lameter
2006-06-21 12:06 ` 2.6.17-mm1 Michal Piotrowski
2006-06-21 15:10 ` [-mm patch] drivers/net/ni5010.c: fix compile error Adrian Bunk
2006-06-22  8:13   ` Andreas Mohr
2006-06-22  8:45     ` Adrian Bunk
2006-06-21 18:22 ` [PATCH] pi-futex-rt-mutex-core-merge.patch (was Re: 2.6.17-mm1 Valdis.Kletnieks
2006-06-21 21:48 ` swsusp regression [Was: 2.6.17-mm1] Jiri Slaby
2006-06-21 22:14   ` Mattia Dongili
2006-06-21 22:18     ` Mattia Dongili
2006-06-22  6:19     ` [linux-pm] " Greg KH
2006-06-22  7:46       ` Andrew Morton
2006-06-22  8:25         ` Jeremy Fitzhardinge
2006-06-22 15:51         ` Alan Stern
2006-06-22 17:17           ` Jeremy Fitzhardinge
2006-06-22 18:46           ` Greg KH
2006-06-22 19:07             ` Greg KH
2006-06-22 19:57             ` Alan Stern
2006-06-22 20:22               ` Greg KH
2006-06-22 20:38               ` Jiri Slaby
2006-06-22 21:09                 ` Alan Stern
2006-06-22 21:11                   ` Greg KH
2006-06-22 16:04         ` Frederik Deweerdt
2006-06-22 16:25           ` Andrew Morton
2006-06-22 19:07             ` Frederik Deweerdt
2006-06-23  9:02             ` Frederik Deweerdt
2006-06-23  9:10               ` Pavel Machek
2006-06-23  9:31                 ` Andrew Morton
2006-06-23 12:12                 ` Frederik Deweerdt
2006-06-23 12:57                   ` Pavel Machek
2006-06-23 13:47                     ` Frederik Deweerdt
2006-06-23 19:57                     ` Andrew Morton
2006-06-26  9:00                       ` Frederik Deweerdt
2006-06-23 19:41                 ` Russell King
2006-06-23 20:22                   ` Dave Jones
2006-06-23 21:10                   ` Rafael J. Wysocki
2006-06-23 22:11                   ` Pavel Machek
2006-06-23 23:53                     ` Frederik Deweerdt
2006-06-24 17:16                       ` Rafael J. Wysocki
2006-06-21 21:57 ` [-mm patch] drivers/acpi/scan.c: make acpi_bus_type static Adrian Bunk
2006-06-21 21:57 ` [-mm patch] drivers/ide/legacy/ide-cs.c: make 2 functions static Adrian Bunk
2006-06-21 21:57 ` [-mm patch] drivers/md/md.c: make code static Adrian Bunk
2006-06-21 21:57 ` [-mm patch] drivers/media/video/vivi.c: make 2 functions static Adrian Bunk
2006-06-21 21:57 ` [-mm patch] gpio: make two mutexes static again Adrian Bunk
2006-06-21 22:54 ` [-mm patch] drivers/scsi/qla2xxx/: make some functions static Adrian Bunk
2006-06-21 23:20 ` [-mm patch] make drivers/scsi/pata_pcmcia.c:pcmcia_remove_one() static Adrian Bunk
2006-06-22 10:50   ` Alan Cox
2006-06-21 23:37 ` [-mm patch] make drivers/usb/misc/cy7c63.c:vendor_command() static Adrian Bunk
2006-06-21 23:39 ` 2.6.17-mm1 : two PF flags with the same value Peter Williams
2006-06-21 23:44   ` Andrew Morton
2006-06-22  0:12   ` Paul Jackson
2006-06-22 10:03 ` [-mm patch] #if 0 drivers/usb/input/hid-core.c:hid_find_field_by_usage() Adrian Bunk
2006-06-22 10:03 ` [-mm patch] fs/gfs2/: make code static Adrian Bunk
2006-06-22 10:25   ` Steven Whitehouse
2006-06-22 14:58 ` 2.6.17-mm1 Franck Bui-Huu
2006-06-22 15:20   ` 2.6.17-mm1 Mel Gorman
2006-06-22 15:50     ` 2.6.17-mm1 Franck Bui-Huu
2006-06-22 15:54       ` 2.6.17-mm1 Mel Gorman
2006-06-22 16:14         ` 2.6.17-mm1 Russell King
2006-06-22 16:50           ` 2.6.17-mm1 Mel Gorman
2006-06-22 17:25         ` 2.6.17-mm1 Franck Bui-Huu
2006-06-23 10:20           ` 2.6.17-mm1 Mel Gorman
2006-06-23 12:22             ` 2.6.17-mm1 Franck Bui-Huu
2006-06-23 12:56               ` 2.6.17-mm1 Franck Bui-Huu
2006-06-23 13:46               ` 2.6.17-mm1 Mel Gorman
2006-06-23 14:52                 ` 2.6.17-mm1 Franck Bui-Huu
2006-06-23 15:06                 ` 2.6.17-mm1 Franck Bui-Huu
2006-06-23 15:13                   ` 2.6.17-mm1 Mel Gorman
2006-06-23 15:51                     ` 2.6.17-mm1 Franck Bui-Huu
2006-06-23 16:38                       ` 2.6.17-mm1 Mel Gorman
2006-06-26  8:31                         ` 2.6.17-mm1 Franck Bui-Huu
2006-06-26 10:37                           ` 2.6.17-mm1 Mel Gorman
2006-06-26 11:31                             ` 2.6.17-mm1 Franck Bui-Huu
2006-06-26 13:22                               ` 2.6.17-mm1 Mel Gorman
2006-06-26 13:49                                 ` 2.6.17-mm1 Franck Bui-Huu
2006-06-26 14:31                                   ` 2.6.17-mm1 Mel Gorman
2006-06-26 15:05                                     ` 2.6.17-mm1 Franck Bui-Huu
2006-06-26 15:15                                       ` 2.6.17-mm1 Mel Gorman
2006-06-23 15:14                   ` 2.6.17-mm1 Franck Bui-Huu
2006-06-23 19:55                     ` 2.6.17-mm1 Russell King
2006-06-22 15:52 ` 2.6.17-mm1: kernel/lockdep.c: write-only variables Adrian Bunk
2006-06-23  7:26   ` Ingo Molnar
2006-06-23  7:49     ` Ingo Molnar
2006-06-22 21:34 ` 2.6.17-mm1: UML failing w/o SKAS enabled Theodore Tso
2006-06-22 21:57   ` Andrew Morton
2006-06-23  2:54     ` Jeff Dike
2006-06-23 10:10       ` Roman Zippel
2006-06-23 14:28         ` Jeff Dike
2006-06-26 11:52           ` Roman Zippel
2006-06-29 21:13             ` Jeff Dike
2006-06-23  2:42   ` Jeff Dike
2006-06-23 21:07     ` Theodore Tso
2006-06-23 21:46       ` Jeff Dike
2006-06-24 12:43         ` Theodore Tso
2006-06-24 15:18           ` Jeff Dike
2006-06-24 14:00         ` Theodore Tso
2006-06-24 15:22           ` Jeff Dike
2006-06-24 15:38             ` Theodore Tso
2006-06-24 16:06             ` Thomas Gleixner
2006-06-25 16:08               ` Jeff Dike
2006-06-23 10:55 ` [-mm patch] fs/reiser4/: possible cleanups Adrian Bunk
2006-06-23 15:54   ` Hans Reiser
2006-06-23 10:55 ` [-mm patch] fs/ufs/inode.c: make 2 functions static Adrian Bunk
2006-06-23 10:55 ` [-mm patch] make ipc/sem.c:exit_sem() static Adrian Bunk
2006-06-23 10:55 ` [-mm patch] kernel/lockdep.c: make 3 functions static Adrian Bunk
2006-06-23 11:08   ` Ingo Molnar
2006-06-23 10:55 ` [-mm patch] drivers/char/agp/nvidia-agp.c: remove unused variable Adrian Bunk
2006-06-23 10:55 ` [-mm patch] make kernel/sysctl.c:_proc_do_string() static Adrian Bunk
2006-06-23 10:55 ` [-mm patch] make kernel/utsname.c:clone_uts_ns() Adrian Bunk
2006-06-23 16:35   ` Serge E. Hallyn
2006-06-23 10:56 ` Adrian Bunk [this message]
2006-06-24  6:00   ` [-mm patch] mm/readahead.c: cleanups Andrew Morton
2006-06-23 12:33 ` 2.6.17-mm1 Michal Piotrowski
2006-06-23 20:42   ` 2.6.17-mm1 Andrew Morton
2006-06-23 15:48 ` 2.6.17-mm1 Eduard Bloch
2006-06-23 16:42   ` 2.6.17-mm1 Jiri Slaby
2006-06-23 20:39 ` 2.6.17-mm1 Keith Mannthey
2006-06-23 21:32   ` 2.6.17-mm1 Andrew Morton
2006-06-24 21:27     ` 2.6.17-mm1 Sam Ravnborg
2006-06-24 21:53       ` 2.6.17-mm1 Andrew Morton
2006-07-02 18:54         ` 2.6.17-mm1 Tom Rini

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=20060623105617.GS9111@stusta.de \
    --to=bunk@stusta.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wfg@mail.ustc.edu.cn \
    /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

Powered by JetHome