diff options
author | Dexuan Cui <dexuan.cui@intel.com> | 2012-03-29 00:35:09 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-04-02 04:26:09 +0100 |
commit | 8f17e499cf91191727c8767e839738cb39c21655 (patch) | |
tree | ff928b8e77c62375328841aaa822a1d95ce5dd04 /meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0019-Make-sure-superblock-is-clear-on-allocation.patch | |
parent | b3ccc630e6c12a75111b1f7ca877e17d8d4e1dc7 (diff) | |
download | openembedded-core-8f17e499cf91191727c8767e839738cb39c21655.tar.gz openembedded-core-8f17e499cf91191727c8767e839738cb39c21655.tar.bz2 openembedded-core-8f17e499cf91191727c8767e839738cb39c21655.zip |
genext2fs: support large files and filesystems without using large amounts of memory
update_to_1.95.patch was generated by making a diff bewteen the 1.4.1 release
and the latest 1.9.5 version in the cvs repo:
http://genext2fs.cvs.sourceforge.net/viewvc/genext2fs/genext2fs/genext2fs.c?revision=1.95
The patches 0001-0019 come from mailing list of genext2fs-devel
http://sourceforge.net/mailarchive/forum.php?forum_name=genext2fs-devel&max_rows=100&style=flat&viewmonth=201106
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Diffstat (limited to 'meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0019-Make-sure-superblock-is-clear-on-allocation.patch')
-rw-r--r-- | meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0019-Make-sure-superblock-is-clear-on-allocation.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0019-Make-sure-superblock-is-clear-on-allocation.patch b/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0019-Make-sure-superblock-is-clear-on-allocation.patch new file mode 100644 index 0000000000..a75a8128cc --- /dev/null +++ b/meta/recipes-devtools/genext2fs/genext2fs-1.4.1/0019-Make-sure-superblock-is-clear-on-allocation.patch @@ -0,0 +1,42 @@ +Upstream-Status: inappropriate + +From a263cdabad01ba99581b26d1753cd459f2669413 Mon Sep 17 00:00:00 2001 +From: Corey Minyard <cminyard@mvista.com> +Date: Tue, 7 Jun 2011 09:14:19 -0500 +Subject: [PATCH 19/19] Make sure superblock is clear on allocation + +Use calloc, not malloc, so the allocated superblock is zero-ed. Also, +get rid of some unnecessary casts. +--- + genext2fs.c | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/genext2fs.c b/genext2fs.c +index 28ba94f..fab90be 100644 +--- a/genext2fs.c ++++ b/genext2fs.c +@@ -2447,10 +2447,10 @@ init_fs(int nbblocks, int nbinodes, int nbresrvd, int holes, + fs->nheadblocks = (((nbgroups * sizeof(groupdescriptor)) + + sizeof(superblock) + (BLOCKSIZE - 1)) + / BLOCKSIZE); +- fs->sb = (superblock *) malloc(BLOCKSIZE); ++ fs->sb = calloc(1, BLOCKSIZE); + if (!fs->sb) + error_msg_and_die("error allocating header memory"); +- fs->gd = (groupdescriptor *) calloc(fs->nheadblocks - 1, BLOCKSIZE); ++ fs->gd = calloc(fs->nheadblocks - 1, BLOCKSIZE); + if (!fs->gd) + error_msg_and_die("error allocating header memory"); + +@@ -2595,7 +2595,7 @@ load_fs(FILE * fh, int swapit, char *fname) + + /* Read and check the superblock, then read the superblock + * and all the group descriptors */ +- fs->sb = malloc(BLOCKSIZE); ++ fs->sb = calloc(1, BLOCKSIZE); + if (!fs->sb) + error_msg_and_die("error allocating header memory"); + if (fseek(fs->f, BLOCKSIZE, SEEK_SET)) +-- +1.7.4.1 + |