2008-08-27 20:58:17

by Chuck Lever III

[permalink] [raw]
Subject: [PATCH 2/6] NLM: Clean up before introducing new debugging messages

We're about to introduce some extra debugging messages in nlm_lookup_host().
Bring the coding style up to date first so we can cleanly introduce the new
debugging messages.

Signed-off-by: Chuck Lever <[email protected]>
---

fs/lockd/host.c | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index a17664c..cb26e3d 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -103,16 +103,19 @@ static struct nlm_host *nlm_lookup_host(int server,
nlm_get_host(host);
goto out;
}
- if (nsm)
- atomic_inc(&nsm->sm_count);
-
- host = NULL;

- /* Sadly, the host isn't in our hash table yet. See if
- * we have an NSM handle for it. If not, create one.
+ /*
+ * The host wasn't in our hash table. If we don't
+ * have an NSM handle for it yet, create one.
*/
- if (!nsm && !(nsm = nsm_find(sin, hostname, hostname_len)))
- goto out;
+ if (nsm)
+ atomic_inc(&nsm->sm_count);
+ else {
+ host = NULL;
+ nsm = nsm_find(sin, hostname, hostname_len);
+ if (!nsm)
+ goto out;
+ }

host = kzalloc(sizeof(*host), GFP_KERNEL);
if (!host) {



2008-09-11 21:42:30

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 2/6] NLM: Clean up before introducing new debugging messages

On Wed, Aug 27, 2008 at 04:57:15PM -0400, Chuck Lever wrote:
> We're about to introduce some extra debugging messages in nlm_lookup_host().
> Bring the coding style up to date first so we can cleanly introduce the new
> debugging messages.

Looks fine to me.--b.

>
> Signed-off-by: Chuck Lever <[email protected]>
> ---
>
> fs/lockd/host.c | 19 +++++++++++--------
> 1 files changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/fs/lockd/host.c b/fs/lockd/host.c
> index a17664c..cb26e3d 100644
> --- a/fs/lockd/host.c
> +++ b/fs/lockd/host.c
> @@ -103,16 +103,19 @@ static struct nlm_host *nlm_lookup_host(int server,
> nlm_get_host(host);
> goto out;
> }
> - if (nsm)
> - atomic_inc(&nsm->sm_count);
> -
> - host = NULL;
>
> - /* Sadly, the host isn't in our hash table yet. See if
> - * we have an NSM handle for it. If not, create one.
> + /*
> + * The host wasn't in our hash table. If we don't
> + * have an NSM handle for it yet, create one.
> */
> - if (!nsm && !(nsm = nsm_find(sin, hostname, hostname_len)))
> - goto out;
> + if (nsm)
> + atomic_inc(&nsm->sm_count);
> + else {
> + host = NULL;
> + nsm = nsm_find(sin, hostname, hostname_len);
> + if (!nsm)
> + goto out;
> + }
>
> host = kzalloc(sizeof(*host), GFP_KERNEL);
> if (!host) {
>

2008-09-11 21:45:45

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 2/6] NLM: Clean up before introducing new debugging messages

On Thu, Sep 11, 2008 at 05:42:25PM -0400, bfields wrote:
> On Wed, Aug 27, 2008 at 04:57:15PM -0400, Chuck Lever wrote:
> > We're about to introduce some extra debugging messages in nlm_lookup_host().
> > Bring the coding style up to date first so we can cleanly introduce the new
> > debugging messages.
>
> Looks fine to me.--b.

Whoops, sorry, ignore me, I was starting to run through patches I've
already applied....--b.

>
> >
> > Signed-off-by: Chuck Lever <[email protected]>
> > ---
> >
> > fs/lockd/host.c | 19 +++++++++++--------
> > 1 files changed, 11 insertions(+), 8 deletions(-)
> >
> > diff --git a/fs/lockd/host.c b/fs/lockd/host.c
> > index a17664c..cb26e3d 100644
> > --- a/fs/lockd/host.c
> > +++ b/fs/lockd/host.c
> > @@ -103,16 +103,19 @@ static struct nlm_host *nlm_lookup_host(int server,
> > nlm_get_host(host);
> > goto out;
> > }
> > - if (nsm)
> > - atomic_inc(&nsm->sm_count);
> > -
> > - host = NULL;
> >
> > - /* Sadly, the host isn't in our hash table yet. See if
> > - * we have an NSM handle for it. If not, create one.
> > + /*
> > + * The host wasn't in our hash table. If we don't
> > + * have an NSM handle for it yet, create one.
> > */
> > - if (!nsm && !(nsm = nsm_find(sin, hostname, hostname_len)))
> > - goto out;
> > + if (nsm)
> > + atomic_inc(&nsm->sm_count);
> > + else {
> > + host = NULL;
> > + nsm = nsm_find(sin, hostname, hostname_len);
> > + if (!nsm)
> > + goto out;
> > + }
> >
> > host = kzalloc(sizeof(*host), GFP_KERNEL);
> > if (!host) {
> >