[POWERPC] spufs: add mode= mount option

Add a 'mode=' option to spufs mount arguments. This allows more
control over access to the top-level spufs directory.

Tested on Cell.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
This commit is contained in:
Jeremy Kerr 2007-04-23 21:08:23 +02:00 коммит произвёл Arnd Bergmann
Родитель 9e2fe2ce4e
Коммит f11f5ee70f
1 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -521,13 +521,14 @@ out:
/* File system initialization */ /* File system initialization */
enum { enum {
Opt_uid, Opt_gid, Opt_err, Opt_uid, Opt_gid, Opt_mode, Opt_err,
}; };
static match_table_t spufs_tokens = { static match_table_t spufs_tokens = {
{ Opt_uid, "uid=%d" }, { Opt_uid, "uid=%d" },
{ Opt_gid, "gid=%d" }, { Opt_gid, "gid=%d" },
{ Opt_err, NULL }, { Opt_mode, "mode=%o" },
{ Opt_err, NULL },
}; };
static int static int
@ -554,6 +555,11 @@ spufs_parse_options(char *options, struct inode *root)
return 0; return 0;
root->i_gid = option; root->i_gid = option;
break; break;
case Opt_mode:
if (match_octal(&args[0], &option))
return 0;
root->i_mode = option | S_IFDIR;
break;
default: default:
return 0; return 0;
} }