xref: /aosp_15_r20/external/erofs-utils/include/erofs/diskbuf.h (revision 33b1fccf6a0fada2c2875d400ed01119b7676ee5)
1*33b1fccfSAndroid Build Coastguard Worker /* SPDX-License-Identifier: GPL-2.0+ OR Apache-2.0 */
2*33b1fccfSAndroid Build Coastguard Worker #ifndef __EROFS_DISKBUF_H
3*33b1fccfSAndroid Build Coastguard Worker #define __EROFS_DISKBUF_H
4*33b1fccfSAndroid Build Coastguard Worker 
5*33b1fccfSAndroid Build Coastguard Worker #ifdef __cplusplus
6*33b1fccfSAndroid Build Coastguard Worker extern "C"
7*33b1fccfSAndroid Build Coastguard Worker {
8*33b1fccfSAndroid Build Coastguard Worker #endif
9*33b1fccfSAndroid Build Coastguard Worker 
10*33b1fccfSAndroid Build Coastguard Worker #include "erofs/defs.h"
11*33b1fccfSAndroid Build Coastguard Worker 
12*33b1fccfSAndroid Build Coastguard Worker struct erofs_diskbuf {
13*33b1fccfSAndroid Build Coastguard Worker 	void *sp;		/* internal stream pointer */
14*33b1fccfSAndroid Build Coastguard Worker 	u64 offset;		/* internal offset */
15*33b1fccfSAndroid Build Coastguard Worker };
16*33b1fccfSAndroid Build Coastguard Worker 
17*33b1fccfSAndroid Build Coastguard Worker int erofs_diskbuf_getfd(struct erofs_diskbuf *db, u64 *off);
18*33b1fccfSAndroid Build Coastguard Worker 
19*33b1fccfSAndroid Build Coastguard Worker int erofs_diskbuf_reserve(struct erofs_diskbuf *db, int sid, u64 *off);
20*33b1fccfSAndroid Build Coastguard Worker void erofs_diskbuf_commit(struct erofs_diskbuf *db, u64 len);
21*33b1fccfSAndroid Build Coastguard Worker void erofs_diskbuf_close(struct erofs_diskbuf *db);
22*33b1fccfSAndroid Build Coastguard Worker 
23*33b1fccfSAndroid Build Coastguard Worker int erofs_diskbuf_init(unsigned int nstrms);
24*33b1fccfSAndroid Build Coastguard Worker void erofs_diskbuf_exit(void);
25*33b1fccfSAndroid Build Coastguard Worker 
26*33b1fccfSAndroid Build Coastguard Worker #ifdef __cplusplus
27*33b1fccfSAndroid Build Coastguard Worker }
28*33b1fccfSAndroid Build Coastguard Worker #endif
29*33b1fccfSAndroid Build Coastguard Worker 
30*33b1fccfSAndroid Build Coastguard Worker #endif
31