diff options
author | Dave Kleikamp <shaggy@austin.ibm.com> | 2006-03-14 18:05:45 -0500 |
---|---|---|
committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2006-03-14 18:05:45 -0500 |
commit | c5111f504d2a9b0d258d7c4752b4093523315989 (patch) | |
tree | 6a52864aff79691689aea21cb0cb928327d5de5b /fs/proc | |
parent | 69eb66d7da7dba2696281981347698e1693c2340 (diff) | |
parent | a488edc914aa1d766a4e2c982b5ae03d5657ec1b (diff) |
Merge with /home/shaggy/git/linus-clean/
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/inode.c | 4 | ||||
-rw-r--r-- | fs/proc/proc_misc.c | 2 | ||||
-rw-r--r-- | fs/proc/root.c | 17 | ||||
-rw-r--r-- | fs/proc/task_mmu.c | 11 |
4 files changed, 15 insertions, 19 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index 6573f31f1f..075d3e9456 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -204,10 +204,6 @@ int proc_fill_super(struct super_block *s, void *data, int silent) | |||
204 | root_inode = proc_get_inode(s, PROC_ROOT_INO, &proc_root); | 204 | root_inode = proc_get_inode(s, PROC_ROOT_INO, &proc_root); |
205 | if (!root_inode) | 205 | if (!root_inode) |
206 | goto out_no_root; | 206 | goto out_no_root; |
207 | /* | ||
208 | * Fixup the root inode's nlink value | ||
209 | */ | ||
210 | root_inode->i_nlink += nr_processes(); | ||
211 | root_inode->i_uid = 0; | 207 | root_inode->i_uid = 0; |
212 | root_inode->i_gid = 0; | 208 | root_inode->i_gid = 0; |
213 | s->s_root = d_alloc_root(root_inode); | 209 | s->s_root = d_alloc_root(root_inode); |
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 8f8014285a..1d24fead51 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -548,7 +548,7 @@ static int show_stat(struct seq_file *p, void *v) | |||
548 | } | 548 | } |
549 | seq_printf(p, "intr %llu", (unsigned long long)sum); | 549 | seq_printf(p, "intr %llu", (unsigned long long)sum); |
550 | 550 | ||
551 | #if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) | 551 | #if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) && !defined(CONFIG_IA64) |
552 | for (i = 0; i < NR_IRQS; i++) | 552 | for (i = 0; i < NR_IRQS; i++) |
553 | seq_printf(p, " %u", kstat_irqs(i)); | 553 | seq_printf(p, " %u", kstat_irqs(i)); |
554 | #endif | 554 | #endif |
diff --git a/fs/proc/root.c b/fs/proc/root.c index 68896283c8..c3fd361111 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c | |||
@@ -80,16 +80,16 @@ void __init proc_root_init(void) | |||
80 | proc_bus = proc_mkdir("bus", NULL); | 80 | proc_bus = proc_mkdir("bus", NULL); |
81 | } | 81 | } |
82 | 82 | ||
83 | static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd) | 83 | static int proc_root_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat |
84 | ) | ||
84 | { | 85 | { |
85 | /* | 86 | generic_fillattr(dentry->d_inode, stat); |
86 | * nr_threads is actually protected by the tasklist_lock; | 87 | stat->nlink = proc_root.nlink + nr_processes(); |
87 | * however, it's conventional to do reads, especially for | 88 | return 0; |
88 | * reporting, without any locking whatsoever. | 89 | } |
89 | */ | ||
90 | if (dir->i_ino == PROC_ROOT_INO) /* check for safety... */ | ||
91 | dir->i_nlink = proc_root.nlink + nr_threads; | ||
92 | 90 | ||
91 | static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry, struct nameidata *nd) | ||
92 | { | ||
93 | if (!proc_lookup(dir, dentry, nd)) { | 93 | if (!proc_lookup(dir, dentry, nd)) { |
94 | return NULL; | 94 | return NULL; |
95 | } | 95 | } |
@@ -134,6 +134,7 @@ static struct file_operations proc_root_operations = { | |||
134 | */ | 134 | */ |
135 | static struct inode_operations proc_root_inode_operations = { | 135 | static struct inode_operations proc_root_inode_operations = { |
136 | .lookup = proc_root_lookup, | 136 | .lookup = proc_root_lookup, |
137 | .getattr = proc_root_getattr, | ||
137 | }; | 138 | }; |
138 | 139 | ||
139 | /* | 140 | /* |
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 0eaad41f46..91b7c15ab3 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c | |||
@@ -204,7 +204,6 @@ static void smaps_pte_range(struct vm_area_struct *vma, pmd_t *pmd, | |||
204 | { | 204 | { |
205 | pte_t *pte, ptent; | 205 | pte_t *pte, ptent; |
206 | spinlock_t *ptl; | 206 | spinlock_t *ptl; |
207 | unsigned long pfn; | ||
208 | struct page *page; | 207 | struct page *page; |
209 | 208 | ||
210 | pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); | 209 | pte = pte_offset_map_lock(vma->vm_mm, pmd, addr, &ptl); |
@@ -214,12 +213,12 @@ static void smaps_pte_range(struct vm_area_struct *vma, pmd_t *pmd, | |||
214 | continue; | 213 | continue; |
215 | 214 | ||
216 | mss->resident += PAGE_SIZE; | 215 | mss->resident += PAGE_SIZE; |
217 | pfn = pte_pfn(ptent); | 216 | |
218 | if (!pfn_valid(pfn)) | 217 | page = vm_normal_page(vma, addr, ptent); |
218 | if (!page) | ||
219 | continue; | 219 | continue; |
220 | 220 | ||
221 | page = pfn_to_page(pfn); | 221 | if (page_mapcount(page) >= 2) { |
222 | if (page_count(page) >= 2) { | ||
223 | if (pte_dirty(ptent)) | 222 | if (pte_dirty(ptent)) |
224 | mss->shared_dirty += PAGE_SIZE; | 223 | mss->shared_dirty += PAGE_SIZE; |
225 | else | 224 | else |
@@ -289,7 +288,7 @@ static int show_smap(struct seq_file *m, void *v) | |||
289 | struct mem_size_stats mss; | 288 | struct mem_size_stats mss; |
290 | 289 | ||
291 | memset(&mss, 0, sizeof mss); | 290 | memset(&mss, 0, sizeof mss); |
292 | if (vma->vm_mm) | 291 | if (vma->vm_mm && !is_vm_hugetlb_page(vma)) |
293 | smaps_pgd_range(vma, vma->vm_start, vma->vm_end, &mss); | 292 | smaps_pgd_range(vma, vma->vm_start, vma->vm_end, &mss); |
294 | return show_map_internal(m, v, &mss); | 293 | return show_map_internal(m, v, &mss); |
295 | } | 294 | } |