]> git.karo-electronics.de Git - linux-beck.git/commit
Btrfs: remove the block device pointer from the scrub context struct
authorStefan Behrens <sbehrens@giantdisaster.de>
Fri, 2 Nov 2012 12:26:57 +0000 (13:26 +0100)
committerJosef Bacik <jbacik@fusionio.com>
Wed, 12 Dec 2012 22:15:30 +0000 (17:15 -0500)
commita36cf8b8933e4a7a7f2f2cbc3c70b097e97f7fd1
treed4948095c8c777d669503048213e3fe3bfdf62b5
parentd9d181c1ba7aa09a6d2698e8c7e75b515524d504
Btrfs: remove the block device pointer from the scrub context struct

The block device is removed from the scrub context state structure.
The scrub code as it is used for the device replace procedure reads
the source data from whereever it is optimal. The source device might
even be gone (disconnected, for instance due to a hardware failure).
Or the drive can be so faulty so that the device replace procedure
tries to avoid access to the faulty source drive as much as possible,
and only if all other mirrors are damaged, as a last resort, the
source disk is accessed.
The modified scrub code operates as if it would handle the source
drive and thereby generates an exact copy of the source disk on the
target disk, even if the source disk is not present at all. Therefore
the block device pointer to the source disk is removed in the scrub
context struct and moved into the lower level scope of scrub_bio,
fixup and page structures where the block device context is known.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/scrub.c