summaryrefslogtreecommitdiffstats
path: root/drivers/md/linear.c
diff options
context:
space:
mode:
authorAndre Noll <maan@systemlinux.org>2009-08-03 10:59:47 +1000
committerNeilBrown <neilb@suse.de>2009-08-03 10:59:47 +1000
commitac5e7113e74872928844d00085bd47c988f12728 (patch)
treedabce6a99c2af9f00b33660f6b2d906cce836764 /drivers/md/linear.c
parent95fc17aac45300f45968aacd97a536ddd8db8101 (diff)
downloadlinux-ac5e7113e74872928844d00085bd47c988f12728.tar.bz2
md: Push down data integrity code to personalities.
This patch replaces md_integrity_check() by two new public functions: md_integrity_register() and md_integrity_add_rdev() which are both personality-independent. md_integrity_register() is called from the ->run and ->hot_remove methods of all personalities that support data integrity. The function iterates over the component devices of the array and determines if all active devices are integrity capable and if their profiles match. If this is the case, the common profile is registered for the mddev via blk_integrity_register(). The second new function, md_integrity_add_rdev() is called from the ->hot_add_disk methods, i.e. whenever a new device is being added to a raid array. If the new device does not support data integrity, or has a profile different from the one already registered, data integrity for the mddev is disabled. For raid0 and linear, only the call to md_integrity_register() from the ->run method is necessary. Signed-off-by: Andre Noll <maan@systemlinux.org> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/linear.c')
-rw-r--r--drivers/md/linear.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index 5810fa906af0..54c8677f1e59 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -220,6 +220,7 @@ static int linear_run (mddev_t *mddev)
mddev->queue->unplug_fn = linear_unplug;
mddev->queue->backing_dev_info.congested_fn = linear_congested;
mddev->queue->backing_dev_info.congested_data = mddev;
+ md_integrity_register(mddev);
return 0;
}