• Josef Bacik's avatar
    btrfs: add a i_mmap_lock to our inode · 8318ba79
    Josef Bacik authored
    We need to be able to exclude page_mkwrite from happening concurrently
    with certain operations.  To facilitate this, add a i_mmap_lock to our
    inode, down_read() it in our mkwrite, and add a new ILOCK flag to
    indicate that we want to take the i_mmap_lock as well.  I used pahole to
    check the size of the btrfs_inode, the sizes are as follows
    
    no lockdep:
    before: 1120 (3 per 4k page)
    after: 1160 (3 per 4k page)
    
    lockdep:
    before: 2072 (1 per 4k page)
    after: 2224 (1 per 4k page)
    
    We're slightly larger but it doesn't change how many objects we can fit
    per page.
    Reviewed-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    8318ba79
btrfs_inode.h 10.3 KB