summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMatt Mackall <mpm@selenic.com>2004-08-30 20:34:47 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-30 20:34:47 -0700
commit14ef4d0a5b1213a0ebac1bcc5b28298a357cfc80 (patch)
treef57087b8c5fdb398d424a69a5ff8e821d0c6c83a /include
parent59835997b54000eb1e8a6606ac0c4dcd5a4ba5d9 (diff)
[PATCH] tiny shmem/tmpfs replacement
A patch to replace tmpfs/shmem with ramfs for systems without swap, incorporating the suggestions from Andi and Hugh. It uses ramfs instead. Signed-off-by: Matt Mackall <mpm@selenic.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mm.h12
-rw-r--r--include/linux/ramfs.h11
2 files changed, 21 insertions, 2 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7a47263511f0..397236df3894 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -519,13 +519,21 @@ static inline int page_mapped(struct page *page)
extern void show_free_areas(void);
-struct page *shmem_nopage(struct vm_area_struct * vma,
+#ifdef CONFIG_SHMEM
+struct page *shmem_nopage(struct vm_area_struct *vma,
unsigned long address, int *type);
int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *new);
struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
unsigned long addr);
-struct file *shmem_file_setup(char * name, loff_t size, unsigned long flags);
int shmem_lock(struct file *file, int lock, struct user_struct *user);
+#else
+#define shmem_nopage filemap_nopage
+#define shmem_lock(a, b) /* always in memory, no need to lock */
+#define shmem_set_policy(a, b) (0)
+#define shmem_get_policy(a, b) (NULL)
+#endif
+struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags);
+
int shmem_zero_setup(struct vm_area_struct *);
static inline int can_do_mlock(void)
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
new file mode 100644
index 000000000000..e0a4faa9610c
--- /dev/null
+++ b/include/linux/ramfs.h
@@ -0,0 +1,11 @@
+#ifndef _LINUX_RAMFS_H
+#define _LINUX_RAMFS_H
+
+struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev);
+struct super_block *ramfs_get_sb(struct file_system_type *fs_type,
+ int flags, const char *dev_name, void *data);
+
+extern struct file_operations ramfs_file_operations;
+extern struct vm_operations_struct generic_file_vm_ops;
+
+#endif