[systemd-commits] Branch 'journal' - 2 commits - src/journal

Lennart Poettering lennart at kemper.freedesktop.org
Fri Dec 30 15:57:22 PST 2011


 src/journal/journal-file.h |    3 ++-
 src/journal/journalctl.c   |    3 ---
 src/journal/journald.c     |   10 ++++------
 3 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit 74ef2d16ada74db3059d825ce8d24ea74946bf8f
Author: Lennart Poettering <lennart at poettering.net>
Date:   Sat Dec 31 00:57:14 2011 +0100

    journal: move max_use into metrics structure

diff --git a/src/journal/journal-file.h b/src/journal/journal-file.h
index ab2970c..acc5527 100644
--- a/src/journal/journal-file.h
+++ b/src/journal/journal-file.h
@@ -28,7 +28,7 @@
 #include "util.h"
 #include "sd-id128.h"
 
-#define DEFAULT_MAX_SIZE (1024ULL*128ULL)
+#define DEFAULT_MAX_SIZE (128ULL*1024ULL*1024ULL)
 #define DEFAULT_MIN_SIZE (256ULL*1024ULL)
 #define DEFAULT_KEEP_FREE (1ULL*1024ULL*1024ULL)
 #define DEFAULT_MAX_USE (16ULL*1024ULL*1024ULL*16ULL)
@@ -54,6 +54,7 @@ typedef struct JournalMetrics {
         uint64_t max_size;
         uint64_t min_size;
         uint64_t keep_free;
+        uint64_t max_use;
 } JournalMetrics;
 
 typedef struct JournalFile {
diff --git a/src/journal/journald.c b/src/journal/journald.c
index a25f81e..78ccb4e 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -76,7 +76,6 @@ typedef struct Server {
         JournalRateLimit *rate_limit;
 
         JournalMetrics metrics;
-        uint64_t max_use;
         bool compress;
 
         uint64_t cached_available_space;
@@ -176,7 +175,7 @@ static uint64_t available_space(Server *s) {
                 sum += (uint64_t) st.st_blocks * (uint64_t) st.st_blksize;
         }
 
-        avail = sum >= s->max_use ? 0 : s->max_use - sum;
+        avail = sum >= s->metrics.max_use ? 0 : s->metrics.max_use - sum;
 
         ss_avail = ss.f_bsize * ss.f_bavail;
 
@@ -341,7 +340,7 @@ static void server_vacuum(Server *s) {
                 return;
         }
 
-        r = journal_directory_vacuum(p, s->max_use, s->metrics.keep_free);
+        r = journal_directory_vacuum(p, s->metrics.max_use, s->metrics.keep_free);
         if (r < 0 && r != -ENOENT)
                 log_error("Failed to vacuum %s: %s", p, strerror(-r));
         free(p);
@@ -351,7 +350,7 @@ static void server_vacuum(Server *s) {
                 return;
         }
 
-        r = journal_directory_vacuum(p, s->max_use, s->metrics.keep_free);
+        r = journal_directory_vacuum(p, s->metrics.max_use, s->metrics.keep_free);
         if (r < 0 && r != -ENOENT)
                 log_error("Failed to vacuum %s: %s", p, strerror(-r));
         free(p);
@@ -1721,7 +1720,7 @@ static int server_init(Server *s) {
         s->metrics.max_size = DEFAULT_MAX_SIZE;
         s->metrics.min_size = DEFAULT_MIN_SIZE;
         s->metrics.keep_free = DEFAULT_KEEP_FREE;
-        s->max_use = DEFAULT_MAX_USE;
+        s->metrics.max_use = DEFAULT_MAX_USE;
         s->compress = true;
 
         s->user_journals = hashmap_new(trivial_hash_func, trivial_compare_func);

commit b3a0ad5ab142a142ab526aeb3d0b69e98e4e523c
Author: Lennart Poettering <lennart at poettering.net>
Date:   Fri Dec 30 22:29:23 2011 +0100

    journal: disable default debug logging

diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index da4f510..7015182 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -444,9 +444,6 @@ int main(int argc, char *argv[]) {
         sd_journal *j = NULL;
         unsigned line = 0;
 
-        log_set_max_level(LOG_DEBUG);
-        log_set_target(LOG_TARGET_CONSOLE);
-
         log_parse_environment();
         log_open();
 
diff --git a/src/journal/journald.c b/src/journal/journald.c
index 8d6b3ab..a25f81e 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -1858,7 +1858,6 @@ int main(int argc, char *argv[]) {
         }
 
         log_set_target(LOG_TARGET_CONSOLE);
-        log_set_max_level(LOG_DEBUG);
         log_parse_environment();
         log_open();
 



More information about the systemd-commits mailing list