linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / fs / nfsd / export.c
index 3b9e865..417ec02 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/namei.h>
 #include <linux/mount.h>
 #include <linux/hash.h>
+#include <linux/module.h>
 
 #include <linux/sunrpc/svc.h>
 #include <linux/nfsd/nfsd.h>
@@ -79,9 +80,9 @@ void expkey_put(struct cache_head *item, struct cache_detail *cd)
        }
 }
 
-void expkey_request(struct cache_detail *cd,
-                   struct cache_head *h,
-                   char **bpp, int *blen)
+static void expkey_request(struct cache_detail *cd,
+                          struct cache_head *h,
+                          char **bpp, int *blen)
 {
        /* client fsidtype \xfsid */
        struct svc_expkey *ek = container_of(h, struct svc_expkey, h);
@@ -95,7 +96,7 @@ void expkey_request(struct cache_detail *cd,
 }
 
 static struct svc_expkey *svc_expkey_lookup(struct svc_expkey *, int);
-int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
+static int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
 {
        /* client fsidtype fsid [path] */
        char *buf;
@@ -189,8 +190,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
  out:
        if (dom)
                auth_domain_put(dom);
-       if (buf)
-               kfree(buf);
+       kfree(buf);
        return err;
 }
 
@@ -221,6 +221,7 @@ static int expkey_show(struct seq_file *m,
 }
        
 struct cache_detail svc_expkey_cache = {
+       .owner          = THIS_MODULE,
        .hash_size      = EXPKEY_HASHMAX,
        .hash_table     = expkey_table,
        .name           = "nfsd.fh",
@@ -284,9 +285,9 @@ void svc_export_put(struct cache_head *item, struct cache_detail *cd)
        }
 }
 
-void svc_export_request(struct cache_detail *cd,
-                       struct cache_head *h,
-                       char **bpp, int *blen)
+static void svc_export_request(struct cache_detail *cd,
+                              struct cache_head *h,
+                              char **bpp, int *blen)
 {
        /*  client path */
        struct svc_export *exp = container_of(h, struct svc_export, h);
@@ -294,17 +295,17 @@ void svc_export_request(struct cache_detail *cd,
 
        qword_add(bpp, blen, exp->ex_client->name);
        pth = d_path(exp->ex_dentry, exp->ex_mnt, *bpp, *blen);
+       if (IS_ERR(pth)) {
+               /* is this correct? */
+               (*bpp)[0] = '\n';
+               return;
+       }
        qword_add(bpp, blen, pth);
        (*bpp)[-1] = '\n';
 }
 
 static struct svc_export *svc_export_lookup(struct svc_export *, int);
 
-extern struct dentry *
-find_exported_dentry(struct super_block *sb, void *obj, void *parent,
-                    int (*acceptable)(void *context, struct dentry *de),
-                    void *context);
-
 static int check_export(struct inode *inode, int flags)
 {
 
@@ -340,7 +341,7 @@ static int check_export(struct inode *inode, int flags)
 
 }
 
-int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
+static int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
 {
        /* client path expiry [flags anonuid anongid fsid] */
        char *buf;
@@ -426,8 +427,7 @@ int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
                path_release(&nd);
        if (dom)
                auth_domain_put(dom);
-       if (buf)
-               kfree(buf);
+       kfree(buf);
        return err;
 }
 
@@ -456,6 +456,7 @@ static int svc_export_show(struct seq_file *m,
        return 0;
 }
 struct cache_detail svc_export_cache = {
+       .owner          = THIS_MODULE,
        .hash_size      = EXPORT_HASHMAX,
        .hash_table     = export_table,
        .name           = "nfsd.export",
@@ -510,8 +511,8 @@ exp_find_key(svc_client *clp, int fsid_type, u32 *fsidv, struct cache_req *reqp)
        return ek;
 }
 
-int exp_set_key(svc_client *clp, int fsid_type, u32 *fsidv, 
-               struct svc_export *exp)
+static int exp_set_key(svc_client *clp, int fsid_type, u32 *fsidv,
+                      struct svc_export *exp)
 {
        struct svc_expkey key, *ek;
 
@@ -999,7 +1000,7 @@ static void e_stop(struct seq_file *m, void *p)
        exp_readunlock();
 }
 
-struct flags {
+static struct flags {
        int flag;
        char *name[2];
 } expflags[] = {