tree-wide: say "ratelimit" not "rate_limit"

"ratelimit" is a real word, so we don't need to use the other form anywhere.
We had both forms in various places, let's standarize on the shorter and more
correct one.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2019-09-19 17:49:14 +02:00
parent 7bf081a1e5
commit 5ac1530eca
17 changed files with 92 additions and 92 deletions

View file

@ -764,8 +764,8 @@ const sd_bus_vtable bus_exec_vtable[] = {
SD_BUS_PROPERTY("SyslogLevel", "i", property_get_syslog_level, offsetof(ExecContext, syslog_priority), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("SyslogFacility", "i", property_get_syslog_facility, offsetof(ExecContext, syslog_priority), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("LogLevelMax", "i", bus_property_get_int, offsetof(ExecContext, log_level_max), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("LogRateLimitIntervalUSec", "t", bus_property_get_usec, offsetof(ExecContext, log_rate_limit_interval_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("LogRateLimitBurst", "u", bus_property_get_unsigned, offsetof(ExecContext, log_rate_limit_burst), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("LogRateLimitIntervalUSec", "t", bus_property_get_usec, offsetof(ExecContext, log_ratelimit_interval_usec), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("LogRateLimitBurst", "u", bus_property_get_unsigned, offsetof(ExecContext, log_ratelimit_burst), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("LogExtraFields", "aay", property_get_log_extra_fields, 0, SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("SecureBits", "i", bus_property_get_int, offsetof(ExecContext, secure_bits), SD_BUS_VTABLE_PROPERTY_CONST),
SD_BUS_PROPERTY("CapabilityBoundingSet", "t", NULL, offsetof(ExecContext, capability_bounding_set), SD_BUS_VTABLE_PROPERTY_CONST),
@ -1204,10 +1204,10 @@ int bus_exec_context_set_transient_property(
return bus_set_transient_log_level(u, name, &c->log_level_max, message, flags, error);
if (streq(name, "LogRateLimitIntervalUSec"))
return bus_set_transient_usec(u, name, &c->log_rate_limit_interval_usec, message, flags, error);
return bus_set_transient_usec(u, name, &c->log_ratelimit_interval_usec, message, flags, error);
if (streq(name, "LogRateLimitBurst"))
return bus_set_transient_unsigned(u, name, &c->log_rate_limit_burst, message, flags, error);
return bus_set_transient_unsigned(u, name, &c->log_ratelimit_burst, message, flags, error);
if (streq(name, "Personality"))
return bus_set_transient_personality(u, name, &c->personality, message, flags, error);

View file

@ -4000,8 +4000,8 @@ void exec_context_done(ExecContext *c) {
exec_context_free_log_extra_fields(c);
c->log_rate_limit_interval_usec = 0;
c->log_rate_limit_burst = 0;
c->log_ratelimit_interval_usec = 0;
c->log_ratelimit_burst = 0;
c->stdin_data = mfree(c->stdin_data);
c->stdin_data_size = 0;
@ -4515,16 +4515,16 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) {
fprintf(f, "%sLogLevelMax: %s\n", prefix, strna(t));
}
if (c->log_rate_limit_interval_usec > 0) {
if (c->log_ratelimit_interval_usec > 0) {
char buf_timespan[FORMAT_TIMESPAN_MAX];
fprintf(f,
"%sLogRateLimitIntervalSec: %s\n",
prefix, format_timespan(buf_timespan, sizeof(buf_timespan), c->log_rate_limit_interval_usec, USEC_PER_SEC));
prefix, format_timespan(buf_timespan, sizeof(buf_timespan), c->log_ratelimit_interval_usec, USEC_PER_SEC));
}
if (c->log_rate_limit_burst > 0)
fprintf(f, "%sLogRateLimitBurst: %u\n", prefix, c->log_rate_limit_burst);
if (c->log_ratelimit_burst > 0)
fprintf(f, "%sLogRateLimitBurst: %u\n", prefix, c->log_ratelimit_burst);
if (c->n_log_extra_fields > 0) {
size_t j;

View file

@ -245,8 +245,8 @@ struct ExecContext {
struct iovec* log_extra_fields;
size_t n_log_extra_fields;
usec_t log_rate_limit_interval_usec;
unsigned log_rate_limit_burst;
usec_t log_ratelimit_interval_usec;
unsigned log_ratelimit_burst;
int log_level_max;

View file

@ -59,8 +59,8 @@ $1.SyslogFacility, config_parse_log_facility, 0,
$1.SyslogLevel, config_parse_log_level, 0, offsetof($1, exec_context.syslog_priority)
$1.SyslogLevelPrefix, config_parse_bool, 0, offsetof($1, exec_context.syslog_level_prefix)
$1.LogLevelMax, config_parse_log_level, 0, offsetof($1, exec_context.log_level_max)
$1.LogRateLimitIntervalSec, config_parse_sec, 0, offsetof($1, exec_context.log_rate_limit_interval_usec)
$1.LogRateLimitBurst, config_parse_unsigned, 0, offsetof($1, exec_context.log_rate_limit_burst)
$1.LogRateLimitIntervalSec, config_parse_sec, 0, offsetof($1, exec_context.log_ratelimit_interval_usec)
$1.LogRateLimitBurst, config_parse_unsigned, 0, offsetof($1, exec_context.log_ratelimit_burst)
$1.LogExtraFields, config_parse_log_extra_fields, 0, offsetof($1, exec_context)
$1.Capabilities, config_parse_warn_compat, DISABLED_LEGACY, offsetof($1, exec_context)
$1.SecureBits, config_parse_exec_secure_bits, 0, offsetof($1, exec_context.secure_bits)

View file

@ -3416,8 +3416,8 @@ int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs) {
(void) serialize_bool(f, "exported-invocation-id", u->exported_invocation_id);
(void) serialize_bool(f, "exported-log-level-max", u->exported_log_level_max);
(void) serialize_bool(f, "exported-log-extra-fields", u->exported_log_extra_fields);
(void) serialize_bool(f, "exported-log-rate-limit-interval", u->exported_log_rate_limit_interval);
(void) serialize_bool(f, "exported-log-rate-limit-burst", u->exported_log_rate_limit_burst);
(void) serialize_bool(f, "exported-log-rate-limit-interval", u->exported_log_ratelimit_interval);
(void) serialize_bool(f, "exported-log-rate-limit-burst", u->exported_log_ratelimit_burst);
(void) serialize_item_format(f, "cpu-usage-base", "%" PRIu64, u->cpu_usage_base);
if (u->cpu_usage_last != NSEC_INFINITY)
@ -3636,7 +3636,7 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
if (r < 0)
log_unit_debug(u, "Failed to parse exported log rate limit interval %s, ignoring.", v);
else
u->exported_log_rate_limit_interval = r;
u->exported_log_ratelimit_interval = r;
continue;
@ -3646,7 +3646,7 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
if (r < 0)
log_unit_debug(u, "Failed to parse exported log rate limit burst %s, ignoring.", v);
else
u->exported_log_rate_limit_burst = r;
u->exported_log_ratelimit_burst = r;
continue;
@ -5504,7 +5504,7 @@ fail:
return r;
}
static int unit_export_log_rate_limit_interval(Unit *u, const ExecContext *c) {
static int unit_export_log_ratelimit_interval(Unit *u, const ExecContext *c) {
_cleanup_free_ char *buf = NULL;
const char *p;
int r;
@ -5512,26 +5512,26 @@ static int unit_export_log_rate_limit_interval(Unit *u, const ExecContext *c) {
assert(u);
assert(c);
if (u->exported_log_rate_limit_interval)
if (u->exported_log_ratelimit_interval)
return 0;
if (c->log_rate_limit_interval_usec == 0)
if (c->log_ratelimit_interval_usec == 0)
return 0;
p = strjoina("/run/systemd/units/log-rate-limit-interval:", u->id);
if (asprintf(&buf, "%" PRIu64, c->log_rate_limit_interval_usec) < 0)
if (asprintf(&buf, "%" PRIu64, c->log_ratelimit_interval_usec) < 0)
return log_oom();
r = symlink_atomic(buf, p);
if (r < 0)
return log_unit_debug_errno(u, r, "Failed to create log rate limit interval symlink %s: %m", p);
u->exported_log_rate_limit_interval = true;
u->exported_log_ratelimit_interval = true;
return 0;
}
static int unit_export_log_rate_limit_burst(Unit *u, const ExecContext *c) {
static int unit_export_log_ratelimit_burst(Unit *u, const ExecContext *c) {
_cleanup_free_ char *buf = NULL;
const char *p;
int r;
@ -5539,22 +5539,22 @@ static int unit_export_log_rate_limit_burst(Unit *u, const ExecContext *c) {
assert(u);
assert(c);
if (u->exported_log_rate_limit_burst)
if (u->exported_log_ratelimit_burst)
return 0;
if (c->log_rate_limit_burst == 0)
if (c->log_ratelimit_burst == 0)
return 0;
p = strjoina("/run/systemd/units/log-rate-limit-burst:", u->id);
if (asprintf(&buf, "%u", c->log_rate_limit_burst) < 0)
if (asprintf(&buf, "%u", c->log_ratelimit_burst) < 0)
return log_oom();
r = symlink_atomic(buf, p);
if (r < 0)
return log_unit_debug_errno(u, r, "Failed to create log rate limit burst symlink %s: %m", p);
u->exported_log_rate_limit_burst = true;
u->exported_log_ratelimit_burst = true;
return 0;
}
@ -5591,8 +5591,8 @@ void unit_export_state_files(Unit *u) {
if (c) {
(void) unit_export_log_level_max(u, c);
(void) unit_export_log_extra_fields(u, c);
(void) unit_export_log_rate_limit_interval(u, c);
(void) unit_export_log_rate_limit_burst(u, c);
(void) unit_export_log_ratelimit_interval(u, c);
(void) unit_export_log_ratelimit_burst(u, c);
}
}
@ -5630,18 +5630,18 @@ void unit_unlink_state_files(Unit *u) {
u->exported_log_extra_fields = false;
}
if (u->exported_log_rate_limit_interval) {
if (u->exported_log_ratelimit_interval) {
p = strjoina("/run/systemd/units/log-rate-limit-interval:", u->id);
(void) unlink(p);
u->exported_log_rate_limit_interval = false;
u->exported_log_ratelimit_interval = false;
}
if (u->exported_log_rate_limit_burst) {
if (u->exported_log_ratelimit_burst) {
p = strjoina("/run/systemd/units/log-rate-limit-burst:", u->id);
(void) unlink(p);
u->exported_log_rate_limit_burst = false;
u->exported_log_ratelimit_burst = false;
}
}

View file

@ -365,8 +365,8 @@ typedef struct Unit {
bool exported_invocation_id:1;
bool exported_log_level_max:1;
bool exported_log_extra_fields:1;
bool exported_log_rate_limit_interval:1;
bool exported_log_rate_limit_burst:1;
bool exported_log_ratelimit_interval:1;
bool exported_log_ratelimit_burst:1;
/* Whether we warned about clamping the CPU quota period */
bool warned_clamping_cpu_quota_period:1;

View file

@ -49,7 +49,7 @@ struct RawExport {
uint64_t written_uncompressed;
unsigned last_percent;
RateLimit progress_rate_limit;
RateLimit progress_ratelimit;
struct stat st;
@ -96,7 +96,7 @@ int raw_export_new(
.on_finished = on_finished,
.userdata = userdata,
.last_percent = (unsigned) -1,
.progress_rate_limit = { 100 * USEC_PER_MSEC, 1 },
.progress_ratelimit = { 100 * USEC_PER_MSEC, 1 },
};
if (event)
@ -124,7 +124,7 @@ static void raw_export_report_progress(RawExport *e) {
if (percent == e->last_percent)
return;
if (!ratelimit_below(&e->progress_rate_limit))
if (!ratelimit_below(&e->progress_ratelimit))
return;
sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent);

View file

@ -44,7 +44,7 @@ struct TarExport {
uint64_t quota_referenced;
unsigned last_percent;
RateLimit progress_rate_limit;
RateLimit progress_ratelimit;
bool eof;
bool tried_splice;
@ -99,7 +99,7 @@ int tar_export_new(
.userdata = userdata,
.quota_referenced = (uint64_t) -1,
.last_percent = (unsigned) -1,
.progress_rate_limit = { 100 * USEC_PER_MSEC, 1 },
.progress_ratelimit = { 100 * USEC_PER_MSEC, 1 },
};
if (event)
@ -131,7 +131,7 @@ static void tar_export_report_progress(TarExport *e) {
if (percent == e->last_percent)
return;
if (!ratelimit_below(&e->progress_rate_limit))
if (!ratelimit_below(&e->progress_ratelimit))
return;
sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent);

View file

@ -57,7 +57,7 @@ struct RawImport {
struct stat st;
unsigned last_percent;
RateLimit progress_rate_limit;
RateLimit progress_ratelimit;
};
RawImport* raw_import_unref(RawImport *i) {
@ -111,7 +111,7 @@ int raw_import_new(
.userdata = userdata,
.last_percent = (unsigned) -1,
.image_root = TAKE_PTR(root),
.progress_rate_limit = { 100 * USEC_PER_MSEC, 1 },
.progress_ratelimit = { 100 * USEC_PER_MSEC, 1 },
};
if (event)
@ -143,7 +143,7 @@ static void raw_import_report_progress(RawImport *i) {
if (percent == i->last_percent)
return;
if (!ratelimit_below(&i->progress_rate_limit))
if (!ratelimit_below(&i->progress_ratelimit))
return;
sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent);

View file

@ -60,7 +60,7 @@ struct TarImport {
pid_t tar_pid;
unsigned last_percent;
RateLimit progress_rate_limit;
RateLimit progress_ratelimit;
};
TarImport* tar_import_unref(TarImport *i) {
@ -119,7 +119,7 @@ int tar_import_new(
.userdata = userdata,
.last_percent = (unsigned) -1,
.image_root = TAKE_PTR(root),
.progress_rate_limit = { 100 * USEC_PER_MSEC, 1 },
.progress_ratelimit = { 100 * USEC_PER_MSEC, 1 },
};
if (event)
@ -151,7 +151,7 @@ static void tar_import_report_progress(TarImport *i) {
if (percent == i->last_percent)
return;
if (!ratelimit_below(&i->progress_rate_limit))
if (!ratelimit_below(&i->progress_ratelimit))
return;
sd_notifyf(false, "X_IMPORT_PROGRESS=%u", percent);

View file

@ -132,8 +132,8 @@ static int client_context_new(Server *s, pid_t pid, ClientContext **ret) {
c->timestamp = USEC_INFINITY;
c->extra_fields_mtime = NSEC_INFINITY;
c->log_level_max = -1;
c->log_rate_limit_interval = s->rate_limit_interval;
c->log_rate_limit_burst = s->rate_limit_burst;
c->log_ratelimit_interval = s->ratelimit_interval;
c->log_ratelimit_burst = s->ratelimit_burst;
r = hashmap_put(s->client_contexts, PID_TO_PTR(pid), c);
if (r < 0) {
@ -182,8 +182,8 @@ static void client_context_reset(Server *s, ClientContext *c) {
c->log_level_max = -1;
c->log_rate_limit_interval = s->rate_limit_interval;
c->log_rate_limit_burst = s->rate_limit_burst;
c->log_ratelimit_interval = s->ratelimit_interval;
c->log_ratelimit_burst = s->ratelimit_burst;
}
static ClientContext* client_context_free(Server *s, ClientContext *c) {
@ -459,7 +459,7 @@ static int client_context_read_extra_fields(
return 0;
}
static int client_context_read_log_rate_limit_interval(ClientContext *c) {
static int client_context_read_log_ratelimit_interval(ClientContext *c) {
_cleanup_free_ char *value = NULL;
const char *p;
int r;
@ -474,10 +474,10 @@ static int client_context_read_log_rate_limit_interval(ClientContext *c) {
if (r < 0)
return r;
return safe_atou64(value, &c->log_rate_limit_interval);
return safe_atou64(value, &c->log_ratelimit_interval);
}
static int client_context_read_log_rate_limit_burst(ClientContext *c) {
static int client_context_read_log_ratelimit_burst(ClientContext *c) {
_cleanup_free_ char *value = NULL;
const char *p;
int r;
@ -492,7 +492,7 @@ static int client_context_read_log_rate_limit_burst(ClientContext *c) {
if (r < 0)
return r;
return safe_atou(value, &c->log_rate_limit_burst);
return safe_atou(value, &c->log_ratelimit_burst);
}
static void client_context_really_refresh(
@ -521,8 +521,8 @@ static void client_context_really_refresh(
(void) client_context_read_invocation_id(s, c);
(void) client_context_read_log_level_max(s, c);
(void) client_context_read_extra_fields(s, c);
(void) client_context_read_log_rate_limit_interval(c);
(void) client_context_read_log_rate_limit_burst(c);
(void) client_context_read_log_ratelimit_interval(c);
(void) client_context_read_log_ratelimit_burst(c);
c->timestamp = timestamp;

View file

@ -53,8 +53,8 @@ struct ClientContext {
void *extra_fields_data;
nsec_t extra_fields_mtime;
usec_t log_rate_limit_interval;
unsigned log_rate_limit_burst;
usec_t log_ratelimit_interval;
unsigned log_ratelimit_burst;
};
int client_context_get(

View file

@ -24,9 +24,9 @@ Journal.Seal, config_parse_bool, 0, offsetof(Server, seal)
Journal.ReadKMsg, config_parse_bool, 0, offsetof(Server, read_kmsg)
Journal.SyncIntervalSec, config_parse_sec, 0, offsetof(Server, sync_interval_usec)
# The following is a legacy name for compatibility
Journal.RateLimitInterval, config_parse_sec, 0, offsetof(Server, rate_limit_interval)
Journal.RateLimitIntervalSec,config_parse_sec, 0, offsetof(Server, rate_limit_interval)
Journal.RateLimitBurst, config_parse_unsigned, 0, offsetof(Server, rate_limit_burst)
Journal.RateLimitInterval, config_parse_sec, 0, offsetof(Server, ratelimit_interval)
Journal.RateLimitIntervalSec,config_parse_sec, 0, offsetof(Server, ratelimit_interval)
Journal.RateLimitBurst, config_parse_unsigned, 0, offsetof(Server, ratelimit_burst)
Journal.SystemMaxUse, config_parse_iec_uint64, 0, offsetof(Server, system_storage.metrics.max_use)
Journal.SystemMaxFileSize, config_parse_iec_uint64, 0, offsetof(Server, system_storage.metrics.max_size)
Journal.SystemKeepFree, config_parse_iec_uint64, 0, offsetof(Server, system_storage.metrics.keep_free)

View file

@ -60,7 +60,7 @@ struct JournalRateLimit {
uint8_t hash_key[16];
};
JournalRateLimit *journal_rate_limit_new(void) {
JournalRateLimit *journal_ratelimit_new(void) {
JournalRateLimit *r;
r = new0(JournalRateLimit, 1);
@ -72,7 +72,7 @@ JournalRateLimit *journal_rate_limit_new(void) {
return r;
}
static void journal_rate_limit_group_free(JournalRateLimitGroup *g) {
static void journal_ratelimit_group_free(JournalRateLimitGroup *g) {
assert(g);
if (g->parent) {
@ -91,16 +91,16 @@ static void journal_rate_limit_group_free(JournalRateLimitGroup *g) {
free(g);
}
void journal_rate_limit_free(JournalRateLimit *r) {
void journal_ratelimit_free(JournalRateLimit *r) {
assert(r);
while (r->lru)
journal_rate_limit_group_free(r->lru);
journal_ratelimit_group_free(r->lru);
free(r);
}
_pure_ static bool journal_rate_limit_group_expired(JournalRateLimitGroup *g, usec_t ts) {
_pure_ static bool journal_ratelimit_group_expired(JournalRateLimitGroup *g, usec_t ts) {
unsigned i;
assert(g);
@ -112,18 +112,18 @@ _pure_ static bool journal_rate_limit_group_expired(JournalRateLimitGroup *g, us
return true;
}
static void journal_rate_limit_vacuum(JournalRateLimit *r, usec_t ts) {
static void journal_ratelimit_vacuum(JournalRateLimit *r, usec_t ts) {
assert(r);
/* Makes room for at least one new item, but drop all
* expored items too. */
while (r->n_groups >= GROUPS_MAX ||
(r->lru_tail && journal_rate_limit_group_expired(r->lru_tail, ts)))
journal_rate_limit_group_free(r->lru_tail);
(r->lru_tail && journal_ratelimit_group_expired(r->lru_tail, ts)))
journal_ratelimit_group_free(r->lru_tail);
}
static JournalRateLimitGroup* journal_rate_limit_group_new(JournalRateLimit *r, const char *id, usec_t interval, usec_t ts) {
static JournalRateLimitGroup* journal_ratelimit_group_new(JournalRateLimit *r, const char *id, usec_t interval, usec_t ts) {
JournalRateLimitGroup *g;
assert(r);
@ -141,7 +141,7 @@ static JournalRateLimitGroup* journal_rate_limit_group_new(JournalRateLimit *r,
g->interval = interval;
journal_rate_limit_vacuum(r, ts);
journal_ratelimit_vacuum(r, ts);
LIST_PREPEND(bucket, r->buckets[g->hash % BUCKETS_MAX], g);
LIST_PREPEND(lru, r->lru, g);
@ -153,7 +153,7 @@ static JournalRateLimitGroup* journal_rate_limit_group_new(JournalRateLimit *r,
return g;
fail:
journal_rate_limit_group_free(g);
journal_ratelimit_group_free(g);
return NULL;
}
@ -185,7 +185,7 @@ static unsigned burst_modulate(unsigned burst, uint64_t available) {
return burst;
}
int journal_rate_limit_test(JournalRateLimit *r, const char *id, usec_t rl_interval, unsigned rl_burst, int priority, uint64_t available) {
int journal_ratelimit_test(JournalRateLimit *r, const char *id, usec_t rl_interval, unsigned rl_burst, int priority, uint64_t available) {
uint64_t h;
JournalRateLimitGroup *g;
JournalRateLimitPool *p;
@ -214,7 +214,7 @@ int journal_rate_limit_test(JournalRateLimit *r, const char *id, usec_t rl_inter
break;
if (!g) {
g = journal_rate_limit_group_new(r, id, rl_interval, ts);
g = journal_ratelimit_group_new(r, id, rl_interval, ts);
if (!g)
return -ENOMEM;
} else

View file

@ -5,6 +5,6 @@
typedef struct JournalRateLimit JournalRateLimit;
JournalRateLimit *journal_rate_limit_new(void);
void journal_rate_limit_free(JournalRateLimit *r);
int journal_rate_limit_test(JournalRateLimit *r, const char *id, usec_t rl_interval, unsigned rl_burst, int priority, uint64_t available);
JournalRateLimit *journal_ratelimit_new(void);
void journal_ratelimit_free(JournalRateLimit *r);
int journal_ratelimit_test(JournalRateLimit *r, const char *id, usec_t rl_interval, unsigned rl_burst, int priority, uint64_t available);

View file

@ -1098,7 +1098,7 @@ void server_dispatch_message(
if (c && c->unit) {
(void) determine_space(s, &available, NULL);
rl = journal_rate_limit_test(s->rate_limit, c->unit, c->log_rate_limit_interval, c->log_rate_limit_burst, priority & LOG_PRIMASK, available);
rl = journal_ratelimit_test(s->ratelimit, c->unit, c->log_ratelimit_interval, c->log_ratelimit_burst, priority & LOG_PRIMASK, available);
if (rl == 0)
return;
@ -2020,8 +2020,8 @@ int server_init(Server *s) {
.sync_interval_usec = DEFAULT_SYNC_INTERVAL_USEC,
.sync_scheduled = false,
.rate_limit_interval = DEFAULT_RATE_LIMIT_INTERVAL,
.rate_limit_burst = DEFAULT_RATE_LIMIT_BURST,
.ratelimit_interval = DEFAULT_RATE_LIMIT_INTERVAL,
.ratelimit_burst = DEFAULT_RATE_LIMIT_BURST,
.forward_to_wall = true,
@ -2048,10 +2048,10 @@ int server_init(Server *s) {
if (r < 0)
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");
if (!!s->rate_limit_interval ^ !!s->rate_limit_burst) {
if (!!s->ratelimit_interval ^ !!s->ratelimit_burst) {
log_debug("Setting both rate limit interval and burst from "USEC_FMT",%u to 0,0",
s->rate_limit_interval, s->rate_limit_burst);
s->rate_limit_interval = s->rate_limit_burst = 0;
s->ratelimit_interval, s->ratelimit_burst);
s->ratelimit_interval = s->ratelimit_burst = 0;
}
(void) mkdir_p("/run/systemd/journal", 0755);
@ -2180,8 +2180,8 @@ int server_init(Server *s) {
if (r < 0)
return r;
s->rate_limit = journal_rate_limit_new();
if (!s->rate_limit)
s->ratelimit = journal_ratelimit_new();
if (!s->ratelimit)
return -ENOMEM;
r = cg_get_root_path(&s->cgroup_root);
@ -2261,8 +2261,8 @@ void server_done(Server *s) {
safe_close(s->hostname_fd);
safe_close(s->notify_fd);
if (s->rate_limit)
journal_rate_limit_free(s->rate_limit);
if (s->ratelimit)
journal_ratelimit_free(s->ratelimit);
if (s->kernel_seqnum)
munmap(s->kernel_seqnum, sizeof(uint64_t));

View file

@ -94,10 +94,10 @@ struct Server {
char *buffer;
size_t buffer_size;
JournalRateLimit *rate_limit;
JournalRateLimit *ratelimit;
usec_t sync_interval_usec;
usec_t rate_limit_interval;
unsigned rate_limit_burst;
usec_t ratelimit_interval;
unsigned ratelimit_burst;
JournalStorage runtime_storage;
JournalStorage system_storage;