You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[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>
This commit is contained in:
@@ -365,16 +365,16 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command *
|
||||
rq->sense = sense;
|
||||
memset(sense, 0, sizeof(sense));
|
||||
rq->sense_len = 0;
|
||||
rq->flags |= REQ_BLOCK_PC | REQ_HARDBARRIER;
|
||||
rq->cmd_type = REQ_TYPE_BLOCK_PC;
|
||||
rq->cmd_flags |= REQ_HARDBARRIER;
|
||||
if (cgc->quiet)
|
||||
rq->flags |= REQ_QUIET;
|
||||
rq->cmd_flags |= REQ_QUIET;
|
||||
memcpy(rq->cmd, cgc->cmd, CDROM_PACKET_SIZE);
|
||||
if (sizeof(rq->cmd) > CDROM_PACKET_SIZE)
|
||||
memset(rq->cmd + CDROM_PACKET_SIZE, 0, sizeof(rq->cmd) - CDROM_PACKET_SIZE);
|
||||
rq->cmd_len = COMMAND_SIZE(rq->cmd[0]);
|
||||
|
||||
rq->ref_count++;
|
||||
rq->flags |= REQ_NOMERGE;
|
||||
rq->waiting = &wait;
|
||||
rq->end_io = blk_end_sync_rq;
|
||||
elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 1);
|
||||
|
||||
Reference in New Issue
Block a user