diff options
author | Ruediger Meier | 2014-05-18 23:31:28 +0200 |
---|---|---|
committer | Ruediger Meier | 2014-05-19 09:22:44 +0200 |
commit | 38141baff61647bcf64f21e78ccecc3953be98a6 (patch) | |
tree | 6863240215beb36d08f87d6f19287cc273ff7fe0 /disk-utils/fsck.cramfs.c | |
parent | fsck.cramfs: ifdef unused outbuffer and page_size (diff) | |
download | kernel-qcow2-util-linux-38141baff61647bcf64f21e78ccecc3953be98a6.tar.gz kernel-qcow2-util-linux-38141baff61647bcf64f21e78ccecc3953be98a6.tar.xz kernel-qcow2-util-linux-38141baff61647bcf64f21e78ccecc3953be98a6.zip |
fsck.cramfs: rename variable page_size to blksize
... similar to mkfs.cramfs.c
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'disk-utils/fsck.cramfs.c')
-rw-r--r-- | disk-utils/fsck.cramfs.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/disk-utils/fsck.cramfs.c b/disk-utils/fsck.cramfs.c index 58276a41f..e38633ca3 100644 --- a/disk-utils/fsck.cramfs.c +++ b/disk-utils/fsck.cramfs.c @@ -101,7 +101,7 @@ static void expand_fs(char *, struct cramfs_inode *); static char *outbuffer; -static size_t page_size; +static size_t blksize; #endif /* INCLUDE_FS_TESTS */ @@ -353,11 +353,11 @@ static int uncompress_block(void *src, size_t len) stream.avail_in = len; stream.next_out = (unsigned char *)outbuffer; - stream.avail_out = page_size * 2; + stream.avail_out = blksize * 2; inflateReset(&stream); - if (len > page_size * 2) + if (len > blksize * 2) errx(FSCK_EX_UNCORRECTED, _("data block too large")); err = inflate(&stream, Z_FINISH); @@ -374,10 +374,10 @@ static int uncompress_block(void *src, size_t len) static void do_uncompress(char *path, int fd, unsigned long offset, unsigned long size) { - unsigned long curr = offset + 4 * ((size + page_size - 1) / page_size); + unsigned long curr = offset + 4 * ((size + blksize - 1) / blksize); do { - unsigned long out = page_size; + unsigned long out = blksize; unsigned long next = u32_toggle_endianness(cramfs_is_big_endian, *(uint32_t *) romfs_read(offset)); @@ -389,8 +389,8 @@ static void do_uncompress(char *path, int fd, unsigned long offset, if (curr == next) { if (opt_verbose > 1) printf(_(" hole at %ld (%zd)\n"), curr, - page_size); - if (size < page_size) + blksize); + if (size < blksize) out = size; memset(outbuffer, 0x00, out); } else { @@ -399,8 +399,8 @@ static void do_uncompress(char *path, int fd, unsigned long offset, curr, next, next - curr); out = uncompress_block(romfs_read(curr), next - curr); } - if (size >= page_size) { - if (out != page_size) + if (size >= blksize) { + if (out != blksize) errx(FSCK_EX_UNCORRECTED, _("non-block (%ld) bytes"), out); } else { @@ -698,8 +698,8 @@ int main(int argc, char **argv) test_super(&start, &length); test_crc(start); #ifdef INCLUDE_FS_TESTS - page_size = getpagesize(); - outbuffer = xmalloc(page_size * 2); + blksize = getpagesize(); + outbuffer = xmalloc(blksize * 2); test_fs(start); #endif |