[PATCH 04/31] Constify struct block_device_operations for 2.6.32v1

From: Emese Revfy
Date: Fri Dec 04 2009 - 17:10:20 EST


From: Emese Revfy <re.emese@xxxxxxxxx>

Constify struct block_device_operations.

Signed-off-by: Emese Revfy <re.emese@xxxxxxxxx>
---
drivers/staging/dst/dcore.c | 2 +-
drivers/staging/hv/blkvsc_drv.c | 2 +-
include/linux/blkdev.h | 22 +++++++++++-----------
3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/dst/dcore.c b/drivers/staging/dst/dcore.c
index c24e4e0..4f62b69 100644
--- a/drivers/staging/dst/dcore.c
+++ b/drivers/staging/dst/dcore.c
@@ -149,7 +149,7 @@ static int dst_bdev_release(struct gendisk *disk, fmode_t mode)
return 0;
}

-static struct block_device_operations dst_blk_ops = {
+static const struct block_device_operations dst_blk_ops = {
.open = dst_bdev_open,
.release = dst_bdev_release,
.owner = THIS_MODULE,
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 62b2828..0a47695 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -153,7 +153,7 @@ static int blkvsc_ringbuffer_size = BLKVSC_RING_BUFFER_SIZE;
/* The one and only one */
static struct blkvsc_driver_context g_blkvsc_drv;

-static struct block_device_operations block_ops = {
+static const struct block_device_operations block_ops = {
.owner = THIS_MODULE,
.open = blkvsc_open,
.release = blkvsc_release,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 221cecd..82f20f0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1253,19 +1253,19 @@ static inline int blk_integrity_rq(struct request *rq)
#endif /* CONFIG_BLK_DEV_INTEGRITY */

struct block_device_operations {
- int (*open) (struct block_device *, fmode_t);
- int (*release) (struct gendisk *, fmode_t);
- int (*locked_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
- int (*ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
- int (*compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
- int (*direct_access) (struct block_device *, sector_t,
+ int (* const open) (struct block_device *, fmode_t);
+ int (* const release) (struct gendisk *, fmode_t);
+ int (* const locked_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
+ int (* const ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
+ int (* const compat_ioctl) (struct block_device *, fmode_t, unsigned, unsigned long);
+ int (* const direct_access) (struct block_device *, sector_t,
void **, unsigned long *);
- int (*media_changed) (struct gendisk *);
- unsigned long long (*set_capacity) (struct gendisk *,
+ int (* const media_changed) (struct gendisk *);
+ unsigned long long (* const set_capacity) (struct gendisk *,
unsigned long long);
- int (*revalidate_disk) (struct gendisk *);
- int (*getgeo)(struct block_device *, struct hd_geometry *);
- struct module *owner;
+ int (* const revalidate_disk) (struct gendisk *);
+ int (*const getgeo)(struct block_device *, struct hd_geometry *);
+ const struct module *owner;
};

extern int __blkdev_driver_ioctl(struct block_device *, fmode_t, unsigned int,

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/