diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2018-05-10 08:38:15 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2018-05-15 17:57:05 -0700 |
commit | 67482129cdabf7cede1301d2415ef4f0156d35cd (patch) | |
tree | 074b330967f8c3f8964cd6152ca0d948b6e727a4 /include/linux | |
parent | d6b636ebb1c9f412687a7b6ed97c996247cc2380 (diff) |
iomap: add a swapfile activation function
Add a new iomap_swapfile_activate function so that filesystems can
activate swap files without having to use the obsolete and slow bmap
function. This enables XFS to support fallocate'd swap files and
swap files on realtime devices.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/iomap.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 19a07de28212..4bd87294219a 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -106,4 +106,15 @@ typedef int (iomap_dio_end_io_t)(struct kiocb *iocb, ssize_t ret, ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, const struct iomap_ops *ops, iomap_dio_end_io_t end_io); +#ifdef CONFIG_SWAP +struct file; +struct swap_info_struct; + +int iomap_swapfile_activate(struct swap_info_struct *sis, + struct file *swap_file, sector_t *pagespan, + const struct iomap_ops *ops); +#else +# define iomap_swapfile_activate(sis, swapfile, pagespan, ops) (-EIO) +#endif /* CONFIG_SWAP */ + #endif /* LINUX_IOMAP_H */ |