Lines Matching refs:stripe
116 * the stripe hash table is used for locking, and to collect
117 * bios in hopes of making a full stripe
161 * use the page uptodate bit in the stripe cache array
201 * we hash on the first logical address of the stripe
290 * Stealing an rbio means taking all the uptodate pages from the stripe array
315 * all data stripe pages present and uptodate.
455 * insert an rbio into the stripe cache. It
525 * Returns true if the bio list inside this rbio covers an entire stripe (no
545 * the same stripe and if they are both going in the same
577 * We've need read the full stripe from the drive.
582 * change this stripe needs to do their own rmw.
612 /* Grab a sector inside P stripe */
619 /* Grab a sector inside Q stripe, return NULL if not RAID6 */
629 * The first stripe in the table for a logical address
632 * 1) Nobody has the stripe locked yet. The rbio is given
636 * 2) Someone has the stripe locked, but we're able to merge
640 * 3) Someone has the stripe locked, but we're not able to merge.
733 * rbios waiting for this stripe, the next one on the list will be started
769 * waiting for the chance to lock this stripe.
864 * @sector_nr: Sector number inside the stripe,
916 * Our current stripe len should be fixed to 64k thus stripe_nsectors
991 * Return the total number of errors found in the vertical stripe of @sector_nr.
993 * @faila and @failb will also be updated to the first and second stripe
1046 struct btrfs_io_stripe *stripe;
1058 stripe = &rbio->bioc->stripes[stripe_nr];
1059 disk_start = stripe->physical + sector_nr * sectorsize;
1061 /* if the device is missing, just fail this stripe */
1062 if (!stripe->dev->bdev) {
1086 last->bi_bdev == stripe->dev->bdev) {
1095 bio = bio_alloc(stripe->dev->bdev,
1132 * searching through the bio list as we setup the IO in finish_rmw or stripe
1156 /* We rely on bio->bi_bdev to find the stripe number. */
1184 /* Generate PQ for one vertical stripe. */
1190 int stripe;
1193 /* First collect one sector from each data stripe */
1194 for (stripe = 0; stripe < rbio->nr_data; stripe++) {
1195 sector = sector_in_rbio(rbio, stripe, sectornr, 0);
1196 pointers[stripe] = kmap_local_page(sector->page) +
1200 /* Then add the parity stripe */
1203 pointers[stripe++] = kmap_local_page(sector->page) + sector->pgoff;
1212 pointers[stripe++] = kmap_local_page(sector->page) +
1222 for (stripe = stripe - 1; stripe >= 0; stripe--)
1223 kunmap_local(pointers[stripe]);
1229 /* The total sector number inside the full stripe. */
1232 int stripe;
1254 stripe = total_sector_nr / rbio->stripe_nsectors;
1257 /* This vertical stripe has no data, skip it. */
1261 if (stripe < rbio->nr_data) {
1262 sector = sector_in_rbio(rbio, stripe, sectornr, 1);
1266 sector = rbio_stripe_sector(rbio, stripe, sectornr);
1269 ret = rbio_add_io_sector(rbio, bio_list, sector, stripe,
1281 * Thus the source stripe number (in replace_stripe_src) should be valid.
1289 stripe = total_sector_nr / rbio->stripe_nsectors;
1294 * and replace_stripe_src[0] indicates the stripe number we
1297 if (stripe != rbio->bioc->replace_stripe_src) {
1299 * We can skip the whole stripe completely, note
1307 /* This vertical stripe has no data, skip it. */
1311 if (stripe < rbio->nr_data) {
1312 sector = sector_in_rbio(rbio, stripe, sectornr, 1);
1316 sector = rbio_stripe_sector(rbio, stripe, sectornr);
1348 * and mark the stripe error instead.
1460 /* No data csum for the whole stripe, no need to verify. */
1543 * Any time we get a partial stripe write while plugged
1589 /* We have a full stripe, queue it down. */
1672 * Either we don't have any existing plug, or we're doing a full stripe,
1714 * Recover a vertical stripe specified by @sector_nr.
1741 * No errors in the vertical stripe, skip it. Can happen for recovery
1742 * which only part of a stripe failed csum check.
1751 * Setup our array of pointers with sectors from each stripe
1778 * Just the P stripe has failed, without
1779 * a bad data or Q stripe.
1781 * recovery for this stripe.
1792 * If the q stripe is failed, do a pstripe reconstruction from
1794 * If both the q stripe and the P stripe are failed, we're
1803 * can skip this vertical stripe.
1807 * Otherwise we have one bad data stripe and
1808 * a good P stripe. raid5!
1823 /* Rebuild from P stripe here (raid5 or raid6). */
1843 * failed sectors repaired in the vertical stripe, thus they are now
1943 int stripe = total_sector_nr / rbio->stripe_nsectors;
1952 if (!rbio->bioc->stripes[stripe].dev->bdev ||
1962 sector = rbio_stripe_sector(rbio, stripe, sectornr);
1963 ret = rbio_add_io_sector(rbio, &bio_list, sector, stripe,
2010 /* This vertical stripe doesn't have errors. */
2021 /* Now select another stripe to mark as error. */
2032 /* We should found at least one vertical stripe with error.*/
2063 * for 'mirror_num > 2', select a stripe to fail on every retry.
2092 * stripe lock, if we trigger a metadata read, and it needs to do
2120 * longer safe for this particular sub-stripe write.
2123 "sub-stripe write for full stripe %llu is not safe, failed to get csum: %d",
2153 int stripe = total_sector_nr / rbio->stripe_nsectors;
2156 sector = rbio_stripe_sector(rbio, stripe, sectornr);
2158 stripe, sectornr, REQ_OP_READ);
2234 * needed for both full-stripe and sub-stripe writes.
2241 * Either full stripe write, or we have every data sector already
2246 * Now we're doing sub-stripe write, also need all data stripes
2262 * bio list any more, anyone else that wants to change this stripe
2326 * The following code is used to scrub/replace the parity stripe
2358 * stripe.
2407 int stripe;
2426 * Replace is running and our P/Q stripe is being replaced, then we
2448 /* RAID6, allocate and map temp space for the Q stripe */
2462 /* Map the parity stripe just once */
2469 /* first collect one page from each data stripe */
2470 for (stripe = 0; stripe < nr_data; stripe++) {
2471 sector = sector_in_rbio(rbio, stripe, sectornr, 0);
2472 pointers[stripe] = kmap_local_page(sector->page) +
2496 for (stripe = nr_data - 1; stripe >= 0; stripe--)
2497 kunmap_local(pointers[stripe]);
2528 * Replace is running and our parity stripe needs to be duplicated to
2529 * the target device. Check we have a valid source stripe number.
2552 static inline int is_data_stripe(struct btrfs_raid_bio *rbio, int stripe)
2554 if (stripe >= 0 && stripe < rbio->nr_data)
2623 * Here means we got one corrupted data stripe and one
2626 * data, or we can not repair the data stripe.
2653 int stripe = total_sector_nr / rbio->stripe_nsectors;
2656 /* No data in the vertical stripe, no need to read. */
2663 * in the bio list we don't need to read it off the stripe.
2665 sector = sector_in_rbio(rbio, stripe, sectornr, 1);
2669 sector = rbio_stripe_sector(rbio, stripe, sectornr);
2677 ret = rbio_add_io_sector(rbio, &bio_list, sector, stripe,
2768 /* data_logical must be at stripe boundary and inside the full stripe. */