^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) ============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) struct request documentation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) ============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) Jens Axboe <jens.axboe@oracle.com> 27/05/02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) .. FIXME:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) No idea about what does mean - seems just some noise, so comment it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 1.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) Index
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) 2.0 Struct request members classification
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 2.1 struct request members explanation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 3.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) Short explanation of request members
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) ====================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) Classification flags:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) = ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) D driver member
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) B block layer member
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) I I/O scheduler member
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) = ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) Unless an entry contains a D classification, a device driver must not access
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) this member. Some members may contain D classifications, but should only be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) access through certain macros or functions (eg ->flags).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) <linux/blkdev.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) =============================== ======= =======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) Member Flag Comment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) =============================== ======= =======================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) struct list_head queuelist BI Organization on various internal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) queues
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) ``void *elevator_private`` I I/O scheduler private data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) unsigned char cmd[16] D Driver can use this for setting up
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) a cdb before execution, see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) blk_queue_prep_rq
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) unsigned long flags DBI Contains info about data direction,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) request type, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) int rq_status D Request status bits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) kdev_t rq_dev DBI Target device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) int errors DB Error counts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) sector_t sector DBI Target location
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) unsigned long hard_nr_sectors B Used to keep sector sane
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) unsigned long nr_sectors DBI Total number of sectors in request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) unsigned long hard_nr_sectors B Used to keep nr_sectors sane
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) unsigned short nr_phys_segments DB Number of physical scatter gather
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) segments in a request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) unsigned short nr_hw_segments DB Number of hardware scatter gather
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) segments in a request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) unsigned int current_nr_sectors DB Number of sectors in first segment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) of request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) unsigned int hard_cur_sectors B Used to keep current_nr_sectors sane
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) int tag DB TCQ tag, if assigned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) ``void *special`` D Free to be used by driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) ``char *buffer`` D Map of first segment, also see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) section on bouncing SECTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) ``struct completion *waiting`` D Can be used by driver to get signalled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) on request completion
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) ``struct bio *bio`` DBI First bio in request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) ``struct bio *biotail`` DBI Last bio in request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) ``struct request_queue *q`` DB Request queue this request belongs to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) ``struct request_list *rl`` B Request list this request came from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) =============================== ======= =======================================