9p: rename uid and gid parameters
authorLatchesar Ionkov <lucho@ionkov.net>
Wed, 17 Oct 2007 19:31:07 +0000 (14:31 -0500)
committerEric Van Hensbergen <ericvh@ericvh-desktop.austin.ibm.com>
Wed, 17 Oct 2007 19:31:07 +0000 (14:31 -0500)
Change the names of 'uid' and 'gid' parameters to the more appropriate
'dfltuid' and 'dfltgid'.  This also sets the default uid/gid to -2
(aka nfsnobody)

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Documentation/filesystems/9p.txt
fs/9p/v9fs.c
fs/9p/v9fs.h
fs/9p/vfs_inode.c

index 1a5f50d3554489c8b8b5b4bf70b238caaeccfed2..e694cd1b52cf9ec7bc23df86b224d3ba8f53ba8f 100644 (file)
@@ -78,9 +78,9 @@ OPTIONS
 
   noextend     force legacy mode (no 9p2000.u semantics)
 
-  uid          attempt to mount as a particular uid
+  dfltuid      attempt to mount as a particular uid
 
-  gid          attempt to mount with a particular gid
+  dfltgid      attempt to mount with a particular gid
 
   afid         security channel - used by Plan 9 authentication protocols
 
index 8ac246700b70dbcd98a811393cee2f6c1d38998d..68f82be3bf371484829a0603ad8e35cf3ecb4351 100644 (file)
@@ -84,7 +84,7 @@ static struct p9_trans_module *v9fs_match_trans(const substring_t *name)
 
 enum {
        /* Options that take integer arguments */
-       Opt_debug, Opt_msize, Opt_uid, Opt_gid, Opt_afid,
+       Opt_debug, Opt_msize, Opt_dfltuid, Opt_dfltgid, Opt_afid,
        /* String options */
        Opt_uname, Opt_remotename, Opt_trans,
        /* Options that take no arguments */
@@ -98,8 +98,8 @@ enum {
 static match_table_t tokens = {
        {Opt_debug, "debug=%x"},
        {Opt_msize, "msize=%u"},
-       {Opt_uid, "uid=%u"},
-       {Opt_gid, "gid=%u"},
+       {Opt_dfltuid, "dfltuid=%u"},
+       {Opt_dfltgid, "dfltgid=%u"},
        {Opt_afid, "afid=%u"},
        {Opt_uname, "uname=%s"},
        {Opt_remotename, "aname=%s"},
@@ -159,11 +159,11 @@ static void v9fs_parse_options(struct v9fs_session_info *v9ses)
                case Opt_msize:
                        v9ses->maxdata = option;
                        break;
-               case Opt_uid:
-                       v9ses->uid = option;
+               case Opt_dfltuid:
+                       v9ses->dfltuid = option;
                        break;
-               case Opt_gid:
-                       v9ses->gid = option;
+               case Opt_dfltgid:
+                       v9ses->dfltgid = option;
                        break;
                case Opt_afid:
                        v9ses->afid = option;
@@ -219,6 +219,8 @@ struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
 
        strcpy(v9ses->name, V9FS_DEFUSER);
        strcpy(v9ses->remotename, V9FS_DEFANAME);
+       v9ses->dfltuid = V9FS_DEFUID;
+       v9ses->dfltgid = V9FS_DEFGID;
 
        v9ses->options = kstrdup(data, GFP_KERNEL);
        v9fs_parse_options(v9ses);
index 804b3ef8feab2cd7d1284eb18ffc006b053e5fd0..8e0999b3d0cc7dcaa0088d0e21f4bb8eb1dd2d36 100644 (file)
@@ -38,8 +38,8 @@ struct v9fs_session_info {
        char *options;          /* copy of mount options */
        char *name;             /* user name to mount as */
        char *remotename;       /* name of remote hierarchy being mounted */
-       unsigned int uid;       /* default uid/muid for legacy support */
-       unsigned int gid;       /* default gid for legacy support */
+       unsigned int dfltuid;   /* default uid/muid for legacy support */
+       unsigned int dfltgid;   /* default gid for legacy support */
        struct p9_trans_module *trans; /* 9p transport */
        struct p9_client *clnt; /* 9p client */
        struct dentry *debugfs_dir;
@@ -67,9 +67,11 @@ void v9fs_session_cancel(struct v9fs_session_info *v9ses);
 #define V9FS_MAGIC 0x01021997
 
 /* other default globals */
-#define V9FS_PORT              564
+#define V9FS_PORT      564
 #define V9FS_DEFUSER   "nobody"
 #define V9FS_DEFANAME  ""
+#define V9FS_DEFUID    (-2)
+#define V9FS_DEFGID    (-2)
 
 static inline struct v9fs_session_info *v9fs_inode2v9ses(struct inode *inode)
 {
index 2270d06ccd5626045a8c85cf71e1eaa0e80d512b..f08a35d2973ad42f82f3ce0f24d7ed17e2e76b14 100644 (file)
@@ -805,8 +805,8 @@ v9fs_stat2inode(struct p9_stat *stat, struct inode *inode,
        inode->i_mtime.tv_sec = stat->mtime;
        inode->i_ctime.tv_sec = stat->mtime;
 
-       inode->i_uid = v9ses->uid;
-       inode->i_gid = v9ses->gid;
+       inode->i_uid = v9ses->dfltuid;
+       inode->i_gid = v9ses->dfltgid;
 
        if (v9fs_extended(v9ses)) {
                inode->i_uid = stat->n_uid;