]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/journal-remote/journal-remote-write.h
tree-wide: make use of getpid_cached() wherever we can
[thirdparty/systemd.git] / src / journal-remote / journal-remote-write.h
CommitLineData
0ef6f454
LP
1#pragma once
2
fdfccdbc
ZJS
3/***
4 This file is part of systemd.
5
6 Copyright 2014 Zbigniew Jędrzejewski-Szmek
7
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
12
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
fdfccdbc 22#include "journal-file.h"
b18453ed 23#include "journal-importer.h"
fdfccdbc 24
9ff48d09
ZJS
25typedef struct RemoteServer RemoteServer;
26
fdfccdbc
ZJS
27typedef struct Writer {
28 JournalFile *journal;
29 JournalMetrics metrics;
9ff48d09 30
fdfccdbc 31 MMapCache *mmap;
9ff48d09
ZJS
32 RemoteServer *server;
33 char *hashmap_key;
34
fdfccdbc 35 uint64_t seqnum;
9ff48d09
ZJS
36
37 int n_ref;
fdfccdbc
ZJS
38} Writer;
39
9ff48d09
ZJS
40Writer* writer_new(RemoteServer* server);
41Writer* writer_free(Writer *w);
42
43Writer* writer_ref(Writer *w);
44Writer* writer_unref(Writer *w);
45
46DEFINE_TRIVIAL_CLEANUP_FUNC(Writer*, writer_unref);
47#define _cleanup_writer_unref_ _cleanup_(writer_unrefp)
48
fdfccdbc
ZJS
49int writer_write(Writer *s,
50 struct iovec_wrapper *iovw,
51 dual_timestamp *ts,
52 bool compress,
53 bool seal);
8201af08
ZJS
54
55typedef enum JournalWriteSplitMode {
56 JOURNAL_WRITE_SPLIT_NONE,
57 JOURNAL_WRITE_SPLIT_HOST,
58 _JOURNAL_WRITE_SPLIT_MAX,
59 _JOURNAL_WRITE_SPLIT_INVALID = -1
60} JournalWriteSplitMode;