1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 21da177e4SLinus Torvalds #ifndef __COW_H__ 31da177e4SLinus Torvalds #define __COW_H__ 41da177e4SLinus Torvalds 51da177e4SLinus Torvalds #include <asm/types.h> 61da177e4SLinus Torvalds 71da177e4SLinus Torvalds extern int init_cow_file(int fd, char *cow_file, char *backing_file, 81da177e4SLinus Torvalds int sectorsize, int alignment, int *bitmap_offset_out, 91da177e4SLinus Torvalds unsigned long *bitmap_len_out, int *data_offset_out); 101da177e4SLinus Torvalds 111da177e4SLinus Torvalds extern int file_reader(__u64 offset, char *buf, int len, void *arg); 121da177e4SLinus Torvalds extern int read_cow_header(int (*reader)(__u64, char *, int, void *), 131da177e4SLinus Torvalds void *arg, __u32 *version_out, 141da177e4SLinus Torvalds char **backing_file_out, time_t *mtime_out, 1552c73782SPaolo 'Blaisorblade' Giarrusso unsigned long long *size_out, int *sectorsize_out, 161da177e4SLinus Torvalds __u32 *align_out, int *bitmap_offset_out); 171da177e4SLinus Torvalds 181da177e4SLinus Torvalds extern int write_cow_header(char *cow_file, int fd, char *backing_file, 191da177e4SLinus Torvalds int sectorsize, int alignment, 201da177e4SLinus Torvalds unsigned long long *size); 211da177e4SLinus Torvalds 221da177e4SLinus Torvalds extern void cow_sizes(int version, __u64 size, int sectorsize, int align, 231da177e4SLinus Torvalds int bitmap_offset, unsigned long *bitmap_len_out, 241da177e4SLinus Torvalds int *data_offset_out); 251da177e4SLinus Torvalds 261da177e4SLinus Torvalds #endif 271da177e4SLinus Torvalds 281da177e4SLinus Torvalds /* 291da177e4SLinus Torvalds * --------------------------------------------------------------------------- 301da177e4SLinus Torvalds * Local variables: 311da177e4SLinus Torvalds * c-file-style: "linux" 321da177e4SLinus Torvalds * End: 331da177e4SLinus Torvalds */ 34