• David Sterba's avatar
    btrfs: rework BTRFS_I as macro to preserve parameter const · 070969f1
    David Sterba authored
    Currently BTRFS_I is a static inline function that takes a const inode
    and returns btrfs inode, dropping the 'const' qualifier. This can break
    assumptions of compiler though it seems there's no real case.
    
    To make the parameter and return type consistent regardint const we can
    use the container_of_const() that preserves it. However this would not
    check the parameter type. To fix that use the same _Generic construct
    but implement only the two expected types.
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    070969f1
btrfs_inode.h 21.7 KB