diff options
author | Hugh Dickins <hugh.dickins@tiscali.co.uk> | 2009-09-21 20:03:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:41 -0400 |
commit | 3f96b79ad96263cc0ece7bb340cddf9b2ddfb1b3 (patch) | |
tree | 0da9828c16543164f1b055fd927ea3e222ca05e5 | |
parent | cdf7b3418ad5a8783efe8f9124023d9b869fec0f (diff) |
tmpfs: depend on shmem
CONFIG_SHMEM off gives you (ramfs masquerading as) tmpfs, even when
CONFIG_TMPFS is off: that's a little anomalous, and I'd intended to make
more sense of it by removing CONFIG_TMPFS altogether, always enabling its
code when CONFIG_SHMEM; but so many defconfigs have CONFIG_SHMEM on
CONFIG_TMPFS off that we'd better leave that as is.
But there is no point in asking for CONFIG_TMPFS if CONFIG_SHMEM is off:
make TMPFS depend on SHMEM, which also prevents TMPFS_POSIX_ACL
shmem_acl.o being pointlessly built into the kernel when SHMEM is off.
And a selfish change, to prevent the world from being rebuilt when I
switch between CONFIG_SHMEM on and off: the only CONFIG_SHMEM in the
header files is mm.h shmem_lock() - give that a shmem.c stub instead.
Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/Kconfig | 1 | ||||
-rw-r--r-- | include/linux/mm.h | 11 | ||||
-rw-r--r-- | mm/shmem.c | 5 |
3 files changed, 7 insertions, 10 deletions
diff --git a/fs/Kconfig b/fs/Kconfig index 455aa207e67e..d4bf8caad8d0 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
@@ -109,6 +109,7 @@ source "fs/sysfs/Kconfig" | |||
109 | 109 | ||
110 | config TMPFS | 110 | config TMPFS |
111 | bool "Virtual memory file system support (former shm fs)" | 111 | bool "Virtual memory file system support (former shm fs)" |
112 | depends on SHMEM | ||
112 | help | 113 | help |
113 | Tmpfs is a file system which keeps all files in virtual memory. | 114 | Tmpfs is a file system which keeps all files in virtual memory. |
114 | 115 | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 5409eced7aae..5946e2ff9fe8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -702,17 +702,8 @@ extern void pagefault_out_of_memory(void); | |||
702 | 702 | ||
703 | extern void show_free_areas(void); | 703 | extern void show_free_areas(void); |
704 | 704 | ||
705 | #ifdef CONFIG_SHMEM | 705 | int shmem_lock(struct file *file, int lock, struct user_struct *user); |
706 | extern int shmem_lock(struct file *file, int lock, struct user_struct *user); | ||
707 | #else | ||
708 | static inline int shmem_lock(struct file *file, int lock, | ||
709 | struct user_struct *user) | ||
710 | { | ||
711 | return 0; | ||
712 | } | ||
713 | #endif | ||
714 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); | 706 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); |
715 | |||
716 | int shmem_zero_setup(struct vm_area_struct *); | 707 | int shmem_zero_setup(struct vm_area_struct *); |
717 | 708 | ||
718 | #ifndef CONFIG_MMU | 709 | #ifndef CONFIG_MMU |
diff --git a/mm/shmem.c b/mm/shmem.c index 25ba75d02580..b4b56fd1e772 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -2593,6 +2593,11 @@ int shmem_unuse(swp_entry_t entry, struct page *page) | |||
2593 | return 0; | 2593 | return 0; |
2594 | } | 2594 | } |
2595 | 2595 | ||
2596 | int shmem_lock(struct file *file, int lock, struct user_struct *user) | ||
2597 | { | ||
2598 | return 0; | ||
2599 | } | ||
2600 | |||
2596 | #define shmem_vm_ops generic_file_vm_ops | 2601 | #define shmem_vm_ops generic_file_vm_ops |
2597 | #define shmem_file_operations ramfs_file_operations | 2602 | #define shmem_file_operations ramfs_file_operations |
2598 | #define shmem_get_inode(sb, mode, dev, flags) ramfs_get_inode(sb, mode, dev) | 2603 | #define shmem_get_inode(sb, mode, dev, flags) ramfs_get_inode(sb, mode, dev) |