diff options
author | Jens Axboe <axboe@suse.de> | 2006-08-10 02:44:47 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:23:37 -0400 |
commit | 4aff5e2333c9a1609662f2091f55c3f6fffdad36 (patch) | |
tree | b73d8c2b7c1bdc03d3313c108da7dfc95ee95525 /drivers/block | |
parent | 77ed74da26f50fa28471571ee7a2251b77526d84 (diff) |
[PATCH] Split struct request ->flags into two parts
Right now ->flags is a bit of a mess: some are request types, and
others are just modifiers. Clean this up by splitting it into
->cmd_type and ->cmd_flags. This allows introduction of generic
Linux block message types, useful for sending generic Linux commands
to block devices.
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/floppy.c | 4 | ||||
-rw-r--r-- | drivers/block/nbd.c | 8 | ||||
-rw-r--r-- | drivers/block/paride/pd.c | 2 | ||||
-rw-r--r-- | drivers/block/pktcdvd.c | 6 | ||||
-rw-r--r-- | drivers/block/xd.c | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index ad1d7065a1b2..629c5769d994 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -2991,8 +2991,8 @@ static void do_fd_request(request_queue_t * q) | |||
2991 | if (usage_count == 0) { | 2991 | if (usage_count == 0) { |
2992 | printk("warning: usage count=0, current_req=%p exiting\n", | 2992 | printk("warning: usage count=0, current_req=%p exiting\n", |
2993 | current_req); | 2993 | current_req); |
2994 | printk("sect=%ld flags=%lx\n", (long)current_req->sector, | 2994 | printk("sect=%ld type=%x flags=%x\n", (long)current_req->sector, |
2995 | current_req->flags); | 2995 | current_req->cmd_type, current_req->cmd_flags); |
2996 | return; | 2996 | return; |
2997 | } | 2997 | } |
2998 | if (test_bit(0, &fdc_busy)) { | 2998 | if (test_bit(0, &fdc_busy)) { |
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index bdbade9a5cf5..9d1035e8d9d8 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -407,10 +407,10 @@ static void do_nbd_request(request_queue_t * q) | |||
407 | struct nbd_device *lo; | 407 | struct nbd_device *lo; |
408 | 408 | ||
409 | blkdev_dequeue_request(req); | 409 | blkdev_dequeue_request(req); |
410 | dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%lx)\n", | 410 | dprintk(DBG_BLKDEV, "%s: request %p: dequeued (flags=%x)\n", |
411 | req->rq_disk->disk_name, req, req->flags); | 411 | req->rq_disk->disk_name, req, req->cmd_type); |
412 | 412 | ||
413 | if (!(req->flags & REQ_CMD)) | 413 | if (!blk_fs_request(req)) |
414 | goto error_out; | 414 | goto error_out; |
415 | 415 | ||
416 | lo = req->rq_disk->private_data; | 416 | lo = req->rq_disk->private_data; |
@@ -489,7 +489,7 @@ static int nbd_ioctl(struct inode *inode, struct file *file, | |||
489 | switch (cmd) { | 489 | switch (cmd) { |
490 | case NBD_DISCONNECT: | 490 | case NBD_DISCONNECT: |
491 | printk(KERN_INFO "%s: NBD_DISCONNECT\n", lo->disk->disk_name); | 491 | printk(KERN_INFO "%s: NBD_DISCONNECT\n", lo->disk->disk_name); |
492 | sreq.flags = REQ_SPECIAL; | 492 | sreq.cmd_type = REQ_TYPE_SPECIAL; |
493 | nbd_cmd(&sreq) = NBD_CMD_DISC; | 493 | nbd_cmd(&sreq) = NBD_CMD_DISC; |
494 | /* | 494 | /* |
495 | * Set these to sane values in case server implementation | 495 | * Set these to sane values in case server implementation |
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index 2403721f9db1..12ff1a274d91 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -437,7 +437,7 @@ static char *pd_buf; /* buffer for request in progress */ | |||
437 | 437 | ||
438 | static enum action do_pd_io_start(void) | 438 | static enum action do_pd_io_start(void) |
439 | { | 439 | { |
440 | if (pd_req->flags & REQ_SPECIAL) { | 440 | if (blk_special_request(pd_req)) { |
441 | phase = pd_special; | 441 | phase = pd_special; |
442 | return pd_special(); | 442 | return pd_special(); |
443 | } | 443 | } |
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c index 451b996bba91..42891d2b054e 100644 --- a/drivers/block/pktcdvd.c +++ b/drivers/block/pktcdvd.c | |||
@@ -365,16 +365,16 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command * | |||
365 | rq->sense = sense; | 365 | rq->sense = sense; |
366 | memset(sense, 0, sizeof(sense)); | 366 | memset(sense, 0, sizeof(sense)); |
367 | rq->sense_len = 0; | 367 | rq->sense_len = 0; |
368 | rq->flags |= REQ_BLOCK_PC | REQ_HARDBARRIER; | 368 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
369 | rq->cmd_flags |= REQ_HARDBARRIER; | ||
369 | if (cgc->quiet) | 370 | if (cgc->quiet) |
370 | rq->flags |= REQ_QUIET; | 371 | rq->cmd_flags |= REQ_QUIET; |
371 | memcpy(rq->cmd, cgc->cmd, CDROM_PACKET_SIZE); | 372 | memcpy(rq->cmd, cgc->cmd, CDROM_PACKET_SIZE); |
372 | if (sizeof(rq->cmd) > CDROM_PACKET_SIZE) | 373 | if (sizeof(rq->cmd) > CDROM_PACKET_SIZE) |
373 | memset(rq->cmd + CDROM_PACKET_SIZE, 0, sizeof(rq->cmd) - CDROM_PACKET_SIZE); | 374 | memset(rq->cmd + CDROM_PACKET_SIZE, 0, sizeof(rq->cmd) - CDROM_PACKET_SIZE); |
374 | rq->cmd_len = COMMAND_SIZE(rq->cmd[0]); | 375 | rq->cmd_len = COMMAND_SIZE(rq->cmd[0]); |
375 | 376 | ||
376 | rq->ref_count++; | 377 | rq->ref_count++; |
377 | rq->flags |= REQ_NOMERGE; | ||
378 | rq->waiting = &wait; | 378 | rq->waiting = &wait; |
379 | rq->end_io = blk_end_sync_rq; | 379 | rq->end_io = blk_end_sync_rq; |
380 | elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 1); | 380 | elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 1); |
diff --git a/drivers/block/xd.c b/drivers/block/xd.c index e828e4cbd3e1..ebf3025721d1 100644 --- a/drivers/block/xd.c +++ b/drivers/block/xd.c | |||
@@ -313,7 +313,7 @@ static void do_xd_request (request_queue_t * q) | |||
313 | int res = 0; | 313 | int res = 0; |
314 | int retry; | 314 | int retry; |
315 | 315 | ||
316 | if (!(req->flags & REQ_CMD)) { | 316 | if (!blk_fs_request(req)) { |
317 | end_request(req, 0); | 317 | end_request(req, 0); |
318 | continue; | 318 | continue; |
319 | } | 319 | } |