Documentation: dt: document all the atmel pmc compatibles
[cascardo/linux.git] / fs / nfsd / export.c
index 1d6d7bd..13b85f9 100644 (file)
@@ -23,9 +23,6 @@
 
 #define NFSDDBG_FACILITY       NFSDDBG_EXPORT
 
-typedef struct auth_domain     svc_client;
-typedef struct svc_export      svc_export;
-
 /*
  * We have two caches.
  * One maps client+vfsmnt+dentry to export options - the export map
@@ -71,7 +68,7 @@ static struct svc_expkey *svc_expkey_lookup(struct cache_detail *cd, struct svc_
 
 static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
 {
-       /* client fsidtype fsid [path] */
+       /* client fsidtype fsid expiry [path] */
        char *buf;
        int len;
        struct auth_domain *dom = NULL;
@@ -392,6 +389,10 @@ fsloc_parse(char **mesg, char *buf, struct nfsd4_fs_locations *fsloc)
        int len;
        int migrated, i, err;
 
+       /* more than one fsloc */
+       if (fsloc->locations)
+               return -EINVAL;
+
        /* listsize */
        err = get_uint(mesg, &fsloc->locations_count);
        if (err)
@@ -441,13 +442,18 @@ out_free_all:
 
 static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp)
 {
-       int listsize, err;
        struct exp_flavor_info *f;
+       u32 listsize;
+       int err;
+
+       /* more than one secinfo */
+       if (exp->ex_nflavors)
+               return -EINVAL;
 
-       err = get_int(mesg, &listsize);
+       err = get_uint(mesg, &listsize);
        if (err)
                return err;
-       if (listsize < 0 || listsize > MAX_SECINFO_LIST)
+       if (listsize > MAX_SECINFO_LIST)
                return -EINVAL;
 
        for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) {
@@ -483,6 +489,10 @@ uuid_parse(char **mesg, char *buf, unsigned char **puuid)
 {
        int len;
 
+       /* more than one uuid */
+       if (*puuid)
+               return -EINVAL;
+
        /* expect a 16 byte uuid encoded as \xXXXX... */
        len = qword_get(mesg, buf, PAGE_SIZE);
        if (len != EX_UUID_LEN)
@@ -783,7 +793,7 @@ svc_export_update(struct svc_export *new, struct svc_export *old)
 
 
 static struct svc_expkey *
-exp_find_key(struct cache_detail *cd, svc_client *clp, int fsid_type,
+exp_find_key(struct cache_detail *cd, struct auth_domain *clp, int fsid_type,
             u32 *fsidv, struct cache_req *reqp)
 {
        struct svc_expkey key, *ek;
@@ -805,9 +815,9 @@ exp_find_key(struct cache_detail *cd, svc_client *clp, int fsid_type,
        return ek;
 }
 
-
-static svc_export *exp_get_by_name(struct cache_detail *cd, svc_client *clp,
-                                  const struct path *path, struct cache_req *reqp)
+static struct svc_export *
+exp_get_by_name(struct cache_detail *cd, struct auth_domain *clp,
+               const struct path *path, struct cache_req *reqp)
 {
        struct svc_export *exp, key;
        int err;
@@ -831,11 +841,11 @@ static svc_export *exp_get_by_name(struct cache_detail *cd, svc_client *clp,
 /*
  * Find the export entry for a given dentry.
  */
-static struct svc_export *exp_parent(struct cache_detail *cd, svc_client *clp,
-                                    struct path *path)
+static struct svc_export *
+exp_parent(struct cache_detail *cd, struct auth_domain *clp, struct path *path)
 {
        struct dentry *saved = dget(path->dentry);
-       svc_export *exp = exp_get_by_name(cd, clp, path, NULL);
+       struct svc_export *exp = exp_get_by_name(cd, clp, path, NULL);
 
        while (PTR_ERR(exp) == -ENOENT && !IS_ROOT(path->dentry)) {
                struct dentry *parent = dget_parent(path->dentry);
@@ -856,7 +866,7 @@ static struct svc_export *exp_parent(struct cache_detail *cd, svc_client *clp,
  * since its harder to fool a kernel module than a user space program.
  */
 int
-exp_rootfh(struct net *net, svc_client *clp, char *name,
+exp_rootfh(struct net *net, struct auth_domain *clp, char *name,
           struct knfsd_fh *f, int maxsize)
 {
        struct svc_export       *exp;