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,
struct svc_expkey *ek = container_of(h, struct svc_expkey, h);
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);
add_word(bpp, blen, type);
add_hex(bpp, blen, (char*)ek->ek_fsid, ek->ek_fsidtype==0?8:4);
qword_add(bpp, blen, type);
qword_addhex(bpp, blen, (char*)ek->ek_fsid, ek->ek_fsidtype==0?8:4);
(*bpp)[-1] = '\n';
}
......@@ -114,7 +114,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
if (!buf) goto out;
err = -EINVAL;
if ((len=get_word(&mesg, buf, PAGE_SIZE)) <= 0)
if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
goto out;
err = -ENOENT;
......@@ -124,7 +124,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
dprintk("found domain %s\n", buf);
err = -EINVAL;
if ((len=get_word(&mesg, buf, PAGE_SIZE)) <= 0)
if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
goto out;
fsidtype = simple_strtoul(buf, &ep, 10);
if (*ep)
......@@ -132,7 +132,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
dprintk("found fsidtype %d\n", fsidtype);
if (fsidtype > 1)
goto out;
if ((len=get_word(&mesg, buf, PAGE_SIZE)) <= 0)
if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
goto out;
dprintk("found fsid length %d\n", len);
if (len != ((fsidtype==0)?8:4))
......@@ -149,7 +149,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
memcpy(key.ek_fsid, buf, len);
/* 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;
dprintk("Path seems to be <%s>\n", buf);
err = 0;
......@@ -269,9 +269,9 @@ void svc_export_request(struct cache_detail *cd,
struct svc_export *exp = container_of(h, struct svc_export, h);
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);
add_word(bpp, blen, pth);
qword_add(bpp, blen, pth);
(*bpp)[-1] = '\n';
}
......@@ -298,7 +298,7 @@ int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
if (!buf) goto out;
/* client */
len = get_word(&mesg, buf, PAGE_SIZE);
len = qword_get(&mesg, buf, PAGE_SIZE);
if (len <= 0) return -EINVAL;
err = -ENOENT;
dom = auth_domain_find(buf);
......@@ -307,7 +307,7 @@ int svc_export_parse(struct cache_detail *cd, char *mesg, int mlen)
/* path */
err = -EINVAL;
if ((len=get_word(&mesg, buf, PAGE_SIZE)) <= 0)
if ((len=qword_get(&mesg, buf, PAGE_SIZE)) <= 0)
goto out;
err = path_lookup(buf, 0, &nd);
if (err) goto out;
......
......@@ -271,16 +271,16 @@ extern int cache_unregister(struct cache_detail *cd);
extern struct cache_detail *cache_find(char *name);
extern void cache_drop(struct cache_detail *detail);
extern void add_word(char **bpp, int *lp, char *str);
extern void add_hex(char **bpp, int *lp, char *buf, int blen);
extern int get_word(char **bpp, char *dest, int bufsize);
extern void qword_add(char **bpp, int *lp, char *str);
extern void qword_addhex(char **bpp, int *lp, char *buf, int blen);
extern int qword_get(char **bpp, char *dest, int bufsize);
static inline int get_int(char **bpp, int *anint)
{
char buf[50];
char *ep;
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 -ENOENT;
rv = simple_strtol(buf, &ep, 0);
......
......@@ -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;
int len = *lp;
......@@ -785,7 +785,7 @@ void add_word(char **bpp, int *lp, char *str)
*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;
int len = *lp;
......@@ -879,7 +879,7 @@ static int cache_make_upcall(struct cache_detail *detail, struct cache_head *h)
*/
#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 */
char *bp = *bpp;
......
......@@ -94,22 +94,22 @@ EXPORT_SYMBOL(svc_proc_read);
/* caching... */
EXPORT_SYMBOL(auth_domain_find);
EXPORT_SYMBOL(cache_fresh);
EXPORT_SYMBOL(unix_domain_find);
EXPORT_SYMBOL(auth_domain_put);
EXPORT_SYMBOL(cache_flush);
EXPORT_SYMBOL(cache_unregister);
EXPORT_SYMBOL(add_hex);
EXPORT_SYMBOL(auth_unix_add_addr);
EXPORT_SYMBOL(auth_unix_forget_old);
EXPORT_SYMBOL(auth_unix_lookup);
EXPORT_SYMBOL(cache_check);
EXPORT_SYMBOL(svcauth_unix_purge);
EXPORT_SYMBOL(get_word);
EXPORT_SYMBOL(cache_clean);
EXPORT_SYMBOL(cache_register);
EXPORT_SYMBOL(auth_unix_lookup);
EXPORT_SYMBOL(auth_unix_add_addr);
EXPORT_SYMBOL(cache_flush);
EXPORT_SYMBOL(cache_fresh);
EXPORT_SYMBOL(cache_init);
EXPORT_SYMBOL(auth_unix_forget_old);
EXPORT_SYMBOL(add_word);
EXPORT_SYMBOL(cache_register);
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 */
EXPORT_SYMBOL(xdr_encode_array);
......
......@@ -132,8 +132,8 @@ static void ip_map_request(struct cache_detail *cd,
ntohl(addr) >> 8 & 0xff,
ntohl(addr) >> 0 & 0xff);
add_word(bpp, blen, im->m_class);
add_word(bpp, blen, text_addr);
qword_add(bpp, blen, im->m_class);
qword_add(bpp, blen, text_addr);
(*bpp)[-1] = '\n';
}
......@@ -155,11 +155,11 @@ static int ip_map_parse(struct cache_detail *cd,
mesg[mlen-1] = 0;
/* class */
len = get_word(&mesg, class, 50);
len = qword_get(&mesg, class, 50);
if (len <= 0) return -EINVAL;
/* ip address */
len = get_word(&mesg, buf, 50);
len = qword_get(&mesg, buf, 50);
if (len <= 0) return -EINVAL;
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,
return -EINVAL;
/* domainname, or empty for NEGATIVE */
len = get_word(&mesg, buf, 50);
len = qword_get(&mesg, buf, 50);
if (len < 0) return -EINVAL;
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