Linux核心数据结构--request

被用来向系统的块设备发送请求。它总是向buffer cache读出或写入数据块。

struct request {

    volatile int rq_status;   

#define RQ_INACTIVE            (-1)

#define RQ_ACTIVE              1

#define RQ_SCSI_BUSY           0xffff

#define RQ_SCSI_DONE           0xfffe

#define RQ_SCSI_DISCONNECTING  0xffe0



    kdev_t rq_dev;

    int cmd;
       /* READ or WRITE */

    int errors;

    unsigned long sector;

    unsigned long nr_sectors;

    unsigned long current_nr_sectors;

    char * buffer;

    struct semaphore * sem;

    struct buffer_head * bh;

    struct buffer_head * bhtail;

    struct request * next;

};

你可能感兴趣的:(数据结构,linux,cache)