Commit 72e56221 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] kNFSd: Change names of some exported functions

... as generic names probably aren't such a good idea.
Also sort the related EXPORT_SYMBOLS.

A 'qword' is a 'quoted word' and can be added, added as hex,
or got (getted??).
parent e091bcb6
...@@ -86,10 +86,10 @@ void expkey_request(struct cache_detail *cd, ...@@ -86,10 +86,10 @@ void expkey_request(struct cache_detail *cd,
struct svc_expkey *ek = container_of(h, struct svc_expkey, h); struct svc_expkey *ek = container_of(h, struct svc_expkey, h);
char type[5]; char type[5];
add_word(bpp, blen, ek->ek_client->name); qword_add(bpp, blen, ek->ek_client->name);
snprintf(type, 5, "%d", ek->ek_fsidtype); snprintf(type, 5, "%d", ek->ek_fsidtype);
add_word(bpp, blen, type); qword_add(bpp, blen, type);
add_hex(bpp, blen, (char*)ek->ek_fsid, ek->ek_fsidtype==0?8:4); qword_addhex(bpp, blen, (char*)ek->ek_fsid, ek->ek_fsidtype==0?8:4);
(*bpp)[-1] = '\n'; (*bpp)[-1] = '\n';
} }
...@@ -114,7 +114,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen) ...@@ -114,7 +114,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
if (!buf) goto out; if (!buf) goto out;
err = -EINVAL; err = -EINVAL;
if ((len=get_word(&mesg, buf, PAGE_SIZE)) <= 0) if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
goto out; goto out;
err = -ENOENT; err = -ENOENT;
...@@ -124,7 +124,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen) ...@@ -124,7 +124,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
dprintk("found domain %s\n", buf); dprintk("found domain %s\n", buf);
err = -EINVAL; err = -EINVAL;
if ((len=get_word(&mesg, buf, PAGE_SIZE)) <= 0) if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
goto out; goto out;
fsidtype = simple_strtoul(buf, &ep, 10); fsidtype = simple_strtoul(buf, &ep, 10);
if (*ep) if (*ep)
...@@ -132,7 +132,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen) ...@@ -132,7 +132,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
dprintk("found fsidtype %d\n", fsidtype); dprintk("found fsidtype %d\n", fsidtype);
if (fsidtype > 1) if (fsidtype > 1)
goto out; goto out;
if ((len=get_word(&mesg, buf, PAGE_SIZE)) <= 0) if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
goto out; goto out;
dprintk("found fsid length %d\n", len); dprintk("found fsid length %d\n", len);
if (len != ((fsidtype==0)?8:4)) if (len != ((fsidtype==0)?8:4))
...@@ -149,7 +149,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen) ...@@ -149,7 +149,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
memcpy(key.ek_fsid, buf, len); memcpy(key.ek_fsid, buf, len);
/* now we want a pathname, or empty meaning NEGATIVE */ /* now we want a pathname, or empty meaning NEGATIVE */
if ((len=get_word(&mesg, buf, PAGE_SIZE)) < 0) if ((len=qword_get(&mesg, buf, PAGE_SIZE)) < 0)
goto out; goto out;
dprintk("Path seems to be <%s>\n", buf); dprintk("Path seems to be <%s>\n", buf);
err = 0; err = 0;
...@@ -269,9 +269,9 @@ void svc_export_request(struct cache_detail *cd, ...@@ -269,9 +269,9 @@ void svc_export_request(struct cache_detail *cd,
struct svc_export *exp = container_of(h, struct svc_export, h); struct svc_export *exp = container_of(h, struct svc_export, h);
char *pth; char *pth;
add_word(bpp, blen, exp->ex_client->name); qword_add(bpp, blen, exp->ex_client->name);
pth = d_path(exp->ex_dentry, exp->ex_mnt, *bpp, *blen); pth = d_path(exp->ex_dentry, exp->ex_mnt, *bpp, *blen);
add_word(bpp, blen, pth); qword_add(bpp, blen, pth);
(*bpp)[-1] = '\n'; (*bpp)[-1] = '\n';
} }
...@@ -298,7 +298,7 @@ int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) ...@@ -298,7 +298,7 @@ int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
if (!buf) goto out; if (!buf) goto out;
/* client */ /* client */
len = get_word(&mesg, buf, PAGE_SIZE); len = qword_get(&mesg, buf, PAGE_SIZE);
if (len <= 0) return -EINVAL; if (len <= 0) return -EINVAL;
err = -ENOENT; err = -ENOENT;
dom = auth_domain_find(buf); dom = auth_domain_find(buf);
...@@ -307,7 +307,7 @@ int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen) ...@@ -307,7 +307,7 @@ int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
/* path */ /* path */
err = -EINVAL; err = -EINVAL;
if ((len=get_word(&mesg, buf, PAGE_SIZE)) <= 0) if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
goto out; goto out;
err = path_lookup(buf, 0, &nd); err = path_lookup(buf, 0, &nd);
if (err) goto out; if (err) goto out;
......
...@@ -271,16 +271,16 @@ extern int cache_unregister(struct cache_detail *cd); ...@@ -271,16 +271,16 @@ extern int cache_unregister(struct cache_detail *cd);
extern struct cache_detail *cache_find(char *name); extern struct cache_detail *cache_find(char *name);
extern void cache_drop(struct cache_detail *detail); extern void cache_drop(struct cache_detail *detail);
extern void add_word(char **bpp, int *lp, char *str); extern void qword_add(char **bpp, int *lp, char *str);
extern void add_hex(char **bpp, int *lp, char *buf, int blen); extern void qword_addhex(char **bpp, int *lp, char *buf, int blen);
extern int get_word(char **bpp, char *dest, int bufsize); extern int qword_get(char **bpp, char *dest, int bufsize);
static inline int get_int(char **bpp, int *anint) static inline int get_int(char **bpp, int *anint)
{ {
char buf[50]; char buf[50];
char *ep; char *ep;
int rv; int rv;
int len = get_word(bpp, buf, 50); int len = qword_get(bpp, buf, 50);
if (len < 0) return -EINVAL; if (len < 0) return -EINVAL;
if (len ==0) return -ENOENT; if (len ==0) return -ENOENT;
rv = simple_strtol(buf, &ep, 0); rv = simple_strtol(buf, &ep, 0);
......
...@@ -750,7 +750,7 @@ static void queue_loose(struct cache_detail *detail, struct cache_head *ch) ...@@ -750,7 +750,7 @@ static void queue_loose(struct cache_detail *detail, struct cache_head *ch)
* *
*/ */
void add_word(char **bpp, int *lp, char *str) void qword_add(char **bpp, int *lp, char *str)
{ {
char *bp = *bpp; char *bp = *bpp;
int len = *lp; int len = *lp;
...@@ -785,7 +785,7 @@ void add_word(char **bpp, int *lp, char *str) ...@@ -785,7 +785,7 @@ void add_word(char **bpp, int *lp, char *str)
*lp = len; *lp = len;
} }
void add_hex(char **bpp, int *lp, char *buf, int blen) void qword_addhex(char **bpp, int *lp, char *buf, int blen)
{ {
char *bp = *bpp; char *bp = *bpp;
int len = *lp; int len = *lp;
...@@ -879,7 +879,7 @@ static int cache_make_upcall(struct cache_detail *detail, struct cache_head *h) ...@@ -879,7 +879,7 @@ static int cache_make_upcall(struct cache_detail *detail, struct cache_head *h)
*/ */
#define isodigit(c) (isdigit(c) && c <= '7') #define isodigit(c) (isdigit(c) && c <= '7')
int get_word(char **bpp, char *dest, int bufsize) int qword_get(char **bpp, char *dest, int bufsize)
{ {
/* return bytes copied, or -1 on error */ /* return bytes copied, or -1 on error */
char *bp = *bpp; char *bp = *bpp;
......
...@@ -94,22 +94,22 @@ EXPORT_SYMBOL(svc_proc_read); ...@@ -94,22 +94,22 @@ EXPORT_SYMBOL(svc_proc_read);
/* caching... */ /* caching... */
EXPORT_SYMBOL(auth_domain_find); EXPORT_SYMBOL(auth_domain_find);
EXPORT_SYMBOL(cache_fresh);
EXPORT_SYMBOL(unix_domain_find);
EXPORT_SYMBOL(auth_domain_put); EXPORT_SYMBOL(auth_domain_put);
EXPORT_SYMBOL(cache_flush); EXPORT_SYMBOL(auth_unix_add_addr);
EXPORT_SYMBOL(cache_unregister); EXPORT_SYMBOL(auth_unix_forget_old);
EXPORT_SYMBOL(add_hex); EXPORT_SYMBOL(auth_unix_lookup);
EXPORT_SYMBOL(cache_check); EXPORT_SYMBOL(cache_check);
EXPORT_SYMBOL(svcauth_unix_purge);
EXPORT_SYMBOL(get_word);
EXPORT_SYMBOL(cache_clean); EXPORT_SYMBOL(cache_clean);
EXPORT_SYMBOL(cache_register); EXPORT_SYMBOL(cache_flush);
EXPORT_SYMBOL(auth_unix_lookup); EXPORT_SYMBOL(cache_fresh);
EXPORT_SYMBOL(auth_unix_add_addr);
EXPORT_SYMBOL(cache_init); EXPORT_SYMBOL(cache_init);
EXPORT_SYMBOL(auth_unix_forget_old); EXPORT_SYMBOL(cache_register);
EXPORT_SYMBOL(add_word); EXPORT_SYMBOL(cache_unregister);
EXPORT_SYMBOL(qword_add);
EXPORT_SYMBOL(qword_addhex);
EXPORT_SYMBOL(qword_get);
EXPORT_SYMBOL(svcauth_unix_purge);
EXPORT_SYMBOL(unix_domain_find);
/* Generic XDR */ /* Generic XDR */
EXPORT_SYMBOL(xdr_encode_array); EXPORT_SYMBOL(xdr_encode_array);
......
...@@ -132,8 +132,8 @@ static void ip_map_request(struct cache_detail *cd, ...@@ -132,8 +132,8 @@ static void ip_map_request(struct cache_detail *cd,
ntohl(addr) >> 8 & 0xff, ntohl(addr) >> 8 & 0xff,
ntohl(addr) >> 0 & 0xff); ntohl(addr) >> 0 & 0xff);
add_word(bpp, blen, im->m_class); qword_add(bpp, blen, im->m_class);
add_word(bpp, blen, text_addr); qword_add(bpp, blen, text_addr);
(*bpp)[-1] = '\n'; (*bpp)[-1] = '\n';
} }
...@@ -155,11 +155,11 @@ static int ip_map_parse(struct cache_detail *cd, ...@@ -155,11 +155,11 @@ static int ip_map_parse(struct cache_detail *cd,
mesg[mlen-1] = 0; mesg[mlen-1] = 0;
/* class */ /* class */
len = get_word(&mesg, class, 50); len = qword_get(&mesg, class, 50);
if (len <= 0) return -EINVAL; if (len <= 0) return -EINVAL;
/* ip address */ /* ip address */
len = get_word(&mesg, buf, 50); len = qword_get(&mesg, buf, 50);
if (len <= 0) return -EINVAL; if (len <= 0) return -EINVAL;
if (sscanf(buf, "%u.%u.%u.%u%c", &b1, &b2, &b3, &b4, &c) != 4) if (sscanf(buf, "%u.%u.%u.%u%c", &b1, &b2, &b3, &b4, &c) != 4)
...@@ -170,7 +170,7 @@ static int ip_map_parse(struct cache_detail *cd, ...@@ -170,7 +170,7 @@ static int ip_map_parse(struct cache_detail *cd,
return -EINVAL; return -EINVAL;
/* domainname, or empty for NEGATIVE */ /* domainname, or empty for NEGATIVE */
len = get_word(&mesg, buf, 50); len = qword_get(&mesg, buf, 50);
if (len < 0) return -EINVAL; if (len < 0) return -EINVAL;
if (len) { if (len) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment