bio中储存私有数据

来源:互联网 发布:夜神模拟器mac版问题 编辑:程序博客网 时间:2024/06/06 14:00

bio.bi_private是不能储存私有数据的,内核中会频繁使用这个成员。

找了好久也就只找到bio.bi_rw:

/* * bio bi_rw flags * * bit 0 -- data direction *If not set, bio is a read from device. If set, it's a write to device. * bit 1 -- fail fast device errors * bit 2 -- fail fast transport errors * bit 3 -- fail fast driver errors * bit 4 -- rw-ahead when set * bit 5 -- barrier *Insert a serialization point in the IO queue, forcing previously *submitted IO to be completed before this one is issued. * bit 6 -- synchronous I/O hint. * bit 7 -- Unplug the device immediately after submitting this bio. * bit 8 -- metadata request *Used for tracing to differentiate metadata and data IO. May also *get some preferential treatment in the IO scheduler * bit 9 -- discard sectors *Informs the lower level device that this range of sectors is no longer *used by the file system and may thus be freed by the device. Used *for flash based storage. *Don't want driver retries for any fast fail whatever the reason. * bit 10 -- Tell the IO scheduler not to wait for more requests after thisone has been submitted, even if it is a SYNC request. */enum bio_rw_flags {BIO_RW,BIO_RW_FAILFAST_DEV,BIO_RW_FAILFAST_TRANSPORT,BIO_RW_FAILFAST_DRIVER,/* above flags must match REQ_* */BIO_RW_AHEAD,BIO_RW_BARRIER,BIO_RW_SYNCIO,BIO_RW_UNPLUG,BIO_RW_META,BIO_RW_DISCARD,BIO_RW_NOIDLE,};

struct bio {sector_tbi_sector;/* device address in 512 byte   sectors */struct bio*bi_next;/* request queue link */struct block_device*bi_bdev;unsigned longbi_flags;/* status, command, etc */unsigned longbi_rw;/* bottom bits READ/WRITE, * top bits priority */unsigned shortbi_vcnt;/* how many bio_vec's */unsigned shortbi_idx;/* current index into bvl_vec *//* Number of segments in this BIO after * physical address coalescing is performed. */unsigned intbi_phys_segments;unsigned intbi_size;/* residual I/O count *//* * To keep track of the max segment size, we account for the * sizes of the first and last mergeable segments in this bio. */unsigned intbi_seg_front_size;unsigned intbi_seg_back_size;unsigned intbi_max_vecs;/* max bvl_vecs we can hold */unsigned intbi_comp_cpu;/* completion CPU */atomic_tbi_cnt;/* pin count */struct bio_vec*bi_io_vec;/* the actual vec list */bio_end_io_t*bi_end_io;void*bi_private;#if defined(CONFIG_BLK_DEV_INTEGRITY)struct bio_integrity_payload *bi_integrity;  /* data integrity */#endifbio_destructor_t*bi_destructor;/* destructor *//* * We can inline a number of vecs at the end of the bio, to avoid * double allocations for a small number of bio_vecs. This member * MUST obviously be kept at the very end of the bio. */struct bio_vecbi_inline_vecs[0];};


0 0
原创粉丝点击