2828#define FLB_FSTORE_LOCK 222
2929#define FLB_FSTORE_UNLOCK 333
3030
31+ #define FLB_FSTORE_MEM CIO_STORE_MEM
32+ #define FLB_FSTORE_FS CIO_STORE_FS
33+
3134struct flb_fstore_file {
3235 flb_sds_t name ; /* file name */
3336
@@ -40,25 +43,27 @@ struct flb_fstore_file {
4043};
4144
4245struct flb_fstore_stream {
43- struct cio_stream * stream ; /* Chunk I/O stream context */
46+ char * name ; /* reference to stream->name */
4447 flb_sds_t path ; /* stream filesystem path */
48+ struct cio_stream * stream ; /* Chunk I/O stream context */
4549 struct mk_list files ;
4650 struct mk_list _head ;
4751};
4852
4953struct flb_fstore {
54+ int store_type ;
5055 char * root_path ;
5156 struct cio_ctx * cio ; /* Chunk I/O context */
5257 struct mk_list streams ;
5358};
5459
55- struct flb_fstore * flb_fstore_create (char * path );
60+ struct flb_fstore * flb_fstore_create (char * path , int store_type );
5661
5762int flb_fstore_destroy (struct flb_fstore * fs );
5863
5964struct flb_fstore_stream * flb_fstore_stream_create (struct flb_fstore * fs ,
6065 char * stream_name );
61- void flb_fstore_stream_destroy (struct flb_fstore_stream * stream );
66+ void flb_fstore_stream_destroy (struct flb_fstore_stream * stream , int delete );
6267
6368int flb_fstore_file_meta_set (struct flb_fstore * fs ,
6469 struct flb_fstore_file * fsf ,
@@ -80,5 +85,6 @@ int flb_fstore_file_inactive(struct flb_fstore *fs,
8085 struct flb_fstore_file * fsf );
8186int flb_fstore_file_delete (struct flb_fstore * fs ,
8287 struct flb_fstore_file * fsf );
88+ void flb_fstore_dump (struct flb_fstore * fs );
8389
8490#endif
0 commit comments