summaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/array.c25
-rw-r--r--fs/proc/base.c7
-rw-r--r--fs/proc/fd.c7
-rw-r--r--fs/proc/generic.c38
-rw-r--r--fs/proc/kmsg.c7
-rw-r--r--fs/proc/link.c7
-rw-r--r--fs/proc/mem.c9
-rw-r--r--fs/proc/net.c7
-rw-r--r--fs/proc/omirr.c38
-rw-r--r--fs/proc/proc_devtree.c6
-rw-r--r--fs/proc/root.c48
-rw-r--r--fs/proc/scsi.c37
-rw-r--r--fs/proc/sysvipc.c37
13 files changed, 170 insertions, 103 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 1bc76ff2f..5e88d0566 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -348,7 +348,7 @@ static int get_meminfo(char * buffer)
len = sprintf(buffer, " total: used: free: shared: buffers: cached:\n"
"Mem: %8lu %8lu %8lu %8lu %8lu %8lu\n"
"Swap: %8lu %8lu %8lu\n",
- i.totalram, i.totalram-i.freeram, i.freeram, i.sharedram, i.bufferram, page_cache_size*PAGE_SIZE,
+ i.totalram, i.totalram-i.freeram, i.freeram, i.sharedram, i.bufferram, atomic_read(&page_cache_size)*PAGE_SIZE,
i.totalswap, i.totalswap-i.freeswap, i.freeswap);
/*
* Tagged format, for easy grepping and expansion. The above will go away
@@ -359,14 +359,14 @@ static int get_meminfo(char * buffer)
"MemFree: %8lu kB\n"
"MemShared: %8lu kB\n"
"Buffers: %8lu kB\n"
- "Cached: %8lu kB\n"
+ "Cached: %8u kB\n"
"SwapTotal: %8lu kB\n"
"SwapFree: %8lu kB\n",
i.totalram >> 10,
i.freeram >> 10,
i.sharedram >> 10,
i.bufferram >> 10,
- page_cache_size << (PAGE_SHIFT - 10),
+ atomic_read(&page_cache_size) << (PAGE_SHIFT - 10),
i.totalswap >> 10,
i.freeswap >> 10);
}
@@ -997,7 +997,7 @@ static inline void statm_pte_range(pmd_t * pmd, unsigned long address, unsigned
++*dirty;
if (MAP_NR(pte_page(page)) >= max_mapnr)
continue;
- if (atomic_read(&mem_map[MAP_NR(pte_page(page))].count) > 1)
+ if (page_count(mem_map + MAP_NR(pte_page(page))) > 1)
++*shared;
} while (address < end);
}
@@ -1348,6 +1348,9 @@ static long get_root_array(char * page, int type, char **start,
case PROC_IOPORTS:
return get_ioport_list(page);
+
+ case PROC_MEMORY:
+ return get_mem_list(page);
#ifdef CONFIG_BLK_DEV_MD
case PROC_MD:
return get_md_status(page);
@@ -1542,11 +1545,14 @@ struct inode_operations proc_array_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
static ssize_t arraylong_read(struct file * file, char * buf,
@@ -1590,9 +1596,12 @@ struct inode_operations proc_arraylong_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
diff --git a/fs/proc/base.c b/fs/proc/base.c
index c9b2d8649..8579dd8c5 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -45,11 +45,14 @@ static struct inode_operations proc_base_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
/*
diff --git a/fs/proc/fd.c b/fs/proc/fd.c
index 1defdbae1..2bbb51d28 100644
--- a/fs/proc/fd.c
+++ b/fs/proc/fd.c
@@ -51,11 +51,14 @@ struct inode_operations proc_fd_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- proc_permission /* permission */
+ proc_permission, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
/*
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index 54b16f84b..4e59fed73 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -51,20 +51,23 @@ struct inode_operations proc_file_inode_operations = {
&proc_file_operations, /* default proc file-ops */
NULL, /* create */
NULL, /* lookup */
- NULL, /* link */
- NULL, /* unlink */
- NULL, /* symlink */
- NULL, /* mkdir */
- NULL, /* rmdir */
- NULL, /* mknod */
- NULL, /* rename */
- NULL, /* readlink */
- NULL, /* follow_link */
- NULL, /* readpage */
- NULL, /* writepage */
- NULL, /* bmap */
- NULL, /* truncate */
- NULL /* permission */
+ NULL, /* link */
+ NULL, /* unlink */
+ NULL, /* symlink */
+ NULL, /* mkdir */
+ NULL, /* rmdir */
+ NULL, /* mknod */
+ NULL, /* rename */
+ NULL, /* readlink */
+ NULL, /* follow_link */
+ NULL, /* bmap */
+ NULL, /* readpage */
+ NULL, /* writepage */
+ NULL, /* flushpage */
+ NULL, /* truncate */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
/*
@@ -83,11 +86,14 @@ struct inode_operations proc_net_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
diff --git a/fs/proc/kmsg.c b/fs/proc/kmsg.c
index ba78768b6..3cfccab96 100644
--- a/fs/proc/kmsg.c
+++ b/fs/proc/kmsg.c
@@ -72,9 +72,12 @@ struct inode_operations proc_kmsg_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
diff --git a/fs/proc/link.c b/fs/proc/link.c
index 9df4de674..3a5639825 100644
--- a/fs/proc/link.c
+++ b/fs/proc/link.c
@@ -49,11 +49,14 @@ struct inode_operations proc_link_inode_operations = {
NULL, /* rename */
proc_readlink, /* readlink */
proc_follow_link, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- proc_permission /* permission */
+ proc_permission, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
static struct dentry * proc_follow_link(struct dentry *dentry,
diff --git a/fs/proc/mem.c b/fs/proc/mem.c
index 117587d8d..0e89f7645 100644
--- a/fs/proc/mem.c
+++ b/fs/proc/mem.c
@@ -298,7 +298,7 @@ int mem_mmap(struct file * file, struct vm_area_struct * vma)
set_pte(dest_table, *src_table);
mapnr = MAP_NR(pte_page(*src_table));
if (mapnr < max_mapnr)
- atomic_inc(&mem_map[MAP_NR(pte_page(*src_table))].count);
+ get_page(mem_map + MAP_NR(pte_page(*src_table)));
stmp += PAGE_SIZE;
dtmp += PAGE_SIZE;
@@ -336,9 +336,12 @@ struct inode_operations proc_mem_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- proc_permission /* permission */
+ proc_permission, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
diff --git a/fs/proc/net.c b/fs/proc/net.c
index a6d8c5616..1ad226de0 100644
--- a/fs/proc/net.c
+++ b/fs/proc/net.c
@@ -113,9 +113,12 @@ struct inode_operations proc_net_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
diff --git a/fs/proc/omirr.c b/fs/proc/omirr.c
index dbf2b32b9..562aa11c5 100644
--- a/fs/proc/omirr.c
+++ b/fs/proc/omirr.c
@@ -277,22 +277,24 @@ static struct file_operations omirr_operations = {
};
struct inode_operations proc_omirr_inode_operations = {
- &omirr_operations,
- NULL, /* create */
- NULL, /* lookup */
- NULL, /* link */
- NULL, /* unlink */
- NULL, /* symlink */
- NULL, /* mkdir */
- NULL, /* rmdir */
- NULL, /* mknod */
- NULL, /* rename */
- NULL, /* readlink */
- NULL, /* follow_link */
- NULL, /* readpage */
- NULL, /* writepage */
- NULL, /* bmap */
- NULL, /* truncate */
- NULL, /* permission */
- NULL /* smap */
+ &omirr_operations,
+ NULL, /* create */
+ NULL, /* lookup */
+ NULL, /* link */
+ NULL, /* unlink */
+ NULL, /* symlink */
+ NULL, /* mkdir */
+ NULL, /* rmdir */
+ NULL, /* mknod */
+ NULL, /* rename */
+ NULL, /* readlink */
+ NULL, /* follow_link */
+ NULL, /* bmap */
+ NULL, /* readpage */
+ NULL, /* writepage */
+ NULL, /* flushpage */
+ NULL, /* truncate */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
diff --git a/fs/proc/proc_devtree.c b/fs/proc/proc_devtree.c
index cd4aca324..594f00858 100644
--- a/fs/proc/proc_devtree.c
+++ b/fs/proc/proc_devtree.c
@@ -57,12 +57,14 @@ struct inode_operations devtree_symlink_inode_operations = {
NULL, /* rename */
devtree_readlink, /* readlink */
devtree_follow_link, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
NULL, /* permission */
- NULL /* smap */
+ NULL, /* smap */
+ NULL /* revalidate */
};
static struct dentry *devtree_follow_link(struct dentry *dentry,
diff --git a/fs/proc/root.c b/fs/proc/root.c
index f6a775359..67171fa07 100644
--- a/fs/proc/root.c
+++ b/fs/proc/root.c
@@ -71,11 +71,14 @@ struct inode_operations proc_dir_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
/*
@@ -94,11 +97,14 @@ struct inode_operations proc_dyna_dir_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
/*
@@ -136,11 +142,14 @@ static struct inode_operations proc_root_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
/*
@@ -293,11 +302,14 @@ struct inode_operations proc_openprom_inode_operations = {
NULL, /* rename */
NULL, /* readlink */
NULL, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
struct proc_dir_entry proc_openprom = {
@@ -478,11 +490,14 @@ static struct inode_operations proc_self_inode_operations = {
NULL, /* rename */
proc_self_readlink, /* readlink */
proc_self_follow_link, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
static struct inode_operations proc_link_inode_operations = {
@@ -498,11 +513,14 @@ static struct inode_operations proc_link_inode_operations = {
NULL, /* rename */
proc_readlink, /* readlink */
proc_follow_link, /* follow_link */
+ NULL, /* bmap */
NULL, /* readpage */
NULL, /* writepage */
- NULL, /* bmap */
+ NULL, /* flushpage */
NULL, /* truncate */
- NULL /* permission */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
static struct proc_dir_entry proc_root_loadavg = {
@@ -621,6 +639,11 @@ static struct proc_dir_entry proc_root_ioports = {
S_IFREG | S_IRUGO, 1, 0, 0,
0, &proc_array_inode_operations
};
+static struct proc_dir_entry proc_root_memory = {
+ PROC_MEMORY, 6, "memory",
+ S_IFREG | S_IRUGO, 1, 0, 0,
+ 0, &proc_array_inode_operations
+};
static struct proc_dir_entry proc_root_cmdline = {
PROC_CMDLINE, 7, "cmdline",
S_IFREG | S_IRUGO, 1, 0, 0,
@@ -716,6 +739,7 @@ __initfunc(void proc_root_init(void))
proc_register(&proc_root, &proc_root_fs);
proc_register(&proc_root, &proc_root_dma);
proc_register(&proc_root, &proc_root_ioports);
+ proc_register(&proc_root, &proc_root_memory);
proc_register(&proc_root, &proc_root_cmdline);
#ifdef CONFIG_RTC
proc_register(&proc_root, &proc_root_rtc);
diff --git a/fs/proc/scsi.c b/fs/proc/scsi.c
index 6f3ad0770..ae2679b6d 100644
--- a/fs/proc/scsi.c
+++ b/fs/proc/scsi.c
@@ -59,23 +59,26 @@ static struct file_operations proc_scsi_operations = {
* proc directories can do almost nothing..
*/
struct inode_operations proc_scsi_inode_operations = {
- &proc_scsi_operations, /* default scsi directory file-ops */
- NULL, /* create */
- proc_lookup, /* lookup */
- NULL, /* link */
- NULL, /* unlink */
- NULL, /* symlink */
- NULL, /* mkdir */
- NULL, /* rmdir */
- NULL, /* mknod */
- NULL, /* rename */
- NULL, /* readlink */
- NULL, /* follow_link */
- NULL, /* readpage */
- NULL, /* writepage */
- NULL, /* bmap */
- NULL, /* truncate */
- NULL /* permission */
+&proc_scsi_operations, /* default scsi directory file-ops */
+ NULL, /* create */
+ proc_lookup, /* lookup */
+ NULL, /* link */
+ NULL, /* unlink */
+ NULL, /* symlink */
+ NULL, /* mkdir */
+ NULL, /* rmdir */
+ NULL, /* mknod */
+ NULL, /* rename */
+ NULL, /* readlink */
+ NULL, /* follow_link */
+ NULL, /* bmap */
+ NULL, /* readpage */
+ NULL, /* writepage */
+ NULL, /* flushpage */
+ NULL, /* truncate */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};
int get_not_present_info(char *buffer, char **start, off_t offset, int length)
diff --git a/fs/proc/sysvipc.c b/fs/proc/sysvipc.c
index eab3e3186..c6e32894d 100644
--- a/fs/proc/sysvipc.c
+++ b/fs/proc/sysvipc.c
@@ -118,21 +118,24 @@ static struct file_operations proc_sysvipc_operations = {
* proc directories can do almost nothing..
*/
struct inode_operations proc_sysvipc_inode_operations = {
- &proc_sysvipc_operations, /* default net file-ops */
- NULL, /* create */
- NULL, /* lookup */
- NULL, /* link */
- NULL, /* unlink */
- NULL, /* symlink */
- NULL, /* mkdir */
- NULL, /* rmdir */
- NULL, /* mknod */
- NULL, /* rename */
- NULL, /* readlink */
- NULL, /* follow_link */
- NULL, /* readpage */
- NULL, /* writepage */
- NULL, /* bmap */
- NULL, /* truncate */
- NULL /* permission */
+ &proc_sysvipc_operations, /* default net file-ops */
+ NULL, /* create */
+ NULL, /* lookup */
+ NULL, /* link */
+ NULL, /* unlink */
+ NULL, /* symlink */
+ NULL, /* mkdir */
+ NULL, /* rmdir */
+ NULL, /* mknod */
+ NULL, /* rename */
+ NULL, /* readlink */
+ NULL, /* follow_link */
+ NULL, /* bmap */
+ NULL, /* readpage */
+ NULL, /* writepage */
+ NULL, /* flushpage */
+ NULL, /* truncate */
+ NULL, /* permission */
+ NULL, /* smap */
+ NULL /* revalidate */
};