1 Index: linux-2.6.21.7/fs/ramfs/inode.c
2 ===================================================================
3 --- linux-2.6.21.7.orig/fs/ramfs/inode.c
4 +++ linux-2.6.21.7/fs/ramfs/inode.c
6 #include <linux/smp_lock.h>
7 #include <linux/backing-dev.h>
8 #include <linux/ramfs.h>
9 +#include <linux/ctype.h>
11 #include <asm/uaccess.h>
13 @@ -160,10 +161,66 @@ static const struct super_operations ram
14 .drop_inode = generic_delete_inode,
17 +static int ramfs_parse_options(char *options, int *mode)
19 + char *this_char, *value, *rest;
21 + while (options != NULL) {
22 + this_char = options;
25 + * NUL-terminate this option: unfortunately,
26 + * mount options form a comma-separated list,
27 + * but mpol's nodelist may also contain commas.
29 + options = strchr(options, ',');
30 + if (options == NULL)
33 + if (!isdigit(*options)) {
40 + if ((value = strchr(this_char,'=')) != NULL) {
44 + "ramfs: No value for mount option '%s'\n",
49 + if (!strcmp(this_char,"mode")) {
52 + *mode = simple_strtoul(value,&rest,8);
56 + printk(KERN_ERR "ramfs: Bad mount option %s\n",
64 + printk(KERN_ERR "ramfs: Bad value '%s' for mount option '%s'\n",
69 static int ramfs_fill_super(struct super_block * sb, void * data, int silent)
75 + if (ramfs_parse_options(data, &mode))
78 sb->s_maxbytes = MAX_LFS_FILESIZE;
79 sb->s_blocksize = PAGE_CACHE_SIZE;
80 @@ -171,7 +228,7 @@ static int ramfs_fill_super(struct super
81 sb->s_magic = RAMFS_MAGIC;
82 sb->s_op = &ramfs_ops;
84 - inode = ramfs_get_inode(sb, S_IFDIR | 0755, 0);
85 + inode = ramfs_get_inode(sb, S_IFDIR | mode, 0);