Commit 121bed24 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] Remove path buffer passed around by cache_show routines

this was need for paths, but now we have seq_path...
parent cde37947
......@@ -195,8 +195,7 @@ int expkey_parse(struct cache_detail *cd, char *mesg, int mlen)
static int expkey_show(struct seq_file *m,
struct cache_detail *cd,
struct cache_head *h,
char *pbuf)
struct cache_head *h)
{
struct svc_expkey *ek ;
......@@ -437,8 +436,7 @@ static void exp_flags(struct seq_file *m, int flag, int fsid, uid_t anonu, uid_t
static int svc_export_show(struct seq_file *m,
struct cache_detail *cd,
struct cache_head *h,
char *pbuf)
struct cache_head *h)
{
struct svc_export *exp ;
......@@ -1045,7 +1043,7 @@ static int e_show(struct seq_file *m, void *p)
if (cache_check(&svc_export_cache, &exp->h, NULL))
return 0;
if (cache_put(&exp->h, &svc_export_cache)) BUG();
return svc_export_show(m, &svc_export_cache, cp, NULL);
return svc_export_show(m, &svc_export_cache, cp);
}
struct seq_operations nfs_exports_op = {
......
......@@ -80,8 +80,7 @@ struct cache_detail {
int (*cache_show)(struct seq_file *m,
struct cache_detail *cd,
struct cache_head *h,
char *pbuf);
struct cache_head *h);
/* fields below this comment are for internal use
* and should not be touched by cache owners
......
......@@ -1018,7 +1018,6 @@ int qword_get(char **bpp, char *dest, int bufsize)
struct handle {
struct cache_detail *cd;
char *pbuf;
};
static void *c_start(struct seq_file *m, loff_t *pos)
......@@ -1087,10 +1086,9 @@ static int c_show(struct seq_file *m, void *p)
{
struct cache_head *cp = p;
struct cache_detail *cd = ((struct handle*)m->private)->cd;
char *pbuf = ((struct handle*)m->private)->pbuf;
if (p == (void *)1)
return cd->cache_show(m, cd, NULL, pbuf);
return cd->cache_show(m, cd, NULL);
ifdebug(CACHE)
seq_printf(m, "# expiry=%ld refcnt=%d\n",
......@@ -1102,7 +1100,7 @@ static int c_show(struct seq_file *m, void *p)
else
cache_put(cp, cd);
return cd->cache_show(m, cd, cp, pbuf);
return cd->cache_show(m, cd, cp);
}
struct seq_operations cache_content_op = {
......@@ -1115,26 +1113,19 @@ struct seq_operations cache_content_op = {
static int content_open(struct inode *inode, struct file *file)
{
int res;
char *namebuf = kmalloc(PAGE_SIZE, GFP_KERNEL);
struct handle *han;
struct cache_detail *cd = PDE(inode)->data;
if (namebuf == NULL)
return -ENOMEM;
han = kmalloc(sizeof(*han), GFP_KERNEL);
if (han == NULL) {
kfree(namebuf);
if (han == NULL)
return -ENOMEM;
}
han->pbuf = namebuf;
han->cd = cd;
res = seq_open(file, &cache_content_op);
if (res) {
kfree(namebuf);
if (res)
kfree(han);
} else
else
((struct seq_file *)file->private_data)->private = han;
return res;
......@@ -1143,7 +1134,6 @@ static int content_release(struct inode *inode, struct file *file)
{
struct seq_file *m = (struct seq_file *)file->private_data;
struct handle *han = m->private;
kfree(han->pbuf);
kfree(han);
m->private = NULL;
return seq_release(inode, file);
......
......@@ -215,8 +215,7 @@ static int ip_map_parse(struct cache_detail *cd,
static int ip_map_show(struct seq_file *m,
struct cache_detail *cd,
struct cache_head *h,
char *pbuf)
struct cache_head *h)
{
struct ip_map *im;
struct in_addr addr;
......
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