chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7851983
)
journal: push type_to_context conversion down to journal_file_move_to()
author
Michal Schmidt
<mschmidt@redhat.com>
Fri, 12 Dec 2014 22:20:05 +0000
(23:20 +0100)
committer
Michal Schmidt
<mschmidt@redhat.com>
Fri, 12 Dec 2014 23:47:23 +0000
(
00:47
+0100)
src/journal/journal-file.c
patch
|
blob
|
history
diff --git
a/src/journal/journal-file.c
b/src/journal/journal-file.c
index 1d73be1a2a9db8a935e79f335fda9d38e2cdb184..82e50fcca4229a403a6e8bd3b29b8d547077d100 100644
(file)
--- a/
src/journal/journal-file.c
+++ b/
src/journal/journal-file.c
@@
-379,7
+379,7
@@
static unsigned type_to_context(ObjectType type) {
return type > OBJECT_UNUSED && type < _OBJECT_TYPE_MAX ? type : 0;
}
return type > OBJECT_UNUSED && type < _OBJECT_TYPE_MAX ? type : 0;
}
-static int journal_file_move_to(JournalFile *f,
int context
, bool keep_always, uint64_t offset, uint64_t size, void **ret) {
+static int journal_file_move_to(JournalFile *f,
ObjectType type
, bool keep_always, uint64_t offset, uint64_t size, void **ret) {
assert(f);
assert(ret);
assert(f);
assert(ret);
@@
-396,7
+396,7
@@
static int journal_file_move_to(JournalFile *f, int context, bool keep_always, u
return -EADDRNOTAVAIL;
}
return -EADDRNOTAVAIL;
}
- return mmap_cache_get(f->mmap, f->fd, f->prot,
context
, keep_always, offset, size, &f->last_stat, ret);
+ return mmap_cache_get(f->mmap, f->fd, f->prot,
type_to_context(type)
, keep_always, offset, size, &f->last_stat, ret);
}
static uint64_t minimum_header_size(Object *o) {
}
static uint64_t minimum_header_size(Object *o) {
@@
-430,7
+430,7
@@
int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset
if (!VALID64(offset))
return -EFAULT;
if (!VALID64(offset))
return -EFAULT;
- r = journal_file_move_to(f, type
_to_context(type)
, false, offset, sizeof(ObjectHeader), &t);
+ r = journal_file_move_to(f, type, false, offset, sizeof(ObjectHeader), &t);
if (r < 0)
return r;
if (r < 0)
return r;
@@
-450,7
+450,7
@@
int journal_file_move_to_object(JournalFile *f, ObjectType type, uint64_t offset
return -EBADMSG;
if (s > sizeof(ObjectHeader)) {
return -EBADMSG;
if (s > sizeof(ObjectHeader)) {
- r = journal_file_move_to(f, type
_to_context(type)
, false, offset, s, &t);
+ r = journal_file_move_to(f, type, false, offset, s, &t);
if (r < 0)
return r;
if (r < 0)
return r;