From: Greg Banks <gnb@melbourne.sgi.com>
To: Neil Brown <neilb@suse.de>
Cc: Andrew Morton <akpm@osdl.org>,
Linux NFS Mailing List <nfs@lists.sourceforge.net>,
Josef Sipek <jsipek@fsl.cs.sunysb.edu>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [NFS] [PATCH 002 of 9] knfsd: knfsd: Remove an unused variable from e_show().
Date: Tue, 25 Jul 2006 15:53:11 +1000 [thread overview]
Message-ID: <1153806790.21040.45.camel@hole.melbourne.sgi.com> (raw)
In-Reply-To: <1153801950.1547.657.camel@hole.melbourne.sgi.com>
On Tue, 2006-07-25 at 14:32, Greg Banks wrote:
> On Tue, 2006-07-25 at 14:20, Neil Brown wrote:
> > On Tuesday July 25, jsipek@fsl.cs.sunysb.edu wrote:
> > > On Tue, Jul 25, 2006 at 11:54:32AM +1000, NeilBrown wrote:
> > > ...
> >
> > Probably. We just need a pointer value that is definitely not a
> > pointer to a valid cache_head object, and is not NULL.
> > (void*)1 seems a reasonable choice, but maybe #defineing something
> > would help.
> >
> > Patches welcome.
>
> This trivial patch compiles.
But only applies to sles10 <sigh>. Here's the version
which applies to today's GIT.
--
knfsd: Use SEQ_START_TOKEN instead of hardcoded magic (void*)1.
Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
---
fs/nfsd/export.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
Index: linus-git/fs/nfsd/export.c
===================================================================
--- linus-git.orig/fs/nfsd/export.c 2006-07-25 14:55:28.000000000 +1000
+++ linus-git/fs/nfsd/export.c 2006-07-25 15:40:03.987257265 +1000
@@ -1086,7 +1086,7 @@ static void *e_start(struct seq_file *m,
exp_readlock();
read_lock(&svc_export_cache.hash_lock);
if (!n--)
- return (void *)1;
+ return SEQ_START_TOKEN;
hash = n >> 32;
export = n & ((1LL<<32) - 1);
@@ -1110,7 +1110,7 @@ static void *e_next(struct seq_file *m,
struct cache_head *ch = p;
int hash = (*pos >> 32);
- if (p == (void *)1)
+ if (p == SEQ_START_TOKEN)
hash = 0;
else if (ch->next == NULL) {
hash++;
@@ -1179,7 +1179,7 @@ static int e_show(struct seq_file *m, vo
struct cache_head *cp = p;
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, "# Path Client(Flags) # IPs\n");
return 0;
Greg.
--
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
I don't speak for SGI.
next prev parent reply other threads:[~2006-07-25 5:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-25 1:54 [PATCH 000 of 9] knfsd: Introduction NeilBrown
2006-07-25 1:54 ` [PATCH 001 of 9] knfsd: knfsd: Add some missing newlines in printks NeilBrown
2006-07-25 1:54 ` [PATCH 002 of 9] knfsd: knfsd: Remove an unused variable from e_show() NeilBrown
2006-07-25 4:10 ` Josef Sipek
2006-07-25 4:20 ` Neil Brown
2006-07-25 4:24 ` [NFS] " Greg Banks
2006-07-25 4:32 ` Greg Banks
2006-07-25 4:36 ` Neil Brown
2006-07-25 5:53 ` Greg Banks [this message]
2006-07-25 1:54 ` [PATCH 003 of 9] knfsd: knfsd: Remove an unused variable from auth_unix_lookup() NeilBrown
2006-07-25 1:54 ` [PATCH 004 of 9] knfsd: Add a callback for when last rpc thread finishes NeilBrown
2006-07-25 1:54 ` [PATCH 005 of 9] knfsd: Be more selective in which sockets lockd listens on NeilBrown
2006-07-26 19:17 ` [NFS] " J. Bruce Fields
2006-07-28 2:32 ` Neil Brown
2006-07-25 1:54 ` [PATCH 006 of 9] knfsd: Remove nfsd_versbits as intermediate storage for desired versions NeilBrown
2006-07-26 19:34 ` [NFS] " J. Bruce Fields
2006-07-25 1:54 ` [PATCH 007 of 9] knfsd: Separate out some parts of nfsd_svc, which start nfs servers NeilBrown
2006-07-26 6:42 ` Andrew Morton
2006-07-25 1:55 ` [PATCH 008 of 9] knfsd: Define new nfsdfs file: portlist - contains list of ports NeilBrown
2006-07-25 1:55 ` [PATCH 009 of 9] knfsd: Allow sockets to be passed to nfsd via 'portlist' NeilBrown
2006-07-26 6:53 ` Andrew Morton
2006-07-26 20:41 ` [NFS] " J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1153806790.21040.45.camel@hole.melbourne.sgi.com \
--to=gnb@melbourne.sgi.com \
--cc=akpm@osdl.org \
--cc=jsipek@fsl.cs.sunysb.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=neilb@suse.de \
--cc=nfs@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).