X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fjournal%2Fjournal-file.h;h=21b0821b6b246fbb5cf98cb82a4cded6cc1f64b4;hp=cdbc8e41f615e9989e00e0ed0746ff15e30776dc;hb=b8e891e699e1336c5527f8203e4e8f67c9bbeb84;hpb=f274ece0f76b5709408821e317e87aef76123db6;ds=sidebyside diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h index cdbc8e41f..21b0821b6 100644 --- a/src/journal/journal-file.h +++ b/src/journal/journal-file.h @@ -42,19 +42,28 @@ typedef struct JournalMetrics { uint64_t keep_free; } JournalMetrics; +typedef enum direction { + DIRECTION_UP, + DIRECTION_DOWN +} direction_t; + typedef struct JournalFile { int fd; - char *path; - struct stat last_stat; + mode_t mode; int flags; int prot; - bool writable; - bool compress; - bool seal; + bool writable:1; + bool compress:1; + bool seal:1; + + bool tail_entry_monotonic_valid:1; - bool tail_entry_monotonic_valid; + direction_t last_direction; + + char *path; + struct stat last_stat; Header *header; HashItem *data_hash_table; @@ -90,11 +99,6 @@ typedef struct JournalFile { #endif } JournalFile; -typedef enum direction { - DIRECTION_UP, - DIRECTION_DOWN -} direction_t; - int journal_file_open( const char *fname, int flags, @@ -106,6 +110,7 @@ int journal_file_open( JournalFile *template, JournalFile **ret); +int journal_file_set_offline(JournalFile *f); void journal_file_close(JournalFile *j); int journal_file_open_reliably( @@ -148,9 +153,9 @@ static inline bool VALID_EPOCH(uint64_t u) { int journal_file_move_to_object(JournalFile *f, int type, uint64_t offset, Object **ret); -uint64_t journal_file_entry_n_items(Object *o); -uint64_t journal_file_entry_array_n_items(Object *o); -uint64_t journal_file_hash_table_n_items(Object *o); +uint64_t journal_file_entry_n_items(Object *o) _pure_; +uint64_t journal_file_entry_array_n_items(Object *o) _pure_; +uint64_t journal_file_hash_table_n_items(Object *o) _pure_; int journal_file_append_object(JournalFile *f, int type, uint64_t size, Object **ret, uint64_t *offset); int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const struct iovec iovec[], unsigned n_iovec, uint64_t *seqno, Object **ret, uint64_t *offset);