Skip to contentSkip to conversation

convert /proc/io{mem,ports} to seq_file

PATCH In review Randy.Dunlap 2 participants 2 messages Feb 24, 2003 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 convert /proc/io{mem,ports} to seq_file

Hi,

This patch is to Linux 2.5.62.

This converts /proc/io{mem,ports} to the seq_file interface (single_open).

Please apply.

Thanks,
~Randy

patch_name: seq1-iorescom-2562.patch
patch_version: 2003-02-23.22:27:41
author: Randy.Dunlap <[email protected]>
description: convert /proc/io{ports,mem} to seq_file (single_open)
product: Linux
product_versions: linux-2562
changelog: _
URL: _
requires: _
conflicts: _
diffstat: =

 fs/proc/proc_misc.c    |   16 ------
 include/linux/ioport.h |    3 -
 kernel/resource.c      |  118 +++++++++++++++++++++++++++++++++++++------------
 3 files changed, 91 insertions(+), 46 deletions(-)
include/linux/ioport.h renamed from include/linux/ioport.h%SEQIO +0 -3
diff -Naur ./include/linux/ioport.h%SEQIO ./include/linux/ioport.h
@@ -111,7 +111,4 @@
 extern int __deprecated __check_region(struct resource *, unsigned long, unsigned long);
 extern void __release_region(struct resource *, unsigned long, unsigned long);
 
-#define get_ioport_list(buf)	get_resource_list(&ioport_resource, buf, PAGE_SIZE)
-#define get_mem_list(buf)	get_resource_list(&iomem_resource, buf, PAGE_SIZE)
-
 #endif	/* _LINUX_IOPORT_H */
fs/proc/proc_misc.c renamed from fs/proc/proc_misc.c%SEQIO +0 -16
diff -Naur ./fs/proc/proc_misc.c%SEQIO ./fs/proc/proc_misc.c
@@ -424,13 +424,6 @@
 	return proc_calc_metrics(page, start, off, count, eof, len);
 }
 
-static int ioports_read_proc(char *page, char **start, off_t off,
-				 int count, int *eof, void *data)
-{
-	int len = get_ioport_list(page);
-	return proc_calc_metrics(page, start, off, count, eof, len);
-}
-
 static int cmdline_read_proc(char *page, char **start, off_t off,
 				 int count, int *eof, void *data)
 {
@@ -469,13 +462,6 @@
 	return proc_calc_metrics(page, start, off, count, eof, len);
 }
 
-static int memory_read_proc(char *page, char **start, off_t off,
-				 int count, int *eof, void *data)
-{
-	int len = get_mem_list(page);
-	return proc_calc_metrics(page, start, off, count, eof, len);
-}
-
 /*
  * This function accesses profiling information. The returned data is
  * binary: the sampling step and the actual contents of the profile
@@ -569,13 +555,11 @@
 		{"stat",	kstat_read_proc},
 		{"devices",	devices_read_proc},
 		{"filesystems",	filesystems_read_proc},
-		{"ioports",	ioports_read_proc},
 		{"cmdline",	cmdline_read_proc},
 #ifdef CONFIG_SGI_DS1286
 		{"rtc",		ds1286_read_proc},
 #endif
 		{"locks",	locks_read_proc},
-		{"iomem",	memory_read_proc},
 		{"execdomains",	execdomains_read_proc},
 		{NULL,}
 	};
kernel/resource.c renamed from kernel/resource.c%SEQIO +91 -27

152 lines not on this page · raw message

#1 lore raw
Quoted 5 lines

This patch is to Linux 2.5.62.

This converts /proc/io{mem,ports} to the seq_file interface (single_open).

Nice work! I have some machines that are very close to overflowing a page:

4040 iomem
4082 ioports

Anton