aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorEmese Revfy <re.emese@gmail.com>2010-01-18 20:58:23 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-07 20:04:49 -0500
commit52cf25d0ab7f78eeecc59ac652ed5090f69b619e (patch)
tree031d1ffb3890bd69c0260c864c512e0be62ac05c /drivers/md
parent6c1733aca0b48db4d0e660d54976a1cca25b5eaf (diff)
Driver core: Constify struct sysfs_ops in struct kobj_type
Constify struct sysfs_ops. This is part of the ops structure constification effort started by Arjan van de Ven et al. Benefits of this constification: * prevents modification of data that is shared (referenced) by many other structure instances at runtime * detects/prevents accidental (but not intentional) modification attempts on archs that enforce read-only kernel data at runtime * potentially better optimized code as the compiler can assume that the const data cannot be changed * the compiler/linker move const data into .rodata and therefore exclude them from false sharing Signed-off-by: Emese Revfy <re.emese@gmail.com> Acked-by: David Teigland <teigland@redhat.com> Acked-by: Matt Domsch <Matt_Domsch@dell.com> Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com> Acked-by: Hans J. Koch <hjk@linutronix.de> Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> Acked-by: Jens Axboe <jens.axboe@oracle.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-sysfs.c2
-rw-r--r--drivers/md/md.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-sysfs.c b/drivers/md/dm-sysfs.c
index f91b40942e07..84d2b91e4efb 100644
--- a/drivers/md/dm-sysfs.c
+++ b/drivers/md/dm-sysfs.c
@@ -75,7 +75,7 @@ static struct attribute *dm_attrs[] = {
75 NULL, 75 NULL,
76}; 76};
77 77
78static struct sysfs_ops dm_sysfs_ops = { 78static const struct sysfs_ops dm_sysfs_ops = {
79 .show = dm_attr_show, 79 .show = dm_attr_show,
80}; 80};
81 81
diff --git a/drivers/md/md.c b/drivers/md/md.c
index a20a71e5efd3..fdc1890b6ac5 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2642,7 +2642,7 @@ static void rdev_free(struct kobject *ko)
2642 mdk_rdev_t *rdev = container_of(ko, mdk_rdev_t, kobj); 2642 mdk_rdev_t *rdev = container_of(ko, mdk_rdev_t, kobj);
2643 kfree(rdev); 2643 kfree(rdev);
2644} 2644}
2645static struct sysfs_ops rdev_sysfs_ops = { 2645static const struct sysfs_ops rdev_sysfs_ops = {
2646 .show = rdev_attr_show, 2646 .show = rdev_attr_show,
2647 .store = rdev_attr_store, 2647 .store = rdev_attr_store,
2648}; 2648};
@@ -4059,7 +4059,7 @@ static void md_free(struct kobject *ko)
4059 kfree(mddev); 4059 kfree(mddev);
4060} 4060}
4061 4061
4062static struct sysfs_ops md_sysfs_ops = { 4062static const struct sysfs_ops md_sysfs_ops = {
4063 .show = md_attr_show, 4063 .show = md_attr_show,
4064 .store = md_attr_store, 4064 .store = md_attr_store,
4065}; 4065};