diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-09-07 23:20:28 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-09-07 23:20:28 +0200 |
commit | a1a03e3075316e2376176fc54c74e071adc9d71a (patch) | |
tree | a9ae636fd1b17047398c0f9eaf8709ecb0a861f5 /src/journal/journal-file.c | |
parent | ac59a798f2e9e616872e5c571219374c6d8f010d (diff) |
journal: add call to determine current journal file disk usage
Diffstat (limited to 'src/journal/journal-file.c')
-rw-r--r-- | src/journal/journal-file.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c index 697e7f3606..06de2acc50 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c @@ -1906,6 +1906,8 @@ fail: void journal_file_print_header(JournalFile *f) { char a[33], b[33], c[33]; char x[FORMAT_TIMESTAMP_MAX], y[FORMAT_TIMESTAMP_MAX]; + struct stat st; + char bytes[FORMAT_BYTES_MAX]; assert(f); @@ -1970,6 +1972,9 @@ void journal_file_print_header(JournalFile *f) { if (JOURNAL_HEADER_CONTAINS(f->header, n_entry_arrays)) printf("Entry Array Objects: %llu\n", (unsigned long long) le64toh(f->header->n_entry_arrays)); + + if (fstat(f->fd, &st) >= 0) + printf("Disk usage: %s\n", format_bytes(bytes, sizeof(bytes), (off_t) st.st_blocks * 512ULL)); } int journal_file_open( |