提交 bc6f02e5 编写于 作者: G Greg Banks 提交者: Linus Torvalds

[PATCH] knfsd: Use SEQ_START_TOKEN instead of hardcoded magic (void*)1

Signed-off-by: NGreg Banks <gnb@melbourne.sgi.com>
Acked-by: NNeilBrown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 b41b66d6
...@@ -1086,7 +1086,7 @@ static void *e_start(struct seq_file *m, loff_t *pos) ...@@ -1086,7 +1086,7 @@ static void *e_start(struct seq_file *m, loff_t *pos)
exp_readlock(); exp_readlock();
read_lock(&svc_export_cache.hash_lock); read_lock(&svc_export_cache.hash_lock);
if (!n--) if (!n--)
return (void *)1; return SEQ_START_TOKEN;
hash = n >> 32; hash = n >> 32;
export = n & ((1LL<<32) - 1); export = n & ((1LL<<32) - 1);
...@@ -1110,7 +1110,7 @@ static void *e_next(struct seq_file *m, void *p, loff_t *pos) ...@@ -1110,7 +1110,7 @@ static void *e_next(struct seq_file *m, void *p, loff_t *pos)
struct cache_head *ch = p; struct cache_head *ch = p;
int hash = (*pos >> 32); int hash = (*pos >> 32);
if (p == (void *)1) if (p == SEQ_START_TOKEN)
hash = 0; hash = 0;
else if (ch->next == NULL) { else if (ch->next == NULL) {
hash++; hash++;
...@@ -1179,7 +1179,7 @@ static int e_show(struct seq_file *m, void *p) ...@@ -1179,7 +1179,7 @@ static int e_show(struct seq_file *m, void *p)
struct cache_head *cp = p; struct cache_head *cp = p;
struct svc_export *exp = container_of(cp, struct svc_export, h); struct svc_export *exp = container_of(cp, struct svc_export, h);
if (p == (void *)1) { if (p == SEQ_START_TOKEN) {
seq_puts(m, "# Version 1.1\n"); seq_puts(m, "# Version 1.1\n");
seq_puts(m, "# Path Client(Flags) # IPs\n"); seq_puts(m, "# Path Client(Flags) # IPs\n");
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册