* [PATCH] fs: Don't compile in drop_caches.c when CONFIG_SYSCTL=n
@ 2013-03-13 23:14 Josh Triplett
2013-03-13 23:17 ` Kees Cook
0 siblings, 1 reply; 2+ messages in thread
From: Josh Triplett @ 2013-03-13 23:14 UTC (permalink / raw)
To: Alexander Viro, Andrew Morton, Mel Gorman, Michel Lespinasse,
Rik van Riel, Konstantin Khlebnikov, Ingo Molnar, Kees Cook,
linux-fsdevel, linux-kernel, linux-mm
drop_caches.c provides code only invokable via sysctl, so don't compile
it in when CONFIG_SYSCTL=n.
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
---
fs/Makefile | 3 ++-
include/linux/mm.h | 4 ++++
kernel/sysctl.c | 1 -
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/Makefile b/fs/Makefile
index 9d53192..3b2c767 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -10,7 +10,7 @@ obj-y := open.o read_write.o file_table.o super.o \
ioctl.o readdir.o select.o fifo.o dcache.o inode.o \
attr.o bad_inode.o file.o filesystems.o namespace.o \
seq_file.o xattr.o libfs.o fs-writeback.o \
- pnode.o drop_caches.o splice.o sync.o utimes.o \
+ pnode.o splice.o sync.o utimes.o \
stack.o fs_struct.o statfs.o
ifeq ($(CONFIG_BLOCK),y)
@@ -49,6 +49,7 @@ obj-$(CONFIG_FS_POSIX_ACL) += posix_acl.o xattr_acl.o
obj-$(CONFIG_NFS_COMMON) += nfs_common/
obj-$(CONFIG_GENERIC_ACL) += generic_acl.o
obj-$(CONFIG_COREDUMP) += coredump.o
+obj-$(CONFIG_SYSCTL) += drop_caches.o
obj-$(CONFIG_FHANDLE) += fhandle.o
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7acc9dc..1bb400f 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1674,8 +1674,12 @@ int in_gate_area_no_mm(unsigned long addr);
#define in_gate_area(mm, addr) ({(void)mm; in_gate_area_no_mm(addr);})
#endif /* __HAVE_ARCH_GATE_AREA */
+#ifdef CONFIG_SYSCTL
+extern int sysctl_drop_caches;
int drop_caches_sysctl_handler(struct ctl_table *, int,
void __user *, size_t *, loff_t *);
+#endif
+
unsigned long shrink_slab(struct shrink_control *shrink,
unsigned long nr_pages_scanned,
unsigned long lru_pages);
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index afc1dc6..3dadde5 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -106,7 +106,6 @@ extern unsigned int core_pipe_limit;
#endif
extern int pid_max;
extern int pid_max_min, pid_max_max;
-extern int sysctl_drop_caches;
extern int percpu_pagelist_fraction;
extern int compat_log;
extern int latencytop_enabled;
--
1.7.10.4
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fs: Don't compile in drop_caches.c when CONFIG_SYSCTL=n
2013-03-13 23:14 [PATCH] fs: Don't compile in drop_caches.c when CONFIG_SYSCTL=n Josh Triplett
@ 2013-03-13 23:17 ` Kees Cook
0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2013-03-13 23:17 UTC (permalink / raw)
To: Josh Triplett
Cc: Alexander Viro, Andrew Morton, Mel Gorman, Michel Lespinasse,
Rik van Riel, Konstantin Khlebnikov, Ingo Molnar,
linux-fsdevel@vger.kernel.org, LKML, linux-mm
On Wed, Mar 13, 2013 at 4:14 PM, Josh Triplett <josh@joshtriplett.org> wrote:
> drop_caches.c provides code only invokable via sysctl, so don't compile
> it in when CONFIG_SYSCTL=n.
>
> Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Seems reasonable to me.
Acked-by: Kees Cook <keescook@chromium.org>
--
Kees Cook
Chrome OS Security
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-13 23:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-13 23:14 [PATCH] fs: Don't compile in drop_caches.c when CONFIG_SYSCTL=n Josh Triplett
2013-03-13 23:17 ` Kees Cook
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).