#include <sys/statvfs.h>
#include <fcntl.h>
#include <stddef.h>
-#include <sys/xattr.h>
#include "journal-def.h"
#include "journal-file.h"
int journal_file_next_entry(
JournalFile *f,
- Object *o, uint64_t p,
+ uint64_t p,
direction_t direction,
Object **ret, uint64_t *offset) {
int r;
assert(f);
- assert(p > 0 || !o);
n = le64toh(f->header->n_entries);
if (n <= 0)
return 0;
- if (!o)
+ if (p == 0)
i = direction == DIRECTION_DOWN ? 0 : n - 1;
else {
- if (o->object.type != OBJECT_ENTRY)
- return -EINVAL;
-
r = generic_array_bisect(f,
le64toh(f->header->entry_array_offset),
le64toh(f->header->n_entries),
}
if (f->last_stat.st_size == 0 && f->writable) {
- uint64_t crtime;
-
/* Let's attach the creation time to the journal file,
* so that the vacuuming code knows the age of this
* file even if the file might end up corrupted one
* attributes are not supported we'll just skip this,
* and rely solely on mtime/atime/ctime of the file. */
- crtime = htole64((uint64_t) now(CLOCK_REALTIME));
- fsetxattr(f->fd, "user.crtime_usec", &crtime, sizeof(crtime), XATTR_CREATE);
+ fd_setcrtime(f->fd, now(CLOCK_REALTIME));
#ifdef HAVE_GCRYPT
/* Try to load the FSPRG state, and if we can't, then