diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-11-25 17:58:50 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-11-25 18:07:05 -0800 |
commit | 8ec1588722809a35a7d149bff10de56424e2658a (patch) | |
tree | dac9aca6321b92f84505293227c5151193dd8ee6 /src/journals.h | |
parent | 7b15a68d12e2df7f45c4311d0281ff9a78693e81 (diff) |
src: initial commit of jio WIP source
This is a very quick and dirty experimental hack written in some
sort of bastard continuation-passing style in C w/io_uring using
journal-file introspection and manipulation duty as an excuse for
its existence.
Consider this unfinished prototype quality code.
Diffstat (limited to 'src/journals.h')
-rw-r--r-- | src/journals.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/journals.h b/src/journals.h new file mode 100644 index 0000000..1cbe660 --- /dev/null +++ b/src/journals.h @@ -0,0 +1,41 @@ +#ifndef _JIO_JOURNALS_H +#define _JIO_JOURNALS_H + +#include <stdint.h> + +/* open() includes since journals_open() reuses open() flags */ +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + + +#include "thunk.h" + +#include "upstream/journal-def.h" + +typedef struct iou_t iou_t; + +typedef struct journal_t { + char *name; + int fd; +} journal_t; + +typedef struct journals_t journals_t; + +THUNK_DECLARE(journals_open, iou_t *, iou, char **, machid, int, flags, journals_t **, journals, thunk_t *, closure); +THUNK_DECLARE(journal_get_header, iou_t *, iou, journal_t **, journal, Header *, header, thunk_t *, closure); + +THUNK_DECLARE(journal_iter_next_object, iou_t *, iou, journal_t **, journal, Header *, header, uint64_t *, iter_offset, ObjectHeader *, iter_object_header, thunk_t *, closure); +THUNK_DECLARE(journal_for_each, iou_t *, iou, journal_t **, journal, Header *, header, uint64_t *, iter_offset, ObjectHeader *, iter_object_header, thunk_t *, closure); + +THUNK_DECLARE(journal_get_hash_table, iou_t *, iou, journal_t **, journal, uint64_t *, hash_table_offset, uint64_t *, hash_table_size, HashItem **, res_hash_table, thunk_t *, closure); +THUNK_DECLARE(journal_hash_table_iter_next_object, iou_t *, iou, journal_t **, journal, HashItem **, hash_table, uint64_t *, hash_table_size, uint64_t *, iter_bucket, uint64_t *, iter_offset, HashedObjectHeader *, iter_object_header, size_t, iter_object_size, thunk_t *, closure); +THUNK_DECLARE(journal_hash_table_for_each, iou_t *, iou, journal_t **, journal, HashItem **, hash_table, uint64_t *, hash_table_size, uint64_t *, iter_bucket, uint64_t *, iter_offset, HashedObjectHeader *, iter_object_header, size_t, iter_object_size, thunk_t *, closure); + +THUNK_DECLARE(journal_get_object_header, iou_t *, iou, journal_t **, journal, uint64_t *, offset, ObjectHeader *, object_header, thunk_t *, closure); +THUNK_DECLARE(journals_for_each, journals_t **, journals, journal_t **, journal_iter, thunk_t *, closure); + +const char * journal_object_type_str(ObjectType type); +const char * journal_state_str(JournalState state); + +#endif |