Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1244655
| From | Brian Foster <bfoster@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] xfs: constify sysfs_ops structures |
| Date | 2015-10-12 14:50 +0200 |
| Message-ID | <qiKIa-7EQ-19@gated-at.bofh.it> (permalink) |
| References | <qimw9-64u-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sun, Oct 11, 2015 at 12:42:26PM +0200, Julia Lawall wrote:
> These sysfs_ops structures are never modified. All other sysfs_ops
> structures in the kernel are declared as const.
>
> Done with the help of Coccinelle.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
The fix looks correct, but these data structures just happened to be
removed and condensed into a more generic xfs_sysfs_ops definition as
part of the recent per-mount stats series. See commit a27c2640 ("xfs:
consolidate sysfs ops") for reference.
Brian
> ---
> fs/xfs/xfs_sysfs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
> index aa03670..192c865 100644
> --- a/fs/xfs/xfs_sysfs.c
> +++ b/fs/xfs/xfs_sysfs.c
> @@ -112,7 +112,7 @@ xfs_dbg_store(
> return xfs_attr->store ? xfs_attr->store(buf, count, NULL) : 0;
> }
>
> -static struct sysfs_ops xfs_dbg_ops = {
> +static const struct sysfs_ops xfs_dbg_ops = {
> .show = xfs_dbg_show,
> .store = xfs_dbg_store,
> };
> @@ -227,7 +227,7 @@ xfs_log_store(
> return xfs_attr->store ? xfs_attr->store(buf, count, log) : 0;
> }
>
> -static struct sysfs_ops xfs_log_ops = {
> +static const struct sysfs_ops xfs_log_ops = {
> .show = xfs_log_show,
> .store = xfs_log_store,
> };
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] xfs: constify sysfs_ops structures Julia Lawall <Julia.Lawall@lip6.fr> - 2015-10-11 13:00 +0200 Re: [PATCH] xfs: constify sysfs_ops structures Brian Foster <bfoster@redhat.com> - 2015-10-12 14:50 +0200
csiph-web