aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 13:38:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-25 13:38:18 -0400
commit8ded371f81fba8b38a049f8c5f30ce6438fc7b75 (patch)
tree0684d176cb6f35c92c4bf0185b1af9f5380077eb /block
parent096a705bbc080a4041636d07514560da8d78acbe (diff)
parent07d0c38e7d84f911c72058a124c7f17b3c779a65 (diff)
Merge branch 'for-3.1/drivers' of git://git.kernel.dk/linux-block
* 'for-3.1/drivers' of git://git.kernel.dk/linux-block: cciss: do not attempt to read from a write-only register xen/blkback: Add module alias for autoloading xen/blkback: Don't let in-flight requests defer pending ones. bsg: fix address space warning from sparse bsg: remove unnecessary conditional expressions bsg: fix bsg_poll() to return POLLOUT properly
Diffstat (limited to 'block')
-rw-r--r--block/bsg.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/block/bsg.c b/block/bsg.c
index 0c8b64a16484..702f1316bb8f 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -182,7 +182,7 @@ static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
182 return -ENOMEM; 182 return -ENOMEM;
183 } 183 }
184 184
185 if (copy_from_user(rq->cmd, (void *)(unsigned long)hdr->request, 185 if (copy_from_user(rq->cmd, (void __user *)(unsigned long)hdr->request,
186 hdr->request_len)) 186 hdr->request_len))
187 return -EFAULT; 187 return -EFAULT;
188 188
@@ -249,7 +249,7 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
249 struct request *rq, *next_rq = NULL; 249 struct request *rq, *next_rq = NULL;
250 int ret, rw; 250 int ret, rw;
251 unsigned int dxfer_len; 251 unsigned int dxfer_len;
252 void *dxferp = NULL; 252 void __user *dxferp = NULL;
253 struct bsg_class_device *bcd = &q->bsg_dev; 253 struct bsg_class_device *bcd = &q->bsg_dev;
254 254
255 /* if the LLD has been removed then the bsg_unregister_queue will 255 /* if the LLD has been removed then the bsg_unregister_queue will
@@ -291,7 +291,7 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
291 rq->next_rq = next_rq; 291 rq->next_rq = next_rq;
292 next_rq->cmd_type = rq->cmd_type; 292 next_rq->cmd_type = rq->cmd_type;
293 293
294 dxferp = (void*)(unsigned long)hdr->din_xferp; 294 dxferp = (void __user *)(unsigned long)hdr->din_xferp;
295 ret = blk_rq_map_user(q, next_rq, NULL, dxferp, 295 ret = blk_rq_map_user(q, next_rq, NULL, dxferp,
296 hdr->din_xfer_len, GFP_KERNEL); 296 hdr->din_xfer_len, GFP_KERNEL);
297 if (ret) 297 if (ret)
@@ -300,10 +300,10 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm,
300 300
301 if (hdr->dout_xfer_len) { 301 if (hdr->dout_xfer_len) {
302 dxfer_len = hdr->dout_xfer_len; 302 dxfer_len = hdr->dout_xfer_len;
303 dxferp = (void*)(unsigned long)hdr->dout_xferp; 303 dxferp = (void __user *)(unsigned long)hdr->dout_xferp;
304 } else if (hdr->din_xfer_len) { 304 } else if (hdr->din_xfer_len) {
305 dxfer_len = hdr->din_xfer_len; 305 dxfer_len = hdr->din_xfer_len;
306 dxferp = (void*)(unsigned long)hdr->din_xferp; 306 dxferp = (void __user *)(unsigned long)hdr->din_xferp;
307 } else 307 } else
308 dxfer_len = 0; 308 dxfer_len = 0;
309 309
@@ -445,7 +445,7 @@ static int blk_complete_sgv4_hdr_rq(struct request *rq, struct sg_io_v4 *hdr,
445 int len = min_t(unsigned int, hdr->max_response_len, 445 int len = min_t(unsigned int, hdr->max_response_len,
446 rq->sense_len); 446 rq->sense_len);
447 447
448 ret = copy_to_user((void*)(unsigned long)hdr->response, 448 ret = copy_to_user((void __user *)(unsigned long)hdr->response,
449 rq->sense, len); 449 rq->sense, len);
450 if (!ret) 450 if (!ret)
451 hdr->response_len = len; 451 hdr->response_len = len;
@@ -606,7 +606,7 @@ bsg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
606 ret = __bsg_read(buf, count, bd, NULL, &bytes_read); 606 ret = __bsg_read(buf, count, bd, NULL, &bytes_read);
607 *ppos = bytes_read; 607 *ppos = bytes_read;
608 608
609 if (!bytes_read || (bytes_read && err_block_err(ret))) 609 if (!bytes_read || err_block_err(ret))
610 bytes_read = ret; 610 bytes_read = ret;
611 611
612 return bytes_read; 612 return bytes_read;
@@ -686,7 +686,7 @@ bsg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
686 /* 686 /*
687 * return bytes written on non-fatal errors 687 * return bytes written on non-fatal errors
688 */ 688 */
689 if (!bytes_written || (bytes_written && err_block_err(ret))) 689 if (!bytes_written || err_block_err(ret))
690 bytes_written = ret; 690 bytes_written = ret;
691 691
692 dprintk("%s: returning %Zd\n", bd->name, bytes_written); 692 dprintk("%s: returning %Zd\n", bd->name, bytes_written);
@@ -878,7 +878,7 @@ static unsigned int bsg_poll(struct file *file, poll_table *wait)
878 spin_lock_irq(&bd->lock); 878 spin_lock_irq(&bd->lock);
879 if (!list_empty(&bd->done_list)) 879 if (!list_empty(&bd->done_list))
880 mask |= POLLIN | POLLRDNORM; 880 mask |= POLLIN | POLLRDNORM;
881 if (bd->queued_cmds >= bd->max_queue) 881 if (bd->queued_cmds < bd->max_queue)
882 mask |= POLLOUT; 882 mask |= POLLOUT;
883 spin_unlock_irq(&bd->lock); 883 spin_unlock_irq(&bd->lock);
884 884