• I
    btrfs: convert kmap to kmap_local_page, simple cases · 58c1a35c
    Ira Weiny 提交于
    Use a simple coccinelle script to help convert the most common
    kmap()/kunmap() patterns to kmap_local_page()/kunmap_local().
    
    Note that some kmaps which were caught by this script needed to be
    handled by hand because of the strict unmapping order of kunmap_local()
    so they are not included in this patch.  But this script got us started.
    
    There's another temp variable added for the final length write to the
    first page so it does not interfere with cpage_out that is used for
    mapping other pages.
    
    The development of this patch was aided by the follow script:
    
    // <smpl>
    // SPDX-License-Identifier: GPL-2.0-only
    // Find kmap and replace with kmap_local_page then mark kunmap
    //
    // Confidence: Low
    // Copyright: (C) 2021 Intel Corporation
    // URL: http://coccinelle.lip6.fr/
    
    @ catch_all @
    expression e, e2;
    @@
    
    (
    -kmap(e)
    +kmap_local_page(e)
    )
    ...
    (
    -kunmap(...)
    +kunmap_local()
    )
    
    // </smpl>
    Signed-off-by: NIra Weiny <ira.weiny@intel.com>
    Reviewed-by: NDavid Sterba <dsterba@suse.com>
    Signed-off-by: NDavid Sterba <dsterba@suse.com>
    58c1a35c
compression.c 44.6 KB