• O
    Btrfs: support swap files · ed46ff3d
    Omar Sandoval 提交于
    Btrfs has not allowed swap files since commit 35054394 ("Btrfs: stop
    providing a bmap operation to avoid swapfile corruptions"). However, now
    that the proper restrictions are in place, Btrfs can support swap files
    through the swap file a_ops, similar to iomap in commit 67482129
    ("iomap: add a swapfile activation function").
    
    For Btrfs, activation needs to make sure that the file can be used as a
    swap file, which currently means that it must be fully allocated as
    NOCOW with no compression on one device. It must also do the proper
    tracking so that ioctls will not interfere with the swap file.
    Deactivation clears this tracking.
    Signed-off-by: NOmar Sandoval <osandov@fb.com>
    Reviewed-by: NDavid Sterba <dsterba@suse.com>
    Signed-off-by: NDavid Sterba <dsterba@suse.com>
    ed46ff3d
inode.c 292.7 KB