summaryrefslogtreecommitdiff
path: root/src/journal-remote/journal-remote-write.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-02 00:15:37 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-15 22:34:41 -0400
commit9ff48d0982fcb97923955685fe9fa4e0e67cb238 (patch)
treeb26c25523cf45bfd1659565d2d902c24e8168724 /src/journal-remote/journal-remote-write.h
parenta83f403760cb63b1bf7787e9ff325ffb6d891d39 (diff)
journal-remote: rework fd and writer reference handling
Diffstat (limited to 'src/journal-remote/journal-remote-write.h')
-rw-r--r--src/journal-remote/journal-remote-write.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/journal-remote/journal-remote-write.h b/src/journal-remote/journal-remote-write.h
index 2ea5e6714f..9c5a641d2e 100644
--- a/src/journal-remote/journal-remote-write.h
+++ b/src/journal-remote/journal-remote-write.h
@@ -25,6 +25,8 @@
#include "journal-file.h"
+typedef struct RemoteServer RemoteServer;
+
struct iovec_wrapper {
struct iovec *iovec;
size_t size_bytes;
@@ -38,12 +40,25 @@ size_t iovw_size(struct iovec_wrapper *iovw);
typedef struct Writer {
JournalFile *journal;
JournalMetrics metrics;
+
MMapCache *mmap;
+ RemoteServer *server;
+ char *hashmap_key;
+
uint64_t seqnum;
+
+ int n_ref;
} Writer;
-int writer_init(Writer *s);
-int writer_close(Writer *s);
+Writer* writer_new(RemoteServer* server);
+Writer* writer_free(Writer *w);
+
+Writer* writer_ref(Writer *w);
+Writer* writer_unref(Writer *w);
+
+DEFINE_TRIVIAL_CLEANUP_FUNC(Writer*, writer_unref);
+#define _cleanup_writer_unref_ _cleanup_(writer_unrefp)
+
int writer_write(Writer *s,
struct iovec_wrapper *iovw,
dual_timestamp *ts,