diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-08 20:11:43 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-02-12 11:07:55 +0100 |
commit | 858749f7312bd0adb5433075a92e1c35a2fb56ac (patch) | |
tree | 69057fbed17283d5ea48f0731636aa3ad890b692 /src/journal/journal-internal.h | |
parent | a9be06926924e150991306ae596b951d779b80db (diff) | |
download | systemd-858749f7312bd0adb5433075a92e1c35a2fb56ac.tar.gz |
sd-journal: properly handle inotify queue overflow
This adds proper handling of IN_Q_OVERFLOW: when the inotify queue runs
over we'll reiterate all directories we are looking at. At the same time
we'll mark all files and directories we encounter that way with a
generation counter we first increased. All files and directories not
marked like this are then unloaded.
With this logic we do the best when the inotify queue overflows: we
synchronize our in-memory state again with what's on disk.
This contains some refactoring of the directory logic, to share more
code between uuid directories and "root" directories and generally make
things a bit more readable by splitting things up into smaller bits.
See: #7998 #8032
Diffstat (limited to 'src/journal/journal-internal.h')
-rw-r--r-- | src/journal/journal-internal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/journal/journal-internal.h b/src/journal/journal-internal.h index d0d2842cc4..e5f563cced 100644 --- a/src/journal/journal-internal.h +++ b/src/journal/journal-internal.h @@ -80,6 +80,7 @@ struct Directory { char *path; int wd; bool is_root; + unsigned last_seen_generation; }; struct sd_journal { @@ -104,6 +105,7 @@ struct sd_journal { int inotify_fd; unsigned current_invalidate_counter, last_invalidate_counter; usec_t last_process_usec; + unsigned generation; /* Iterating through unique fields and their data values */ char *unique_field; |