aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorStefan Behrens <sbehrens@giantdisaster.de>2011-11-09 07:44:05 -0500
committerStefan Behrens <sbehrens@giantdisaster.de>2011-12-21 13:14:17 -0500
commit21adbd5cbb5344a3fca6bb7ddb2ab6cb03c44546 (patch)
tree208c3ab6ad8bb35937b21c4d54e45e46d99557ff /fs/btrfs/volumes.c
parentf11e4d7f533249ddfa110116200c5c3a509f9218 (diff)
Btrfs: integrate integrity check module into btrfs
This is the last part of the patch series. It modifies the btrfs code to use the integrity check module if configured to do so with the define BTRFS_FS_CHECK_INTEGRITY. If this define is not set, the only effective change is that code is added that handles the mount option to activate the integrity check. If the mount option is set and the define BTRFS_FS_CHECK_INTEGRITY is not set, that code complains in the log and the mount fails with EINVAL. Add the mount option to activate the usage of the integrity check code. Add invocation of btrfs integrity check code init and cleanup function on mount and umount, respectively. Add hook to call btrfs integrity check code version of submit_bh/submit_bio. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index f4b839fd3c9d..821334f6e3a1 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -32,6 +32,7 @@
32#include "print-tree.h" 32#include "print-tree.h"
33#include "volumes.h" 33#include "volumes.h"
34#include "async-thread.h" 34#include "async-thread.h"
35#include "check-integrity.h"
35 36
36static int init_first_rw_device(struct btrfs_trans_handle *trans, 37static int init_first_rw_device(struct btrfs_trans_handle *trans,
37 struct btrfs_root *root, 38 struct btrfs_root *root,
@@ -246,7 +247,7 @@ loop_lock:
246 sync_pending = 0; 247 sync_pending = 0;
247 } 248 }
248 249
249 submit_bio(cur->bi_rw, cur); 250 btrfsic_submit_bio(cur->bi_rw, cur);
250 num_run++; 251 num_run++;
251 batch_run++; 252 batch_run++;
252 if (need_resched()) 253 if (need_resched())
@@ -3304,7 +3305,7 @@ static noinline int schedule_bio(struct btrfs_root *root,
3304 /* don't bother with additional async steps for reads, right now */ 3305 /* don't bother with additional async steps for reads, right now */
3305 if (!(rw & REQ_WRITE)) { 3306 if (!(rw & REQ_WRITE)) {
3306 bio_get(bio); 3307 bio_get(bio);
3307 submit_bio(rw, bio); 3308 btrfsic_submit_bio(rw, bio);
3308 bio_put(bio); 3309 bio_put(bio);
3309 return 0; 3310 return 0;
3310 } 3311 }
@@ -3399,7 +3400,7 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio,
3399 if (async_submit) 3400 if (async_submit)
3400 schedule_bio(root, dev, rw, bio); 3401 schedule_bio(root, dev, rw, bio);
3401 else 3402 else
3402 submit_bio(rw, bio); 3403 btrfsic_submit_bio(rw, bio);
3403 } else { 3404 } else {
3404 bio->bi_bdev = root->fs_info->fs_devices->latest_bdev; 3405 bio->bi_bdev = root->fs_info->fs_devices->latest_bdev;
3405 bio->bi_sector = logical >> 9; 3406 bio->bi_sector = logical >> 9;