xref: /kernel/linux/linux-5.10/arch/um/drivers/cow.h (revision 8c2ecf20)
18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __COW_H__
38c2ecf20Sopenharmony_ci#define __COW_H__
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <asm/types.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ciextern int init_cow_file(int fd, char *cow_file, char *backing_file,
88c2ecf20Sopenharmony_ci			 int sectorsize, int alignment, int *bitmap_offset_out,
98c2ecf20Sopenharmony_ci			 unsigned long *bitmap_len_out, int *data_offset_out);
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciextern int file_reader(__u64 offset, char *buf, int len, void *arg);
128c2ecf20Sopenharmony_ciextern int read_cow_header(int (*reader)(__u64, char *, int, void *),
138c2ecf20Sopenharmony_ci			   void *arg, __u32 *version_out,
148c2ecf20Sopenharmony_ci			   char **backing_file_out, long long *mtime_out,
158c2ecf20Sopenharmony_ci			   unsigned long long *size_out, int *sectorsize_out,
168c2ecf20Sopenharmony_ci			   __u32 *align_out, int *bitmap_offset_out);
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciextern int write_cow_header(char *cow_file, int fd, char *backing_file,
198c2ecf20Sopenharmony_ci			    int sectorsize, int alignment,
208c2ecf20Sopenharmony_ci			    unsigned long long *size);
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciextern void cow_sizes(int version, __u64 size, int sectorsize, int align,
238c2ecf20Sopenharmony_ci		      int bitmap_offset, unsigned long *bitmap_len_out,
248c2ecf20Sopenharmony_ci		      int *data_offset_out);
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#endif
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci/*
298c2ecf20Sopenharmony_ci * ---------------------------------------------------------------------------
308c2ecf20Sopenharmony_ci * Local variables:
318c2ecf20Sopenharmony_ci * c-file-style: "linux"
328c2ecf20Sopenharmony_ci * End:
338c2ecf20Sopenharmony_ci */
34