• Stefan Behrens's avatar
    Btrfs: make the scrub page array dynamically allocated · 7a9e9987
    Stefan Behrens authored
    With the modified design (in order to support the devive replace
    procedure) it is necessary to alloc the page array dynamically.
    The reason is that pages are reused. At first a page is used for
    the bio to read the data from the filesystem, then the same page
    is reused for the bio that writes the data to the target disk.
    Since the read process and the write process are completely
    decoupled, this requires a new concept of refcounts and get/put
    functions for pages, and it requires to use newly created pages
    for each read bio which are freed after the write operation
    is finished.
    Signed-off-by: default avatarStefan Behrens <sbehrens@giantdisaster.de>
    Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
    7a9e9987
scrub.c 67.3 KB