Commit 86d564c8 authored by Al Viro's avatar Al Viro

constify blk_rq_map_user_iov() and friends

sg_iovec array passed to it can be const
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 480f40de
...@@ -188,7 +188,7 @@ EXPORT_SYMBOL(blk_rq_map_user); ...@@ -188,7 +188,7 @@ EXPORT_SYMBOL(blk_rq_map_user);
* unmapping. * unmapping.
*/ */
int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
struct rq_map_data *map_data, struct sg_iovec *iov, struct rq_map_data *map_data, const struct sg_iovec *iov,
int iov_count, unsigned int len, gfp_t gfp_mask) int iov_count, unsigned int len, gfp_t gfp_mask)
{ {
struct bio *bio; struct bio *bio;
......
...@@ -1003,7 +1003,7 @@ struct bio_map_data { ...@@ -1003,7 +1003,7 @@ struct bio_map_data {
}; };
static void bio_set_map_data(struct bio_map_data *bmd, struct bio *bio, static void bio_set_map_data(struct bio_map_data *bmd, struct bio *bio,
struct sg_iovec *iov, int iov_count, const struct sg_iovec *iov, int iov_count,
int is_our_pages) int is_our_pages)
{ {
memcpy(bmd->sgvecs, iov, sizeof(struct sg_iovec) * iov_count); 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,7 +1023,7 @@ static struct bio_map_data *bio_alloc_map_data(int nr_segs,
sizeof(struct sg_iovec) * iov_count, gfp_mask); sizeof(struct sg_iovec) * iov_count, gfp_mask);
} }
static int __bio_copy_iov(struct bio *bio, struct sg_iovec *iov, int iov_count, static int __bio_copy_iov(struct bio *bio, const struct sg_iovec *iov, int iov_count,
int to_user, int from_user, int do_free_page) int to_user, int from_user, int do_free_page)
{ {
int ret = 0, i; int ret = 0, i;
...@@ -1121,7 +1121,7 @@ EXPORT_SYMBOL(bio_uncopy_user); ...@@ -1121,7 +1121,7 @@ EXPORT_SYMBOL(bio_uncopy_user);
*/ */
struct bio *bio_copy_user_iov(struct request_queue *q, struct bio *bio_copy_user_iov(struct request_queue *q,
struct rq_map_data *map_data, struct rq_map_data *map_data,
struct sg_iovec *iov, int iov_count, const struct sg_iovec *iov, int iov_count,
int write_to_vm, gfp_t gfp_mask) int write_to_vm, gfp_t gfp_mask)
{ {
struct bio_map_data *bmd; struct bio_map_data *bmd;
...@@ -1260,7 +1260,7 @@ EXPORT_SYMBOL(bio_copy_user); ...@@ -1260,7 +1260,7 @@ EXPORT_SYMBOL(bio_copy_user);
static struct bio *__bio_map_user_iov(struct request_queue *q, static struct bio *__bio_map_user_iov(struct request_queue *q,
struct block_device *bdev, struct block_device *bdev,
struct sg_iovec *iov, int iov_count, const struct sg_iovec *iov, int iov_count,
int write_to_vm, gfp_t gfp_mask) int write_to_vm, gfp_t gfp_mask)
{ {
int i, j; int i, j;
...@@ -1408,7 +1408,7 @@ EXPORT_SYMBOL(bio_map_user); ...@@ -1408,7 +1408,7 @@ EXPORT_SYMBOL(bio_map_user);
* device. Returns an error pointer in case of error. * device. Returns an error pointer in case of error.
*/ */
struct bio *bio_map_user_iov(struct request_queue *q, struct block_device *bdev, struct bio *bio_map_user_iov(struct request_queue *q, struct block_device *bdev,
struct sg_iovec *iov, int iov_count, const struct sg_iovec *iov, int iov_count,
int write_to_vm, gfp_t gfp_mask) int write_to_vm, gfp_t gfp_mask)
{ {
struct bio *bio; struct bio *bio;
......
...@@ -388,7 +388,7 @@ struct sg_iovec; ...@@ -388,7 +388,7 @@ struct sg_iovec;
struct rq_map_data; struct rq_map_data;
extern struct bio *bio_map_user_iov(struct request_queue *, extern struct bio *bio_map_user_iov(struct request_queue *,
struct block_device *, struct block_device *,
struct sg_iovec *, int, int, gfp_t); const struct sg_iovec *, int, int, gfp_t);
extern void bio_unmap_user(struct bio *); extern void bio_unmap_user(struct bio *);
extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int,
gfp_t); gfp_t);
...@@ -414,7 +414,8 @@ extern int bio_alloc_pages(struct bio *bio, gfp_t gfp); ...@@ -414,7 +414,8 @@ extern int bio_alloc_pages(struct bio *bio, gfp_t gfp);
extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *, extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *,
unsigned long, unsigned int, int, gfp_t); unsigned long, unsigned int, int, gfp_t);
extern struct bio *bio_copy_user_iov(struct request_queue *, extern struct bio *bio_copy_user_iov(struct request_queue *,
struct rq_map_data *, struct sg_iovec *, struct rq_map_data *,
const struct sg_iovec *,
int, int, gfp_t); int, int, gfp_t);
extern int bio_uncopy_user(struct bio *); extern int bio_uncopy_user(struct bio *);
void zero_fill_bio(struct bio *bio); void zero_fill_bio(struct bio *bio);
......
...@@ -823,8 +823,8 @@ extern int blk_rq_map_user(struct request_queue *, struct request *, ...@@ -823,8 +823,8 @@ extern int blk_rq_map_user(struct request_queue *, struct request *,
extern int blk_rq_unmap_user(struct bio *); extern int blk_rq_unmap_user(struct bio *);
extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t);
extern int blk_rq_map_user_iov(struct request_queue *, struct request *, extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
struct rq_map_data *, struct sg_iovec *, int, struct rq_map_data *, const struct sg_iovec *,
unsigned int, gfp_t); int, unsigned int, gfp_t);
extern int blk_execute_rq(struct request_queue *, struct gendisk *, extern int blk_execute_rq(struct request_queue *, struct gendisk *,
struct request *, int); struct request *, int);
extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment