From 4b9371ec5ab265fba0d1c037cfd274ac57af75df Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Wed, 19 Jun 2013 10:05:47 +1000 Subject: [PATCH] pagemap-introduce-pagemap_entry_t-without-pmshift-bits-v4 Signed-off-by: Pavel Emelyanov Cc: Matt Mackall Cc: Xiao Guangrong Cc: Glauber Costa Cc: Marcelo Tosatti Cc: KOSAKI Motohiro Signed-off-by: Andrew Morton --- fs/proc/task_mmu.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 41a2af429af4..39d641292579 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -824,7 +824,7 @@ struct pagemapread { #define __PM_PSHIFT(x) (((u64) (x) << PM_PSHIFT_OFFSET) & PM_PSHIFT_MASK) #define PM_PFRAME_MASK ((1LL << PM_PSHIFT_OFFSET) - 1) #define PM_PFRAME(x) ((x) & PM_PFRAME_MASK) -/* in pagemap2 pshift bits are occupied with more status bits */ +/* in "new" pagemap pshift bits are occupied with more status bits */ #define PM_STATUS2(v2, x) (__PM_PSHIFT(v2 ? x : PAGE_SHIFT)) #define PM_PRESENT PM_STATUS(4LL) @@ -1028,8 +1028,8 @@ static int pagemap_hugetlb_range(pte_t *pte, unsigned long hmask, * determine which areas of memory are actually mapped and llseek to * skip over unmapped regions. */ -static ssize_t do_pagemap_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos, bool v2) +static ssize_t pagemap_read(struct file *file, char __user *buf, + size_t count, loff_t *ppos) { struct task_struct *task = get_proc_task(file_inode(file)); struct mm_struct *mm; @@ -1054,7 +1054,7 @@ static ssize_t do_pagemap_read(struct file *file, char __user *buf, if (!count) goto out_task; - pm.v2 = v2; + pm.v2 = false; pm.len = PM_ENTRY_BYTES * (PAGEMAP_WALK_SIZE >> PAGE_SHIFT); pm.buffer = kmalloc(pm.len, GFP_TEMPORARY); ret = -ENOMEM; @@ -1127,12 +1127,6 @@ out: return ret; } -static ssize_t pagemap_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos) -{ - return do_pagemap_read(file, buf, count, ppos, false); -} - const struct file_operations proc_pagemap_operations = { .llseek = mem_lseek, /* borrow this */ .read = pagemap_read, -- 2.39.5