mirror of
https://github.com/fail0verflow/switch-linux.git
synced 2025-05-04 02:34:21 -04:00
Fix up comments about matching flags between bio and rq
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
parent
36144077bc
commit
d628eaef31
3 changed files with 5 additions and 8 deletions
|
@ -624,10 +624,6 @@ blk_alloc_request(struct request_queue *q, int rw, int priv, gfp_t gfp_mask)
|
||||||
|
|
||||||
blk_rq_init(q, rq);
|
blk_rq_init(q, rq);
|
||||||
|
|
||||||
/*
|
|
||||||
* first three bits are identical in rq->cmd_flags and bio->bi_rw,
|
|
||||||
* see bio.h and blkdev.h
|
|
||||||
*/
|
|
||||||
rq->cmd_flags = rw | REQ_ALLOCED;
|
rq->cmd_flags = rw | REQ_ALLOCED;
|
||||||
|
|
||||||
if (priv) {
|
if (priv) {
|
||||||
|
@ -2012,7 +2008,8 @@ EXPORT_SYMBOL_GPL(blk_end_request_callback);
|
||||||
void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
|
void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
|
||||||
struct bio *bio)
|
struct bio *bio)
|
||||||
{
|
{
|
||||||
/* first two bits are identical in rq->cmd_flags and bio->bi_rw */
|
/* Bit 0 (R/W) is identical in rq->cmd_flags and bio->bi_rw, and
|
||||||
|
we want BIO_RW_AHEAD (bit 1) to imply REQ_FAILFAST (bit 1). */
|
||||||
rq->cmd_flags |= (bio->bi_rw & 3);
|
rq->cmd_flags |= (bio->bi_rw & 3);
|
||||||
|
|
||||||
rq->nr_phys_segments = bio_phys_segments(q, bio);
|
rq->nr_phys_segments = bio_phys_segments(q, bio);
|
||||||
|
|
|
@ -150,8 +150,8 @@ struct bio {
|
||||||
* bit 3 -- fail fast, don't want low level driver retries
|
* bit 3 -- fail fast, don't want low level driver retries
|
||||||
* bit 4 -- synchronous I/O hint: the block layer will unplug immediately
|
* bit 4 -- synchronous I/O hint: the block layer will unplug immediately
|
||||||
*/
|
*/
|
||||||
#define BIO_RW 0
|
#define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */
|
||||||
#define BIO_RW_AHEAD 1
|
#define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */
|
||||||
#define BIO_RW_BARRIER 2
|
#define BIO_RW_BARRIER 2
|
||||||
#define BIO_RW_FAILFAST 3
|
#define BIO_RW_FAILFAST 3
|
||||||
#define BIO_RW_SYNC 4
|
#define BIO_RW_SYNC 4
|
||||||
|
|
|
@ -84,7 +84,7 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* request type modified bits. first three bits match BIO_RW* bits, important
|
* request type modified bits. first two bits match BIO_RW* bits, important
|
||||||
*/
|
*/
|
||||||
enum rq_flag_bits {
|
enum rq_flag_bits {
|
||||||
__REQ_RW, /* not set, read. set, write */
|
__REQ_RW, /* not set, read. set, write */
|
||||||
|
|
Loading…
Add table
Reference in a new issue