From: "J. Bruce Fields" <bfields@fieldses.org>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: kernel-janitors@vger.kernel.org,
Jeff Layton <jlayton@poochiereds.net>,
Trond Myklebust <trond.myklebust@primarydata.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lockd: constify nlmsvc_binding structure
Date: Mon, 04 Jan 2016 22:49:07 +0000 [thread overview]
Message-ID: <20160104224907.GG30315@fieldses.org> (raw)
In-Reply-To: <1450905913-657-1-git-send-email-Julia.Lawall@lip6.fr>
On Wed, Dec 23, 2015 at 10:25:13PM +0100, Julia Lawall wrote:
> The nlmsvc_binding structure is never modified, so declare it as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>
> This assumes that whoever takes advantage of the EXPORT_SYMBOL will also
> not want to write in the fields. Is that reasonable?
Looks right to me, thanks, applying.--b.
>
> fs/lockd/svc.c | 2 +-
> fs/nfsd/lockd.c | 2 +-
> include/linux/lockd/bind.h | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> index 44d18ad..0c1a699 100644
> --- a/fs/lockd/svc.c
> +++ b/fs/lockd/svc.c
> @@ -48,7 +48,7 @@
>
> static struct svc_program nlmsvc_program;
>
> -struct nlmsvc_binding * nlmsvc_ops;
> +const struct nlmsvc_binding *nlmsvc_ops;
> EXPORT_SYMBOL_GPL(nlmsvc_ops);
>
> static DEFINE_MUTEX(nlmsvc_mutex);
> diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
> index 4d24d64..140edab6 100644
> --- a/include/linux/lockd/bind.h
> +++ b/include/linux/lockd/bind.h
> @@ -29,7 +29,7 @@ struct nlmsvc_binding {
> void (*fclose)(struct file *);
> };
>
> -extern struct nlmsvc_binding * nlmsvc_ops;
> +extern const struct nlmsvc_binding *nlmsvc_ops;
>
> /*
> * Similar to nfs_client_initdata, but without the NFS-specific
> diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c
> index 77e7a5c..1a03bc3 100644
> --- a/fs/nfsd/lockd.c
> +++ b/fs/nfsd/lockd.c
> @@ -58,7 +58,7 @@ nlm_fclose(struct file *filp)
> fput(filp);
> }
>
> -static struct nlmsvc_binding nfsd_nlm_ops = {
> +static const struct nlmsvc_binding nfsd_nlm_ops = {
> .fopen = nlm_fopen, /* open file for locking */
> .fclose = nlm_fclose, /* close file */
> };
WARNING: multiple messages have this Message-ID (diff)
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: kernel-janitors@vger.kernel.org,
Jeff Layton <jlayton@poochiereds.net>,
Trond Myklebust <trond.myklebust@primarydata.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] lockd: constify nlmsvc_binding structure
Date: Mon, 4 Jan 2016 17:49:07 -0500 [thread overview]
Message-ID: <20160104224907.GG30315@fieldses.org> (raw)
In-Reply-To: <1450905913-657-1-git-send-email-Julia.Lawall@lip6.fr>
On Wed, Dec 23, 2015 at 10:25:13PM +0100, Julia Lawall wrote:
> The nlmsvc_binding structure is never modified, so declare it as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
>
> This assumes that whoever takes advantage of the EXPORT_SYMBOL will also
> not want to write in the fields. Is that reasonable?
Looks right to me, thanks, applying.--b.
>
> fs/lockd/svc.c | 2 +-
> fs/nfsd/lockd.c | 2 +-
> include/linux/lockd/bind.h | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
> index 44d18ad..0c1a699 100644
> --- a/fs/lockd/svc.c
> +++ b/fs/lockd/svc.c
> @@ -48,7 +48,7 @@
>
> static struct svc_program nlmsvc_program;
>
> -struct nlmsvc_binding * nlmsvc_ops;
> +const struct nlmsvc_binding *nlmsvc_ops;
> EXPORT_SYMBOL_GPL(nlmsvc_ops);
>
> static DEFINE_MUTEX(nlmsvc_mutex);
> diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
> index 4d24d64..140edab6 100644
> --- a/include/linux/lockd/bind.h
> +++ b/include/linux/lockd/bind.h
> @@ -29,7 +29,7 @@ struct nlmsvc_binding {
> void (*fclose)(struct file *);
> };
>
> -extern struct nlmsvc_binding * nlmsvc_ops;
> +extern const struct nlmsvc_binding *nlmsvc_ops;
>
> /*
> * Similar to nfs_client_initdata, but without the NFS-specific
> diff --git a/fs/nfsd/lockd.c b/fs/nfsd/lockd.c
> index 77e7a5c..1a03bc3 100644
> --- a/fs/nfsd/lockd.c
> +++ b/fs/nfsd/lockd.c
> @@ -58,7 +58,7 @@ nlm_fclose(struct file *filp)
> fput(filp);
> }
>
> -static struct nlmsvc_binding nfsd_nlm_ops = {
> +static const struct nlmsvc_binding nfsd_nlm_ops = {
> .fopen = nlm_fopen, /* open file for locking */
> .fclose = nlm_fclose, /* close file */
> };
next prev parent reply other threads:[~2016-01-04 22:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 21:25 [PATCH] lockd: constify nlmsvc_binding structure Julia Lawall
2015-12-23 21:25 ` Julia Lawall
2016-01-04 22:49 ` J. Bruce Fields [this message]
2016-01-04 22:49 ` 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=20160104224907.GG30315@fieldses.org \
--to=bfields@fieldses.org \
--cc=Julia.Lawall@lip6.fr \
--cc=anna.schumaker@netapp.com \
--cc=jlayton@poochiereds.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.