Lines Matching defs:stripe

115  * the stripe hash table is used for locking, and to collect
116 * bios in hopes of making a full stripe
160 * use the page uptodate bit in the stripe cache array
200 * we hash on the first logical address of the stripe
289 * Stealing an rbio means taking all the uptodate pages from the stripe array
314 * all data stripe pages present and uptodate.
454 * insert an rbio into the stripe cache. It
524 * Returns true if the bio list inside this rbio covers an entire stripe (no
544 * the same stripe and if they are both going in the same
576 * We've need read the full stripe from the drive.
581 * change this stripe needs to do their own rmw.
611 /* Grab a sector inside P stripe */
618 /* Grab a sector inside Q stripe, return NULL if not RAID6 */
628 * The first stripe in the table for a logical address
631 * 1) Nobody has the stripe locked yet. The rbio is given
635 * 2) Someone has the stripe locked, but we're able to merge
639 * 3) Someone has the stripe locked, but we're not able to merge.
732 * rbios waiting for this stripe, the next one on the list will be started
768 * waiting for the chance to lock this stripe.
863 * @sector_nr: Sector number inside the stripe,
915 * Our current stripe len should be fixed to 64k thus stripe_nsectors
998 * Return the total number of errors found in the vertical stripe of @sector_nr.
1000 * @faila and @failb will also be updated to the first and second stripe
1053 struct btrfs_io_stripe *stripe;
1065 stripe = &rbio->bioc->stripes[stripe_nr];
1066 disk_start = stripe->physical + sector_nr * sectorsize;
1068 /* if the device is missing, just fail this stripe */
1069 if (!stripe->dev->bdev) {
1093 last->bi_bdev == stripe->dev->bdev) {
1102 bio = bio_alloc(stripe->dev->bdev,
1139 * searching through the bio list as we setup the IO in finish_rmw or stripe
1163 /* We rely on bio->bi_bdev to find the stripe number. */
1211 /* Generate PQ for one vertical stripe. */
1217 int stripe;
1220 /* First collect one sector from each data stripe */
1221 for (stripe = 0; stripe < rbio->nr_data; stripe++) {
1222 sector = sector_in_rbio(rbio, stripe, sectornr, 0);
1223 pointers[stripe] = kmap_local_page(sector->page) +
1227 /* Then add the parity stripe */
1230 pointers[stripe++] = kmap_local_page(sector->page) + sector->pgoff;
1239 pointers[stripe++] = kmap_local_page(sector->page) +
1250 for (stripe = stripe - 1; stripe >= 0; stripe--)
1251 kunmap_local(pointers[stripe]);
1257 /* The total sector number inside the full stripe. */
1260 int stripe;
1282 stripe = total_sector_nr / rbio->stripe_nsectors;
1285 /* This vertical stripe has no data, skip it. */
1289 if (stripe < rbio->nr_data) {
1290 sector = sector_in_rbio(rbio, stripe, sectornr, 1);
1294 sector = rbio_stripe_sector(rbio, stripe, sectornr);
1297 ret = rbio_add_io_sector(rbio, bio_list, sector, stripe,
1309 * Thus the source stripe number (in replace_stripe_src) should be valid.
1317 stripe = total_sector_nr / rbio->stripe_nsectors;
1322 * and replace_stripe_src[0] indicates the stripe number we
1325 if (stripe != rbio->bioc->replace_stripe_src) {
1327 * We can skip the whole stripe completely, note
1335 /* This vertical stripe has no data, skip it. */
1339 if (stripe < rbio->nr_data) {
1340 sector = sector_in_rbio(rbio, stripe, sectornr, 1);
1344 sector = rbio_stripe_sector(rbio, stripe, sectornr);
1376 * and mark the stripe error instead.
1488 /* No data csum for the whole stripe, no need to verify. */
1571 * Any time we get a partial stripe write while plugged
1616 /* We have a full stripe, queue it down. */
1699 * Either we don't have any existing plug, or we're doing a full stripe,
1741 * Recover a vertical stripe specified by @sector_nr.
1768 * No errors in the vertical stripe, skip it. Can happen for recovery
1769 * which only part of a stripe failed csum check.
1778 * Setup our array of pointers with sectors from each stripe
1805 * Just the P stripe has failed, without
1806 * a bad data or Q stripe.
1808 * recovery for this stripe.
1819 * If the q stripe is failed, do a pstripe reconstruction from
1821 * If both the q stripe and the P stripe are failed, we're
1830 * can skip this vertical stripe.
1834 * Otherwise we have one bad data stripe and
1835 * a good P stripe. raid5!
1850 /* Rebuild from P stripe here (raid5 or raid6). */
1870 * failed sectors repaired in the vertical stripe, thus they are now
1970 int stripe = total_sector_nr / rbio->stripe_nsectors;
1979 if (!rbio->bioc->stripes[stripe].dev->bdev ||
1989 sector = rbio_stripe_sector(rbio, stripe, sectornr);
1990 ret = rbio_add_io_sector(rbio, &bio_list, sector, stripe,
2037 /* This vertical stripe doesn't have errors. */
2048 /* Now select another stripe to mark as error. */
2059 /* We should found at least one vertical stripe with error.*/
2090 * for 'mirror_num > 2', select a stripe to fail on every retry.
2119 * stripe lock, if we trigger a metadata read, and it needs to do
2147 * longer safe for this particular sub-stripe write.
2150 "sub-stripe write for full stripe %llu is not safe, failed to get csum: %d",
2180 int stripe = total_sector_nr / rbio->stripe_nsectors;
2183 sector = rbio_stripe_sector(rbio, stripe, sectornr);
2185 stripe, sectornr, REQ_OP_READ);
2261 * needed for both full-stripe and sub-stripe writes.
2268 * Either full stripe write, or we have every data sector already
2273 * Now we're doing sub-stripe write, also need all data stripes
2289 * bio list any more, anyone else that wants to change this stripe
2353 * The following code is used to scrub/replace the parity stripe
2385 * stripe.
2434 int stripe;
2453 * Replace is running and our P/Q stripe is being replaced, then we
2475 /* RAID6, allocate and map temp space for the Q stripe */
2489 /* Map the parity stripe just once */
2496 /* first collect one page from each data stripe */
2497 for (stripe = 0; stripe < nr_data; stripe++) {
2498 sector = sector_in_rbio(rbio, stripe, sectornr, 0);
2499 pointers[stripe] = kmap_local_page(sector->page) +
2524 for (stripe = nr_data - 1; stripe >= 0; stripe--)
2525 kunmap_local(pointers[stripe]);
2556 * Replace is running and our parity stripe needs to be duplicated to
2557 * the target device. Check we have a valid source stripe number.
2580 static inline int is_data_stripe(struct btrfs_raid_bio *rbio, int stripe)
2582 if (stripe >= 0 && stripe < rbio->nr_data)
2651 * Here means we got one corrupted data stripe and one
2654 * data, or we can not repair the data stripe.
2681 int stripe = total_sector_nr / rbio->stripe_nsectors;
2684 /* No data in the vertical stripe, no need to read. */
2691 * in the bio list we don't need to read it off the stripe.
2693 sector = sector_in_rbio(rbio, stripe, sectornr, 1);
2697 sector = rbio_stripe_sector(rbio, stripe, sectornr);
2705 ret = rbio_add_io_sector(rbio, &bio_list, sector, stripe,
2796 /* data_logical must be at stripe boundary and inside the full stripe. */