Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1688661 > unrolled thread
| Started by | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| First post | 2017-07-17 07:50 +0200 |
| Last post | 2017-07-17 09:50 +0200 |
| Articles | 10 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/4] constify lustre attribute_group structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-17 07:50 +0200
[PATCH 1/4] staging: lustre: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-17 07:50 +0200
[PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-17 07:50 +0200
Re: [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-17 09:50 +0200
Re: [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-17 09:50 +0200
[PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-17 08:00 +0200
Re: [PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-17 09:50 +0200
[PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-17 08:00 +0200
Re: [PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-17 09:50 +0200
Re: [PATCH 0/4] constify lustre attribute_group structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-17 09:50 +0200
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-07-17 07:50 +0200 |
| Subject | [PATCH 0/4] constify lustre attribute_group structures |
| Message-ID | <u474R-Uc-9@gated-at.bofh.it> |
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. Arvind Yadav (4): [PATCH 1/4] staging: lustre: constify attribute_group structures. [PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures. [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures. [PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures. drivers/staging/lustre/lustre/include/lprocfs_status.h | 4 ++-- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +- drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 2 +- drivers/staging/lustre/lustre/lov/lproc_lov.c | 2 +- drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 2 +- drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +- drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +- drivers/staging/lustre/lustre/osc/lproc_osc.c | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) -- 1.9.1
[toc] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-07-17 07:50 +0200 |
| Subject | [PATCH 1/4] staging: lustre: constify attribute_group structures. |
| Message-ID | <u474R-Uc-13@gated-at.bofh.it> |
| In reply to | #1688661 |
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: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/staging/lustre/lustre/include/lprocfs_status.h | 4 ++--
drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 2 +-
drivers/staging/lustre/lustre/lov/lproc_lov.c | 2 +-
drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 2 +-
drivers/staging/lustre/lustre/osc/lproc_osc.c | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index 915283c..9054d37 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -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,
diff --git a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
index bf25f88..4c13e39 100644
--- a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
+++ b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
@@ -161,7 +161,7 @@ static int lmv_target_seq_open(struct inode *inode, struct file *file)
NULL,
};
-static struct attribute_group lmv_attr_group = {
+static const struct attribute_group lmv_attr_group = {
.attrs = lmv_attrs,
};
diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c b/drivers/staging/lustre/lustre/lov/lproc_lov.c
index eb6d30d..ce46821 100644
--- a/drivers/staging/lustre/lustre/lov/lproc_lov.c
+++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c
@@ -279,7 +279,7 @@ static int lov_target_seq_open(struct inode *inode, struct file *file)
NULL,
};
-static struct attribute_group lov_attr_group = {
+static const struct attribute_group lov_attr_group = {
.attrs = lov_attrs,
};
diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index 9021c46..9fea535 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -219,7 +219,7 @@ static ssize_t max_pages_per_rpc_show(struct kobject *kobj,
NULL,
};
-static struct attribute_group mdc_attr_group = {
+static const struct attribute_group mdc_attr_group = {
.attrs = mdc_attrs,
};
diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c
index 86f252d..6e0fd15 100644
--- a/drivers/staging/lustre/lustre/osc/lproc_osc.c
+++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c
@@ -831,7 +831,7 @@ int lproc_osc_attach_seqstat(struct obd_device *dev)
NULL,
};
-static struct attribute_group osc_attr_group = {
+static const struct attribute_group osc_attr_group = {
.attrs = osc_attrs,
};
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-07-17 07:50 +0200 |
| Subject | [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures. |
| Message-ID | <u474R-Uc-15@gated-at.bofh.it> |
| In reply to | #1688661 |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 9f5e829..eb88bd9 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -405,7 +405,7 @@ static int obd_device_list_open(struct inode *inode, struct file *file)
struct kobject *lustre_kobj;
EXPORT_SYMBOL_GPL(lustre_kobj);
-static struct attribute_group lustre_attr_group = {
+static const struct attribute_group lustre_attr_group = {
.attrs = lustre_attrs,
};
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-07-17 09:50 +0200 |
| Subject | Re: [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures. |
| Message-ID | <u48X0-26x-15@gated-at.bofh.it> |
| In reply to | #1688663 |
Sorry for noise. Please ignore this.
~arvind
On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote:
> 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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
> index 9f5e829..eb88bd9 100644
> --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
> +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
> @@ -405,7 +405,7 @@ static int obd_device_list_open(struct inode *inode, struct file *file)
> struct kobject *lustre_kobj;
> EXPORT_SYMBOL_GPL(lustre_kobj);
>
> -static struct attribute_group lustre_attr_group = {
> +static const struct attribute_group lustre_attr_group = {
> .attrs = lustre_attrs,
> };
>
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-07-17 09:50 +0200 |
| Subject | Re: [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures. |
| Message-ID | <u48X1-26x-27@gated-at.bofh.it> |
| In reply to | #1688663 |
Sorry for noise. Please ignore this.
~arvind
On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote:
> 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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
> index 9f5e829..eb88bd9 100644
> --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
> +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
> @@ -405,7 +405,7 @@ static int obd_device_list_open(struct inode *inode, struct file *file)
> struct kobject *lustre_kobj;
> EXPORT_SYMBOL_GPL(lustre_kobj);
>
> -static struct attribute_group lustre_attr_group = {
> +static const struct attribute_group lustre_attr_group = {
> .attrs = lustre_attrs,
> };
>
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-07-17 08:00 +0200 |
| Subject | [PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures. |
| Message-ID | <u47ex-Xp-1@gated-at.bofh.it> |
| In reply to | #1688661 |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
index fff930f..e0c3e5d 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
@@ -926,7 +926,7 @@ static ssize_t cancel_unused_locks_before_replay_store(struct kobject *kobj,
NULL,
};
-static struct attribute_group ldlm_attr_group = {
+static const struct attribute_group ldlm_attr_group = {
.attrs = ldlm_attrs,
};
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-07-17 09:50 +0200 |
| Subject | Re: [PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures. |
| Message-ID | <u48X0-26x-19@gated-at.bofh.it> |
| In reply to | #1688667 |
Sorry for noise. Please ignore this.
~arvind
On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote:
> 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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> index fff930f..e0c3e5d 100644
> --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c
> @@ -926,7 +926,7 @@ static ssize_t cancel_unused_locks_before_replay_store(struct kobject *kobj,
> NULL,
> };
>
> -static struct attribute_group ldlm_attr_group = {
> +static const struct attribute_group ldlm_attr_group = {
> .attrs = ldlm_attrs,
> };
>
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-07-17 08:00 +0200 |
| Subject | [PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures. |
| Message-ID | <u47ez-Xp-21@gated-at.bofh.it> |
| In reply to | #1688661 |
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.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index bc19f19..ba41983 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1031,7 +1031,7 @@ static void obd_sysfs_release(struct kobject *kobj)
};
int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
- struct attribute_group *attrs)
+ const struct attribute_group *attrs)
{
int rc = 0;
--
1.9.1
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-07-17 09:50 +0200 |
| Subject | Re: [PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures. |
| Message-ID | <u48X0-26x-5@gated-at.bofh.it> |
| In reply to | #1688674 |
Sorry for noise. Please ignore this. This change should not be separate.
~arvind
On Monday 17 July 2017 11:19 AM, Arvind Yadav wrote:
> 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.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> index bc19f19..ba41983 100644
> --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
> @@ -1031,7 +1031,7 @@ static void obd_sysfs_release(struct kobject *kobj)
> };
>
> int lprocfs_obd_setup(struct obd_device *obd, struct lprocfs_vars *list,
> - struct attribute_group *attrs)
> + const struct attribute_group *attrs)
> {
> int rc = 0;
>
[toc] | [prev] | [next] | [standalone]
| From | Arvind Yadav <arvind.yadav.cs@gmail.com> |
|---|---|
| Date | 2017-07-17 09:50 +0200 |
| Message-ID | <u48X0-26x-21@gated-at.bofh.it> |
| In reply to | #1688661 |
Sorry for noise. Please ignore this. It's having build error. Again, I will push all changes. ~arvind On Monday 17 July 2017 11:18 AM, Arvind Yadav wrote: > 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. > > Arvind Yadav (4): > [PATCH 1/4] staging: lustre: constify attribute_group structures. > [PATCH 2/4] staging: lustre: ldlm: constify attribute_group structures. > [PATCH 3/4] staging: lustre: obdclass: linux: constify attribute_group structures. > [PATCH 4/4] staging: lustre: obdclass: constify attribute_group structures. > > drivers/staging/lustre/lustre/include/lprocfs_status.h | 4 ++-- > drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +- > drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 2 +- > drivers/staging/lustre/lustre/lov/lproc_lov.c | 2 +- > drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 2 +- > drivers/staging/lustre/lustre/obdclass/linux/linux-module.c | 2 +- > drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 2 +- > drivers/staging/lustre/lustre/osc/lproc_osc.c | 2 +- > 8 files changed, 9 insertions(+), 9 deletions(-) >
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web