pr_debug("md: data integrity enabled on %s\n", mdname(mddev));
if (bioset_integrity_create(&mddev->bio_set, BIO_POOL_SIZE) ||
- bioset_integrity_create(&mddev->io_acct_set, BIO_POOL_SIZE)) {
+ (mddev->level != 1 && mddev->level != 10 &&
+ bioset_integrity_create(&mddev->io_acct_set, BIO_POOL_SIZE))) {
pr_err("md: failed to create integrity pool for %s\n",
mdname(mddev));
return -EINVAL;
bioset_exit(&mddev->bio_set);
bioset_exit(&mddev->sync_set);
- bioset_exit(&mddev->io_acct_set);
+ if (mddev->level != 1 && mddev->level != 10)
+ bioset_exit(&mddev->io_acct_set);
kfree(mddev);
}
if (err)
goto exit_bio_set;
}
- if (!bioset_initialized(&mddev->io_acct_set)) {
+ if (mddev->level != 1 && mddev->level != 10 &&
+ !bioset_initialized(&mddev->io_acct_set)) {
err = bioset_init(&mddev->io_acct_set, BIO_POOL_SIZE,
offsetof(struct md_io_acct, bio_clone), 0);
if (err)
module_put(pers->owner);
md_bitmap_destroy(mddev);
abort:
- bioset_exit(&mddev->io_acct_set);
+ if (mddev->level != 1 && mddev->level != 10)
+ bioset_exit(&mddev->io_acct_set);
exit_sync_set:
bioset_exit(&mddev->sync_set);
exit_bio_set:
__md_stop(mddev);
bioset_exit(&mddev->bio_set);
bioset_exit(&mddev->sync_set);
- bioset_exit(&mddev->io_acct_set);
+ if (mddev->level != 1 && mddev->level != 10)
+ bioset_exit(&mddev->io_acct_set);
}
EXPORT_SYMBOL_GPL(md_stop);
bio_endio(orig_bio);
}
-/* used by personalities (raid0 and raid5) to account io stats */
+/*
+ * Used by personalities that don't already clone the bio and thus can't
+ * easily add the timestamp to their extended bio structure.
+ */
void md_account_bio(struct mddev *mddev, struct bio **bio)
{
struct md_io_acct *md_io_acct;