aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
Diffstat (limited to 'block')
-rw-r--r--block/bsg.c7
-rw-r--r--block/cmd-filter.c2
-rw-r--r--block/scsi_ioctl.c5
3 files changed, 8 insertions, 6 deletions
diff --git a/block/bsg.c b/block/bsg.c
index 034112bfe1f3..2d36b127f384 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -173,7 +173,7 @@ unlock:
173 173
174static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq, 174static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
175 struct sg_io_v4 *hdr, struct bsg_device *bd, 175 struct sg_io_v4 *hdr, struct bsg_device *bd,
176 int has_write_perm) 176 fmode_t has_write_perm)
177{ 177{
178 if (hdr->request_len > BLK_MAX_CDB) { 178 if (hdr->request_len > BLK_MAX_CDB) {
179 rq->cmd = kzalloc(hdr->request_len, GFP_KERNEL); 179 rq->cmd = kzalloc(hdr->request_len, GFP_KERNEL);
@@ -242,7 +242,7 @@ bsg_validate_sgv4_hdr(struct request_queue *q, struct sg_io_v4 *hdr, int *rw)
242 * map sg_io_v4 to a request. 242 * map sg_io_v4 to a request.
243 */ 243 */
244static struct request * 244static struct request *
245bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, int has_write_perm) 245bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm)
246{ 246{
247 struct request_queue *q = bd->queue; 247 struct request_queue *q = bd->queue;
248 struct request *rq, *next_rq = NULL; 248 struct request *rq, *next_rq = NULL;
@@ -601,7 +601,8 @@ bsg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
601} 601}
602 602
603static int __bsg_write(struct bsg_device *bd, const char __user *buf, 603static int __bsg_write(struct bsg_device *bd, const char __user *buf,
604 size_t count, ssize_t *bytes_written, int has_write_perm) 604 size_t count, ssize_t *bytes_written,
605 fmode_t has_write_perm)
605{ 606{
606 struct bsg_command *bc; 607 struct bsg_command *bc;
607 struct request *rq; 608 struct request *rq;
diff --git a/block/cmd-filter.c b/block/cmd-filter.c
index e669aed4c6bc..504b275e1b90 100644
--- a/block/cmd-filter.c
+++ b/block/cmd-filter.c
@@ -27,7 +27,7 @@
27#include <linux/cdrom.h> 27#include <linux/cdrom.h>
28 28
29int blk_verify_command(struct blk_cmd_filter *filter, 29int blk_verify_command(struct blk_cmd_filter *filter,
30 unsigned char *cmd, int has_write_perm) 30 unsigned char *cmd, fmode_t has_write_perm)
31{ 31{
32 /* root can do any command. */ 32 /* root can do any command. */
33 if (capable(CAP_SYS_RAWIO)) 33 if (capable(CAP_SYS_RAWIO))
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index c34272a348fe..c525905f9d35 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -384,7 +384,8 @@ int sg_scsi_ioctl(struct file *file, struct request_queue *q,
384 struct gendisk *disk, struct scsi_ioctl_command __user *sic) 384 struct gendisk *disk, struct scsi_ioctl_command __user *sic)
385{ 385{
386 struct request *rq; 386 struct request *rq;
387 int err, write_perm = 0; 387 int err;
388 fmode_t write_perm = 0;
388 unsigned int in_len, out_len, bytes, opcode, cmdlen; 389 unsigned int in_len, out_len, bytes, opcode, cmdlen;
389 char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE]; 390 char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE];
390 391
@@ -428,7 +429,7 @@ int sg_scsi_ioctl(struct file *file, struct request_queue *q,
428 429
429 /* scsi_ioctl passes NULL */ 430 /* scsi_ioctl passes NULL */
430 if (file && (file->f_mode & FMODE_WRITE)) 431 if (file && (file->f_mode & FMODE_WRITE))
431 write_perm = 1; 432 write_perm = FMODE_WRITE;
432 433
433 err = blk_verify_command(&q->cmd_filter, rq->cmd, write_perm); 434 err = blk_verify_command(&q->cmd_filter, rq->cmd, write_perm);
434 if (err) 435 if (err)