summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-02-08 20:42:52 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2014-04-01 23:19:31 -0400
commit86d564c84c38b1ec06d9f2120d6a7373dcaeff0c (patch)
tree4beaed1ab50eada4439301c72260d99419fd71e5
parent480f40de91e74190281309fd0ecb2d0414603c2e (diff)
constify blk_rq_map_user_iov() and friends
sg_iovec array passed to it can be const Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--block/blk-map.c2
-rw-r--r--fs/bio.c10
-rw-r--r--include/linux/bio.h5
-rw-r--r--include/linux/blkdev.h4
4 files changed, 11 insertions, 10 deletions
diff --git a/block/blk-map.c b/block/blk-map.c
index ae4ae1047fd9..86d93779c066 100644
--- a/block/blk-map.c
+++ b/block/blk-map.c
@@ -188,7 +188,7 @@ EXPORT_SYMBOL(blk_rq_map_user);
188 * unmapping. 188 * unmapping.
189 */ 189 */
190int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, 190int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
191 struct rq_map_data *map_data, struct sg_iovec *iov, 191 struct rq_map_data *map_data, const struct sg_iovec *iov,
192 int iov_count, unsigned int len, gfp_t gfp_mask) 192 int iov_count, unsigned int len, gfp_t gfp_mask)
193{ 193{
194 struct bio *bio; 194 struct bio *bio;
diff --git a/fs/bio.c b/fs/bio.c
index 8754e7b6eb49..7065837ae9f3 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1003,7 +1003,7 @@ struct bio_map_data {
1003}; 1003};
1004 1004
1005static void bio_set_map_data(struct bio_map_data *bmd, struct bio *bio, 1005static void bio_set_map_data(struct bio_map_data *bmd, struct bio *bio,
1006 struct sg_iovec *iov, int iov_count, 1006 const struct sg_iovec *iov, int iov_count,
1007 int is_our_pages) 1007 int is_our_pages)
1008{ 1008{
1009 memcpy(bmd->sgvecs, iov, sizeof(struct sg_iovec) * iov_count); 1009 memcpy(bmd->sgvecs, iov, sizeof(struct sg_iovec) * iov_count);
@@ -1023,7 +1023,7 @@ static struct bio_map_data *bio_alloc_map_data(int nr_segs,
1023 sizeof(struct sg_iovec) * iov_count, gfp_mask); 1023 sizeof(struct sg_iovec) * iov_count, gfp_mask);
1024} 1024}
1025 1025
1026static int __bio_copy_iov(struct bio *bio, struct sg_iovec *iov, int iov_count, 1026static int __bio_copy_iov(struct bio *bio, const struct sg_iovec *iov, int iov_count,
1027 int to_user, int from_user, int do_free_page) 1027 int to_user, int from_user, int do_free_page)
1028{ 1028{
1029 int ret = 0, i; 1029 int ret = 0, i;
@@ -1121,7 +1121,7 @@ EXPORT_SYMBOL(bio_uncopy_user);
1121 */ 1121 */
1122struct bio *bio_copy_user_iov(struct request_queue *q, 1122struct bio *bio_copy_user_iov(struct request_queue *q,
1123 struct rq_map_data *map_data, 1123 struct rq_map_data *map_data,
1124 struct sg_iovec *iov, int iov_count, 1124 const struct sg_iovec *iov, int iov_count,
1125 int write_to_vm, gfp_t gfp_mask) 1125 int write_to_vm, gfp_t gfp_mask)
1126{ 1126{
1127 struct bio_map_data *bmd; 1127 struct bio_map_data *bmd;
@@ -1260,7 +1260,7 @@ EXPORT_SYMBOL(bio_copy_user);
1260 1260
1261static struct bio *__bio_map_user_iov(struct request_queue *q, 1261static struct bio *__bio_map_user_iov(struct request_queue *q,
1262 struct block_device *bdev, 1262 struct block_device *bdev,
1263 struct sg_iovec *iov, int iov_count, 1263 const struct sg_iovec *iov, int iov_count,
1264 int write_to_vm, gfp_t gfp_mask) 1264 int write_to_vm, gfp_t gfp_mask)
1265{ 1265{
1266 int i, j; 1266 int i, j;
@@ -1408,7 +1408,7 @@ EXPORT_SYMBOL(bio_map_user);
1408 * device. Returns an error pointer in case of error. 1408 * device. Returns an error pointer in case of error.
1409 */ 1409 */
1410struct bio *bio_map_user_iov(struct request_queue *q, struct block_device *bdev, 1410struct bio *bio_map_user_iov(struct request_queue *q, struct block_device *bdev,
1411 struct sg_iovec *iov, int iov_count, 1411 const struct sg_iovec *iov, int iov_count,
1412 int write_to_vm, gfp_t gfp_mask) 1412 int write_to_vm, gfp_t gfp_mask)
1413{ 1413{
1414 struct bio *bio; 1414 struct bio *bio;
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 5a4d39b4686b..21e27208316c 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -388,7 +388,7 @@ struct sg_iovec;
388struct rq_map_data; 388struct rq_map_data;
389extern struct bio *bio_map_user_iov(struct request_queue *, 389extern struct bio *bio_map_user_iov(struct request_queue *,
390 struct block_device *, 390 struct block_device *,
391 struct sg_iovec *, int, int, gfp_t); 391 const struct sg_iovec *, int, int, gfp_t);
392extern void bio_unmap_user(struct bio *); 392extern void bio_unmap_user(struct bio *);
393extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, 393extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
394 gfp_t); 394 gfp_t);
@@ -414,7 +414,8 @@ extern int bio_alloc_pages(struct bio *bio, gfp_t gfp);
414extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *, 414extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *,
415 unsigned long, unsigned int, int, gfp_t); 415 unsigned long, unsigned int, int, gfp_t);
416extern struct bio *bio_copy_user_iov(struct request_queue *, 416extern struct bio *bio_copy_user_iov(struct request_queue *,
417 struct rq_map_data *, struct sg_iovec *, 417 struct rq_map_data *,
418 const struct sg_iovec *,
418 int, int, gfp_t); 419 int, int, gfp_t);
419extern int bio_uncopy_user(struct bio *); 420extern int bio_uncopy_user(struct bio *);
420void zero_fill_bio(struct bio *bio); 421void zero_fill_bio(struct bio *bio);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 4afa4f8f6090..a639fd8a6d7b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -823,8 +823,8 @@ extern int blk_rq_map_user(struct request_queue *, struct request *,
823extern int blk_rq_unmap_user(struct bio *); 823extern int blk_rq_unmap_user(struct bio *);
824extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); 824extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t);
825extern int blk_rq_map_user_iov(struct request_queue *, struct request *, 825extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
826 struct rq_map_data *, struct sg_iovec *, int, 826 struct rq_map_data *, const struct sg_iovec *,
827 unsigned int, gfp_t); 827 int, unsigned int, gfp_t);
828extern int blk_execute_rq(struct request_queue *, struct gendisk *, 828extern int blk_execute_rq(struct request_queue *, struct gendisk *,
829 struct request *, int); 829 struct request *, int);
830extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, 830extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,