.complete_fn = blk_integrity_nop_complete,
};
+void blk_integrity_init(struct gendisk *disk)
+{
+ if (disk->queue->integrity.profile->verify_fn ||
+ disk->queue->integrity.profile->generate_fn)
+ blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, disk->queue);
+
+#ifdef CONFIG_BLK_INLINE_ENCRYPTION
+ if (disk->queue->crypto_profile) {
+ pr_warn("blk-integrity: Integrity and hardware inline encryption are not supported together. Disabling hardware inline encryption.\n");
+ disk->queue->crypto_profile = NULL;
+ }
+#endif
+}
+
/**
* blk_integrity_register - Register a gendisk as being integrity-capable
* @disk: struct gendisk pointer to make integrity-aware
bi->profile = template->profile ? template->profile : &nop_profile;
bi->tuple_size = template->tuple_size;
bi->tag_size = template->tag_size;
-
- if (bi->profile->verify_fn || bi->profile->generate_fn)
- blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, disk->queue);
-
-#ifdef CONFIG_BLK_INLINE_ENCRYPTION
- if (disk->queue->crypto_profile) {
- pr_warn("blk-integrity: Integrity and hardware inline encryption are not supported together. Disabling hardware inline encryption.\n");
- disk->queue->crypto_profile = NULL;
- }
-#endif
+ blk_integrity_init(disk);
}
EXPORT_SYMBOL(blk_integrity_register);