]> err.no Git - linux-2.6/blobdiff - fs/nfsd/export.c
V4L/DVB (3809a): Remove compat stuff for DMX_GET_EVENT
[linux-2.6] / fs / nfsd / export.c
index cc811a1094cb4f1f3113c3e2e33a35bddbc59670..3eec30000f3fb3955e029283e8a26bee184b66ba 100644 (file)
@@ -57,7 +57,7 @@ static int            exp_verify_string(char *cp, int max);
 #define        EXPKEY_HASHMASK         (EXPKEY_HASHMAX -1)
 static struct cache_head *expkey_table[EXPKEY_HASHMAX];
 
-void expkey_put(struct kref *ref)
+static void expkey_put(struct kref *ref)
 {
        struct svc_expkey *key = container_of(ref, struct svc_expkey, h.ref);
 
@@ -87,6 +87,8 @@ static void expkey_request(struct cache_detail *cd,
 
 static struct svc_expkey *svc_expkey_update(struct svc_expkey *new, struct svc_expkey *old);
 static struct svc_expkey *svc_expkey_lookup(struct svc_expkey *);
+static struct cache_detail svc_expkey_cache;
+
 static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
 {
        /* client fsidtype fsid [path] */
@@ -255,7 +257,7 @@ static struct cache_head *expkey_alloc(void)
                return NULL;
 }
 
-struct cache_detail svc_expkey_cache = {
+static struct cache_detail svc_expkey_cache = {
        .owner          = THIS_MODULE,
        .hash_size      = EXPKEY_HASHMAX,
        .hash_table     = expkey_table,
@@ -345,7 +347,8 @@ static void svc_export_request(struct cache_detail *cd,
        (*bpp)[-1] = '\n';
 }
 
-struct svc_export *svc_export_update(struct svc_export *new, struct svc_export *old);
+static struct svc_export *svc_export_update(struct svc_export *new,
+                                           struct svc_export *old);
 static struct svc_export *svc_export_lookup(struct svc_export *);
 
 static int check_export(struct inode *inode, int flags)
@@ -419,7 +422,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
        if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
                goto out;
        err = path_lookup(buf, 0, &nd);
-       if (err) goto out;
+       if (err) goto out_no_path;
 
        exp.h.flags = 0;
        exp.ex_client = dom;
@@ -472,6 +475,7 @@ static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
  out:
        if (nd.dentry)
                path_release(&nd);
+ out_no_path:
        if (dom)
                auth_domain_put(dom);
        kfree(buf);
@@ -574,7 +578,7 @@ svc_export_lookup(struct svc_export *exp)
                return NULL;
 }
 
-struct svc_export *
+static struct svc_export *
 svc_export_update(struct svc_export *new, struct svc_export *old)
 {
        struct cache_head *ch;
@@ -593,7 +597,7 @@ svc_export_update(struct svc_export *new, struct svc_export *old)
 }
 
 
-struct svc_expkey *
+static struct svc_expkey *
 exp_find_key(svc_client *clp, int fsid_type, u32 *fsidv, struct cache_req *reqp)
 {
        struct svc_expkey key, *ek;
@@ -1062,9 +1066,11 @@ exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp,
                rv = nfserr_perm;
        else if (IS_ERR(exp))
                rv = nfserrno(PTR_ERR(exp));
-       else
+       else {
                rv = fh_compose(fhp, exp,
                                fsid_key->ek_dentry, NULL);
+               exp_put(exp);
+       }
        cache_put(&fsid_key->h, &svc_expkey_cache);
        return rv;
 }