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 (from parent 1:
689b9a2
)
journal: only fallocate() what we really need to avoid slowness on file systems which...
author
Lennart Poettering
<lennart@poettering.net>
Wed, 12 Oct 2011 02:41:27 +0000
(
04:41
+0200)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 12 Oct 2011 02:41:27 +0000
(
04:41
+0200)
src/journal/journal-file.c
patch
|
blob
|
history
diff --git
a/src/journal/journal-file.c
b/src/journal/journal-file.c
index 37e2e37eb126c786d0239a04b5f1ed6be89d3535..45cc0d1d8eba70c93c98f79a59c96ee77d3f4165 100644
(file)
--- a/
src/journal/journal-file.c
+++ b/
src/journal/journal-file.c
@@
-162,7
+162,7
@@
static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size)
new_size = PAGE_ALIGN(offset + size);
/* We assume that this file is not sparse, and we know that
new_size = PAGE_ALIGN(offset + size);
/* We assume that this file is not sparse, and we know that
- * for sure, since we alway call posix_fallocate()
+ * for sure, since we alway
s
call posix_fallocate()
* ourselves */
old_size =
* ourselves */
old_size =
@@
-195,7
+195,7
@@
static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size)
if (asize > le64toh(f->header->arena_max_size))
return -E2BIG;
if (asize > le64toh(f->header->arena_max_size))
return -E2BIG;
- if (posix_fallocate(f->fd,
0, new
_size) < 0)
+ if (posix_fallocate(f->fd,
old_size, new_size - old
_size) < 0)
return -errno;
if (fstat(f->fd, &f->last_stat) < 0)
return -errno;
if (fstat(f->fd, &f->last_stat) < 0)