stripehead
64 lines
struct stripe_head {
struct stripe_head {
struct hlist_node hash;
struct hlist_node hash;
struct list_head lru; /* inactive_list or handle_list */
struct list_head lru; /* inactive_list or handle_list */
struct llist_node release_list;
struct llist_node release_list;
struct r5conf *raid_conf;
struct r5conf *raid_conf;
short generation; /* increments with every
short generation; /* increments with every
* reshape */
* reshape */
sector_t sector; /* sector of this row */
sector_t sector; /* sector of this row */
short pd_idx; /* parity disk index */
short pd_idx; /* parity disk index */
short qd_idx; /* 'Q' disk index for raid6 */
short qd_idx; /* 'Q' disk index for raid6 */
short ddf_layout;/* use DDF ordering to calculate Q */
short ddf_layout;/* use DDF ordering to calculate Q */
short hash_lock_index;
short hash_lock_index;
unsigned long state; /* state flags */
unsigned long state; /* state flags */
atomic_t count; /* nr of active thread/requests */
atomic_t count; /* nr of active thread/requests */
int bm_seq; /* sequence number for bitmap flushes */
int bm_seq; /* sequence number for bitmap flushes */
int disks; /* disks in stripe */
int disks; /* disks in stripe */
int overwrite_disks; /* total overwrite disks in stripe,
int overwrite_disks; /* total overwrite disks in stripe,
* this is only checked when stripe
* this is only checked when stripe
* has STRIPE_BATCH_READY
* has STRIPE_BATCH_READY
*/
*/
enum check_states check_state;
enum check_states check_state;
enum reconstruct_states reconstruct_state;
enum reconstruct_states reconstruct_state;
spinlock_t stripe_lock;
spinlock_t stripe_lock;
int cpu;
int cpu;
struct r5worker_group *group;
struct r5worker_group *group;
struct stripe_head *batch_head; /* protected by stripe lock */
struct stripe_head *batch_head; /* protected by stripe lock */
spinlock_t batch_lock; /* only header's lock is useful */
spinlock_t batch_lock; /* only header's lock is useful */
struct list_head batch_list; /* protected by head's batch lock*/
struct list_head batch_list; /* protected by head's batch lock*/
union {
union {
struct r5l_io_unit *log_io;
struct r5l_io_unit *log_io;
struct ppl_io_unit *ppl_io;
struct ppl_io_unit *ppl_io;
};
};
struct list_head log_list;
struct list_head log_list;
sector_t log_start; /* first meta block on the journal */
sector_t log_start; /* first meta block on the journal */
struct list_head r5c; /* for r5c_cache->stripe_in_journal */
struct list_head r5c; /* for r5c_cache->stripe_in_journal */
struct page *ppl_page; /* partial parity of this stripe */
struct page *ppl_page; /* partial parity of this stripe */
/**
/**
* struct stripe_operations
* struct stripe_operations
* @target - STRIPE_OP_COMPUTE_BLK target
* @target - STRIPE_OP_COMPUTE_BLK target
* @target2 - 2nd compute target in the raid6 case
* @target2 - 2nd compute target in the raid6 case
* @zero_sum_result - P and Q verification flags
* @zero_sum_result - P and Q verification flags
* @request - async service request flags for raid_run_ops
* @request - async service request flags for raid_run_ops
*/
*/
struct stripe_operations {
struct stripe_operations {
int target, target2;
int target, target2;
enum sum_check_flags zero_sum_result;
enum sum_check_flags zero_sum_result;
} ops;
} ops;
#if PAGE_SIZE != DEFAULT_STRIPE_SIZE
/* These pages will be used by bios in dev[i] */
struct page **pages;
int nr_pages; /* page array size */
int stripes_per_page;
#endif
struct r5dev {
struct r5dev {
/* rreq and rvec are used for the replacement device when
/* rreq and rvec are used for the replacement device when
* writing data to both devices.
* writing data to both devices.
*/
*/
struct bio req, rreq;
struct bio req, rreq;
struct bio_vec vec, rvec;
struct bio_vec vec, rvec;
struct page *page, *orig_page;
struct page *page, *orig_page;
unsigned int offset; /* offset of the page */
struct bio *toread, *read, *towrite, *written;
struct bio *toread, *read, *towrite, *written;
sector_t sector; /* sector of this page */
sector_t sector; /* sector of this page */
unsigned long flags;
unsigned long flags;
u32 log_checksum;
u32 log_checksum;
} dev[1]; /* allocated with extra space depending of RAID geometry */
unsigned short write_hint;
} dev[]; /* allocated depending of RAID geometry ("disks" member) */
};
};