diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2009-05-22 17:17:50 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-05-22 17:22:54 -0400 |
commit | ae03bf639a5027d27270123f5f6e3ee6a412781d (patch) | |
tree | d705f41a188ad656b1f47f7952626a9f992e3b8f /block/scsi_ioctl.c | |
parent | e1defc4ff0cf57aca6c5e3ff99fa503f5943c1f1 (diff) |
block: Use accessor functions for queue limits
Convert all external users of queue limits to using wrapper functions
instead of poking the request queue variables directly.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/scsi_ioctl.c')
-rw-r--r-- | block/scsi_ioctl.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index a9670dd4b5de..5f8e798ede4e 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c | |||
@@ -75,7 +75,7 @@ static int sg_set_timeout(struct request_queue *q, int __user *p) | |||
75 | 75 | ||
76 | static int sg_get_reserved_size(struct request_queue *q, int __user *p) | 76 | static int sg_get_reserved_size(struct request_queue *q, int __user *p) |
77 | { | 77 | { |
78 | unsigned val = min(q->sg_reserved_size, q->max_sectors << 9); | 78 | unsigned val = min(q->sg_reserved_size, queue_max_sectors(q) << 9); |
79 | 79 | ||
80 | return put_user(val, p); | 80 | return put_user(val, p); |
81 | } | 81 | } |
@@ -89,8 +89,8 @@ static int sg_set_reserved_size(struct request_queue *q, int __user *p) | |||
89 | 89 | ||
90 | if (size < 0) | 90 | if (size < 0) |
91 | return -EINVAL; | 91 | return -EINVAL; |
92 | if (size > (q->max_sectors << 9)) | 92 | if (size > (queue_max_sectors(q) << 9)) |
93 | size = q->max_sectors << 9; | 93 | size = queue_max_sectors(q) << 9; |
94 | 94 | ||
95 | q->sg_reserved_size = size; | 95 | q->sg_reserved_size = size; |
96 | return 0; | 96 | return 0; |
@@ -264,7 +264,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk, | |||
264 | if (hdr->cmd_len > BLK_MAX_CDB) | 264 | if (hdr->cmd_len > BLK_MAX_CDB) |
265 | return -EINVAL; | 265 | return -EINVAL; |
266 | 266 | ||
267 | if (hdr->dxfer_len > (q->max_hw_sectors << 9)) | 267 | if (hdr->dxfer_len > (queue_max_hw_sectors(q) << 9)) |
268 | return -EIO; | 268 | return -EIO; |
269 | 269 | ||
270 | if (hdr->dxfer_len) | 270 | if (hdr->dxfer_len) |