xref: /aosp_15_r20/external/erofs-utils/include/erofs/fragments.h (revision 33b1fccf6a0fada2c2875d400ed01119b7676ee5)
1*33b1fccfSAndroid Build Coastguard Worker /* SPDX-License-Identifier: GPL-2.0+ OR Apache-2.0 */
2*33b1fccfSAndroid Build Coastguard Worker /*
3*33b1fccfSAndroid Build Coastguard Worker  * Copyright (C), 2022, Coolpad Group Limited.
4*33b1fccfSAndroid Build Coastguard Worker  */
5*33b1fccfSAndroid Build Coastguard Worker #ifndef __EROFS_FRAGMENTS_H
6*33b1fccfSAndroid Build Coastguard Worker #define __EROFS_FRAGMENTS_H
7*33b1fccfSAndroid Build Coastguard Worker 
8*33b1fccfSAndroid Build Coastguard Worker #ifdef __cplusplus
9*33b1fccfSAndroid Build Coastguard Worker extern "C"
10*33b1fccfSAndroid Build Coastguard Worker {
11*33b1fccfSAndroid Build Coastguard Worker #endif
12*33b1fccfSAndroid Build Coastguard Worker 
13*33b1fccfSAndroid Build Coastguard Worker #include "erofs/internal.h"
14*33b1fccfSAndroid Build Coastguard Worker 
15*33b1fccfSAndroid Build Coastguard Worker extern const char *erofs_frags_packedname;
16*33b1fccfSAndroid Build Coastguard Worker #define EROFS_PACKED_INODE	erofs_frags_packedname
17*33b1fccfSAndroid Build Coastguard Worker 
18*33b1fccfSAndroid Build Coastguard Worker FILE *erofs_packedfile_init(void);
19*33b1fccfSAndroid Build Coastguard Worker void erofs_packedfile_exit(void);
20*33b1fccfSAndroid Build Coastguard Worker int erofs_flush_packed_inode(struct erofs_sb_info *sbi);
21*33b1fccfSAndroid Build Coastguard Worker 
22*33b1fccfSAndroid Build Coastguard Worker int z_erofs_fragments_dedupe(struct erofs_inode *inode, int fd, u32 *tofcrc);
23*33b1fccfSAndroid Build Coastguard Worker int z_erofs_pack_file_from_fd(struct erofs_inode *inode, int fd, u32 tofcrc);
24*33b1fccfSAndroid Build Coastguard Worker int z_erofs_pack_fragments(struct erofs_inode *inode, void *data,
25*33b1fccfSAndroid Build Coastguard Worker 			   unsigned int len, u32 tofcrc);
26*33b1fccfSAndroid Build Coastguard Worker void z_erofs_fragments_commit(struct erofs_inode *inode);
27*33b1fccfSAndroid Build Coastguard Worker int z_erofs_fragments_init(void);
28*33b1fccfSAndroid Build Coastguard Worker void z_erofs_fragments_exit(void);
29*33b1fccfSAndroid Build Coastguard Worker 
30*33b1fccfSAndroid Build Coastguard Worker #ifdef __cplusplus
31*33b1fccfSAndroid Build Coastguard Worker }
32*33b1fccfSAndroid Build Coastguard Worker #endif
33*33b1fccfSAndroid Build Coastguard Worker 
34*33b1fccfSAndroid Build Coastguard Worker #endif
35