• Kari Argillander's avatar
    fs/ntfs3: Do not use driver own alloc wrappers · 195c52bd
    Kari Argillander authored
    Problem with these wrapper is that we cannot take off example GFP_NOFS
    flag. It is not recomended use those in all places. Also if we change
    one driver specific wrapper to kernel wrapper then it would look really
    weird. People should be most familiar with kernel wrappers so let's just
    use those ones.
    
    Driver specific alloc wrapper also confuse some static analyzing tools,
    good example is example kernels checkpatch tool. After we converter
    these to kernel specific then warnings is showed.
    
    Following Coccinelle script was used to automate changing.
    
    virtual patch
    
    @alloc depends on patch@
    expression x;
    expression y;
    @@
    (
    -	ntfs_malloc(x)
    +	kmalloc(x, GFP_NOFS)
    |
    -	ntfs_zalloc(x)
    +	kzalloc(x, GFP_NOFS)
    |
    -	ntfs_vmalloc(x)
    +	kvmalloc(x, GFP_NOFS)
    |
    -	ntfs_free(x)
    +	kfree(x)
    |
    -	ntfs_vfree(x)
    +	kvfree(x)
    |
    -	ntfs_memdup(x, y)
    +	kmemdup(x, y, GFP_NOFS)
    )
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarKari Argillander <kari.argillander@gmail.com>
    Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
    195c52bd
attrlist.c 9.17 KB