lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 4 Jan 2016 17:49:07 -0500
From:	"J. Bruce Fields" <bfields@...ldses.org>
To:	Julia Lawall <Julia.Lawall@...6.fr>
Cc:	kernel-janitors@...r.kernel.org,
	Jeff Layton <jlayton@...chiereds.net>,
	Trond Myklebust <trond.myklebust@...marydata.com>,
	Anna Schumaker <anna.schumaker@...app.com>,
	linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] lockd: constify nlmsvc_binding structure

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@...6.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 */
>  };
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ