]> err.no Git - linux-2.6/commitdiff
[POWERPC] spufs: add mode= mount option
authorJeremy Kerr <jk@ozlabs.org>
Mon, 23 Apr 2007 19:08:23 +0000 (21:08 +0200)
committerArnd Bergmann <arnd@klappe.arndb.de>
Mon, 23 Apr 2007 19:18:58 +0000 (21:18 +0200)
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>
arch/powerpc/platforms/cell/spufs/inode.c

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