trace_info->stripe_nr = -1;
}
+static inline void bio_list_put(struct bio_list *bio_list)
+{
+ struct bio *bio;
+
+ while ((bio = bio_list_pop(bio_list)))
+ bio_put(bio);
+}
+
/* Generate PQ for one vertical stripe. */
static void generate_pq_vertical(struct btrfs_raid_bio *rbio, int sectornr)
{
static int rmw_assemble_write_bios(struct btrfs_raid_bio *rbio,
struct bio_list *bio_list)
{
- struct bio *bio;
/* The total sector number inside the full stripe. */
int total_sector_nr;
int sectornr;
return 0;
error:
- while ((bio = bio_list_pop(bio_list)))
- bio_put(bio);
+ bio_list_put(bio_list);
return -EIO;
}
static int rmw_assemble_read_bios(struct btrfs_raid_bio *rbio,
struct bio_list *bio_list)
{
- struct bio *bio;
int total_sector_nr;
int ret = 0;
return 0;
cleanup:
- while ((bio = bio_list_pop(bio_list)))
- bio_put(bio);
+ bio_list_put(bio_list);
return ret;
}
static int recover_assemble_read_bios(struct btrfs_raid_bio *rbio,
struct bio_list *bio_list)
{
- struct bio *bio;
int total_sector_nr;
int ret = 0;
}
return 0;
error:
- while ((bio = bio_list_pop(bio_list)))
- bio_put(bio);
-
+ bio_list_put(bio_list);
return -EIO;
}
static int recover_rbio(struct btrfs_raid_bio *rbio)
{
struct bio_list bio_list;
- struct bio *bio;
int ret;
/*
ret = recover_sectors(rbio);
out:
- while ((bio = bio_list_pop(&bio_list)))
- bio_put(bio);
-
+ bio_list_put(&bio_list);
return ret;
}
static int rmw_read_wait_recover(struct btrfs_raid_bio *rbio)
{
struct bio_list bio_list;
- struct bio *bio;
int ret;
bio_list_init(&bio_list);
ret = recover_sectors(rbio);
return ret;
out:
- while ((bio = bio_list_pop(&bio_list)))
- bio_put(bio);
-
+ bio_list_put(&bio_list);
return ret;
}
struct sector_ptr p_sector = { 0 };
struct sector_ptr q_sector = { 0 };
struct bio_list bio_list;
- struct bio *bio;
int is_replace = 0;
int ret;
return 0;
cleanup:
- while ((bio = bio_list_pop(&bio_list)))
- bio_put(bio);
+ bio_list_put(&bio_list);
return ret;
}
static int scrub_assemble_read_bios(struct btrfs_raid_bio *rbio,
struct bio_list *bio_list)
{
- struct bio *bio;
int total_sector_nr;
int ret = 0;
}
return 0;
error:
- while ((bio = bio_list_pop(bio_list)))
- bio_put(bio);
+ bio_list_put(bio_list);
return ret;
}
struct bio_list bio_list;
int sector_nr;
int ret;
- struct bio *bio;
bio_list_init(&bio_list);
return ret;
cleanup:
- while ((bio = bio_list_pop(&bio_list)))
- bio_put(bio);
-
+ bio_list_put(&bio_list);
return ret;
}