summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-12-16 22:38:09 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-12-18 12:20:25 +0100
commit1eb6332d557e6e510a9ce723296cb3b658d7e9a4 (patch)
tree6134c897be6df13122b4fd1da0c0ad17b284beed /src
parent6573ef05a3cbe15949acfbbf1ad03726068907bd (diff)
journal: simplify set_location()
set_location() is called from real_journal_next() when a winning entry has been picked from among the candidates in journal files. The location type is always set to LOCATION_DISCRETE. No need to pass it as a parameter. The per-JournalFile location information is already updated at this point. No need for having the direction and offset here.
Diffstat (limited to 'src')
-rw-r--r--src/journal/sd-journal.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 71b056c234..5a00cb0c94 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -114,21 +114,16 @@ static void init_location(Location *l, LocationType type, JournalFile *f, Object
l->seqnum_set = l->realtime_set = l->monotonic_set = l->xor_hash_set = true;
}
-static void set_location(sd_journal *j, LocationType type, JournalFile *f, Object *o,
- direction_t direction, uint64_t offset) {
+static void set_location(sd_journal *j, JournalFile *f, Object *o) {
assert(j);
- assert(type == LOCATION_DISCRETE || type == LOCATION_SEEK);
assert(f);
assert(o);
- init_location(&j->current_location, type, f, o);
+ init_location(&j->current_location, LOCATION_DISCRETE, f, o);
j->current_file = f;
j->current_field = 0;
- f->last_direction = direction;
- f->current_offset = offset;
-
/* Let f know its candidate entry was picked. */
assert(f->location_type == LOCATION_SEEK);
f->location_type = LOCATION_DISCRETE;
@@ -921,7 +916,7 @@ static int real_journal_next(sd_journal *j, direction_t direction) {
if (r < 0)
return r;
- set_location(j, LOCATION_DISCRETE, new_file, o, direction, new_offset);
+ set_location(j, new_file, o);
return 1;
}