From 4de4da455ab6468a88bdac22a44d12a0f4c9b90d Mon Sep 17 00:00:00 2001 From: Michael Benedict Date: Tue, 27 Aug 2019 01:48:44 +1000 Subject: [PATCH] fs: ifdef samsung zswap lmkd integration Signed-off-by: Michael Benedict --- fs/proc/array.c | 2 ++ fs/proc/base.c | 4 ++++ fs/proc/internal.h | 5 +++++ fs/proc/task_mmu.c | 6 ++++++ 4 files changed, 17 insertions(+) diff --git a/fs/proc/array.c b/fs/proc/array.c index b84e87e65658..8d543f6f5930 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -591,6 +591,7 @@ int proc_pid_statm(struct seq_file *m, struct pid_namespace *ns, return 0; } +#ifdef CONFIG_ZSWAP int proc_pid_statlmkd(struct seq_file *m, struct pid_namespace *ns, struct pid *pid, struct task_struct *task) { @@ -616,6 +617,7 @@ int proc_pid_statlmkd(struct seq_file *m, struct pid_namespace *ns, return 0; } +#endif #ifdef CONFIG_PROC_CHILDREN static struct pid * get_children_pid(struct inode *inode, struct pid *pid_prev, loff_t pos) diff --git a/fs/proc/base.c b/fs/proc/base.c index faa9a8e8f020..49355d7576ae 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2839,7 +2839,9 @@ static const struct pid_entry tgid_base_stuff[] = { REG("cmdline", S_IRUGO, proc_pid_cmdline_ops), ONE("stat", S_IRUGO, proc_tgid_stat), ONE("statm", S_IRUGO, proc_pid_statm), +#ifdef CONFIG_ZSWAP ONE("statlmkd", S_IRUGO, proc_pid_statlmkd), +#endif REG("maps", S_IRUGO, proc_pid_maps_operations), #ifdef CONFIG_NUMA REG("numa_maps", S_IRUGO, proc_pid_numa_maps_operations), @@ -3230,7 +3232,9 @@ static const struct pid_entry tid_base_stuff[] = { REG("cmdline", S_IRUGO, proc_pid_cmdline_ops), ONE("stat", S_IRUGO, proc_tid_stat), ONE("statm", S_IRUGO, proc_pid_statm), +#ifdef CONFIG_ZSWAP ONE("statlmkd", S_IRUGO, proc_pid_statlmkd), +#endif REG("maps", S_IRUGO, proc_tid_maps_operations), #ifdef CONFIG_PROC_CHILDREN REG("children", S_IRUGO, proc_tid_children_operations), diff --git a/fs/proc/internal.h b/fs/proc/internal.h index 66c547494b4c..1be9baf31314 100644 --- a/fs/proc/internal.h +++ b/fs/proc/internal.h @@ -155,8 +155,11 @@ extern int proc_pid_status(struct seq_file *, struct pid_namespace *, struct pid *, struct task_struct *); extern int proc_pid_statm(struct seq_file *, struct pid_namespace *, struct pid *, struct task_struct *); +#ifdef CONFIG_ZSWAP extern int proc_pid_statlmkd(struct seq_file *, struct pid_namespace *, struct pid *, struct task_struct *); +#endif + /* * base.c */ @@ -304,6 +307,8 @@ extern unsigned long task_vsize(struct mm_struct *); extern unsigned long task_statm(struct mm_struct *, unsigned long *, unsigned long *, unsigned long *, unsigned long *); +#ifdef CONFIG_ZSWAP extern void task_statlmkd(struct mm_struct *, unsigned long *, unsigned long *, unsigned long *); +#endif extern void task_mem(struct seq_file *, struct mm_struct *); diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index ca0e5ea18770..9c863c4bb2ce 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -20,8 +20,10 @@ #include #include "internal.h" +#ifdef CONFIG_ZSWAP extern u64 zswap_pool_pages; extern atomic_t zswap_stored_pages; +#endif void task_mem(struct seq_file *m, struct mm_struct *mm) { @@ -92,6 +94,8 @@ unsigned long task_statm(struct mm_struct *mm, *resident = *shared + get_mm_counter(mm, MM_ANONPAGES); return mm->total_vm; } + +#ifdef CONFIG_ZSWAP void task_statlmkd(struct mm_struct *mm, unsigned long *size, unsigned long *resident, unsigned long *swapresident) { @@ -108,6 +112,8 @@ void task_statlmkd(struct mm_struct *mm, unsigned long *size, / zswap_stored_pages_temp; } } +#endif + #ifdef CONFIG_NUMA /* * Save get_task_policy() for show_numa_map(). -- 2.20.1