]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
tmpfs: depend on shmem
authorHugh Dickins <hugh.dickins@tiscali.co.uk>
Tue, 22 Sep 2009 00:03:37 +0000 (17:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Sep 2009 14:17:41 +0000 (07:17 -0700)
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>
fs/Kconfig
include/linux/mm.h
mm/shmem.c

index 455aa207e67e84c0ab97b0e865d099e16b7317ce..d4bf8caad8d0827e627fb995b1db4e189d2142e3 100644 (file)
@@ -109,6 +109,7 @@ source "fs/sysfs/Kconfig"
 
 config TMPFS
        bool "Virtual memory file system support (former shm fs)"
+       depends on SHMEM
        help
          Tmpfs is a file system which keeps all files in virtual memory.
 
index 5409eced7aae0c0d0a29364656ee875975e11bfc..5946e2ff9fe8172d03385ac03a20cd46fe467b6f 100644 (file)
@@ -702,17 +702,8 @@ extern void pagefault_out_of_memory(void);
 
 extern void show_free_areas(void);
 
-#ifdef CONFIG_SHMEM
-extern int shmem_lock(struct file *file, int lock, struct user_struct *user);
-#else
-static inline int shmem_lock(struct file *file, int lock,
-                           struct user_struct *user)
-{
-       return 0;
-}
-#endif
+int shmem_lock(struct file *file, int lock, struct user_struct *user);
 struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags);
-
 int shmem_zero_setup(struct vm_area_struct *);
 
 #ifndef CONFIG_MMU
index 25ba75d025808f50c8c23ff11ef26c7c35c162f3..b4b56fd1e77283474cbcdf71fafac13afdbdaf40 100644 (file)
@@ -2593,6 +2593,11 @@ int shmem_unuse(swp_entry_t entry, struct page *page)
        return 0;
 }
 
+int shmem_lock(struct file *file, int lock, struct user_struct *user)
+{
+       return 0;
+}
+
 #define shmem_vm_ops                           generic_file_vm_ops
 #define shmem_file_operations                  ramfs_file_operations
 #define shmem_get_inode(sb, mode, dev, flags)  ramfs_get_inode(sb, mode, dev)