]>
Commit | Line | Data |
---|---|---|
db9ecf05 | 1 | /* SPDX-License-Identifier: LGPL-2.1-or-later */ |
0ef6f454 LP |
2 | #pragma once |
3 | ||
1e094703 | 4 | #include "journal-file.h" |
fdfccdbc | 5 | |
9ff48d09 ZJS |
6 | typedef struct RemoteServer RemoteServer; |
7 | ||
fdfccdbc | 8 | typedef struct Writer { |
45c0ecba | 9 | JournalFile *journal; |
fdfccdbc | 10 | JournalMetrics metrics; |
f12b399d | 11 | char *output; /* directory where we write, for vacuuming */ |
9ff48d09 | 12 | |
fdfccdbc | 13 | MMapCache *mmap; |
9ff48d09 ZJS |
14 | RemoteServer *server; |
15 | char *hashmap_key; | |
16 | ||
fdfccdbc | 17 | uint64_t seqnum; |
9ff48d09 | 18 | |
cf4b2f99 | 19 | unsigned n_ref; |
fdfccdbc ZJS |
20 | } Writer; |
21 | ||
4c3d2523 | 22 | int writer_new(RemoteServer *server, Writer **ret); |
9ff48d09 ZJS |
23 | Writer* writer_ref(Writer *w); |
24 | Writer* writer_unref(Writer *w); | |
25 | ||
26 | DEFINE_TRIVIAL_CLEANUP_FUNC(Writer*, writer_unref); | |
9ff48d09 | 27 | |
fdfccdbc | 28 | int writer_write(Writer *s, |
a35420d8 LP |
29 | const struct iovec_wrapper *iovw, |
30 | const dual_timestamp *ts, | |
31 | const sd_id128_t *boot_id, | |
49615dbd | 32 | JournalFileFlags file_flags); |
8201af08 ZJS |
33 | |
34 | typedef enum JournalWriteSplitMode { | |
35 | JOURNAL_WRITE_SPLIT_NONE, | |
36 | JOURNAL_WRITE_SPLIT_HOST, | |
37 | _JOURNAL_WRITE_SPLIT_MAX, | |
2d93c20e | 38 | _JOURNAL_WRITE_SPLIT_INVALID = -EINVAL, |
8201af08 | 39 | } JournalWriteSplitMode; |