Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 36b56141 authored by Arvind Yadav's avatar Arvind Yadav Committed by Greg Kroah-Hartman
Browse files

staging: lustre: constify attribute_group structures.



attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
   9489	    992	     40	  10521	   2919	lustre/lustre/osc/lproc_osc.o
   1289	    288	      0	   1577	    629	lustre/lustre/lmv/lproc_lmv.o
   3794	    928	     40	   4762	   129a	lustre/lustre/lov/lproc_lov.o
   3802	    576	     40	   4418	   1142	lustre/lustre/mdc/lproc_mdc.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
   9553	    928	     40	  10521	   2919	lustre/lustre/osc/lproc_osc.o
   1353	    224	      0	   1577	    629	lustre/lustre/lmv/lproc_lmv.o
   3858	    864	     40	   4762	   129a	lustre/lustre/lov/lproc_lov.o
   3866	    512	     40	   4418	   1142	lustre/lustre/mdc/lproc_mdc.o

Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 52bc17b0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ struct lprocfs_vars {

struct lprocfs_static_vars {
	struct lprocfs_vars *obd_vars;
	struct attribute_group *sysfs_vars;
	const struct attribute_group *sysfs_vars;
};

/* if we find more consumers this could be generalized */
@@ -468,7 +468,7 @@ struct dentry *ldebugfs_register(const char *name,
void ldebugfs_remove(struct dentry **entryp);

int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
		      struct attribute_group *attrs);
		      const struct attribute_group *attrs);
int lprocfs_obd_cleanup(struct obd_device *obd);

int ldebugfs_seq_create(struct dentry *parent,
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ static struct attribute *lmv_attrs[] = {
	NULL,
};

static struct attribute_group lmv_attr_group = {
static const struct attribute_group lmv_attr_group = {
	.attrs = lmv_attrs,
};

+1 −1
Original line number Diff line number Diff line
@@ -279,7 +279,7 @@ static struct attribute *lov_attrs[] = {
	NULL,
};

static struct attribute_group lov_attr_group = {
static const struct attribute_group lov_attr_group = {
	.attrs = lov_attrs,
};

+1 −1
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ static struct attribute *mdc_attrs[] = {
	NULL,
};

static struct attribute_group mdc_attr_group = {
static const struct attribute_group mdc_attr_group = {
	.attrs = mdc_attrs,
};

+1 −1
Original line number Diff line number Diff line
@@ -1031,7 +1031,7 @@ static struct kobj_type obd_ktype = {
};

int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
		      struct attribute_group *attrs)
		      const struct attribute_group *attrs)
{
	int rc = 0;

Loading