journal: completely rework the mmap cache as I too dumb to actually understand it
Instead of doing hand optimized fd bisect arrays just use plain old hashmaps. Now I can understand my own code again. Yay! As a side effect this should fix some bad memory accesses caused by accesses after mmap(), introduced in 189.
This commit is contained in:
parent
aaeef05886
commit
f801968466
13
Makefile.am
13
Makefile.am
|
@ -2473,6 +2473,13 @@ test_journal_verify_LDADD = \
|
||||||
libsystemd-journal-internal.la \
|
libsystemd-journal-internal.la \
|
||||||
libsystemd-id128-internal.la
|
libsystemd-id128-internal.la
|
||||||
|
|
||||||
|
test_mmap_cache_SOURCES = \
|
||||||
|
src/journal/test-mmap-cache.c
|
||||||
|
|
||||||
|
test_mmap_cache_LDADD = \
|
||||||
|
libsystemd-shared.la \
|
||||||
|
libsystemd-journal-internal.la
|
||||||
|
|
||||||
libsystemd_journal_la_SOURCES = \
|
libsystemd_journal_la_SOURCES = \
|
||||||
src/journal/sd-journal.c \
|
src/journal/sd-journal.c \
|
||||||
src/systemd/sd-journal.h \
|
src/systemd/sd-journal.h \
|
||||||
|
@ -2577,13 +2584,15 @@ noinst_PROGRAMS += \
|
||||||
test-journal-send \
|
test-journal-send \
|
||||||
test-journal-match \
|
test-journal-match \
|
||||||
test-journal-stream \
|
test-journal-stream \
|
||||||
test-journal-verify
|
test-journal-verify \
|
||||||
|
test-mmap-cache
|
||||||
|
|
||||||
TESTS += \
|
TESTS += \
|
||||||
test-journal \
|
test-journal \
|
||||||
test-journal-match \
|
test-journal-match \
|
||||||
test-journal-stream \
|
test-journal-stream \
|
||||||
test-journal-verify
|
test-journal-verify \
|
||||||
|
test-mmap-cache
|
||||||
|
|
||||||
pkginclude_HEADERS += \
|
pkginclude_HEADERS += \
|
||||||
src/systemd/sd-journal.h \
|
src/systemd/sd-journal.h \
|
||||||
|
|
5
TODO
5
TODO
|
@ -19,6 +19,11 @@ F18:
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
|
||||||
|
* document that deps in [Unit] sections ignore Alias= fileds in
|
||||||
|
[Install] units of other units, unless those units are disabled
|
||||||
|
|
||||||
|
* need to update LGPL2.1 text to newest version (with updated FSF address)
|
||||||
|
|
||||||
* allow users from "wheel" to start/stop services
|
* allow users from "wheel" to start/stop services
|
||||||
|
|
||||||
* systemctl: when powering down/suspending check for inhibitors, and warn.
|
* systemctl: when powering down/suspending check for inhibitors, and warn.
|
||||||
|
|
|
@ -1829,7 +1829,6 @@ static int service_spawn(
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
|
||||||
if ((r = unit_watch_pid(UNIT(s), pid)) < 0)
|
if ((r = unit_watch_pid(UNIT(s), pid)) < 0)
|
||||||
/* FIXME: we need to do something here */
|
/* FIXME: we need to do something here */
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -22,6 +22,8 @@
|
||||||
***/
|
***/
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
typedef struct MMapCache MMapCache;
|
typedef struct MMapCache MMapCache;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue