Skip to content

Commit

Permalink
add a struct request pointer to the request structure
Browse files Browse the repository at this point in the history
This adds a struct request pointer to the request structure for the
second data phase (bidi for now). A request queue supporting bidi
requests sets QUEUE_FLAG_BIDI. This prevents sending bidi requests to
a non-bidi queue.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
FUJITA Tomonori authored and Jens Axboe committed Jul 16, 2007
1 parent efba1a3 commit abae1fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions block/ll_rw_blk.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ static void rq_init(request_queue_t *q, struct request *rq)
rq->end_io = NULL;
rq->end_io_data = NULL;
rq->completion_data = NULL;
rq->next_rq = NULL;
}

/**
Expand Down
5 changes: 5 additions & 0 deletions include/linux/blkdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ struct request {
*/
rq_end_io_fn *end_io;
void *end_io_data;

/* for bidi */
struct request *next_rq;
};

/*
Expand Down Expand Up @@ -486,6 +489,7 @@ struct request_queue
#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */
#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */
#define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */

enum {
/*
Expand Down Expand Up @@ -550,6 +554,7 @@ enum {
#define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED)
#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER)
#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA)
#define blk_bidi_rq(rq) ((rq)->next_rq != NULL)

#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)

Expand Down

0 comments on commit abae1fd

Please sign in to comment.