| fc0fc50f | 04-Feb-2014 |
Ionut Nicu <ioan.nicu.ext@nsn.com> |
ext4fs: Add ext4 extent cache for read operations
In an ext4 filesystem, the inode corresponding to a file has a 60-byte area which contains an extent header structure and up to 4 extent structures
ext4fs: Add ext4 extent cache for read operations
In an ext4 filesystem, the inode corresponding to a file has a 60-byte area which contains an extent header structure and up to 4 extent structures (5 x 12 bytes).
For files that need more than 4 extents to be represented (either files larger than 4 x 128MB = 512MB or smaller files but very fragmented), ext4 creates extent index structures. Each extent index points to a 4KB physical block where one extent header and additional 340 extents could be stored.
The current u-boot ext4 code is very inefficient when it tries to load a file which has extent indexes. For each logical file block the code will read over and over again the same blocks of 4096 bytes from the disk.
Since the extent tree in a file is always the same, we can cache the extent structures in memory before actually starting to read the file.
This patch creates a simple linked list of structures holding information about all the extents used to represent a file. The list is sorted by the logical block number (ee_block) so that we can easily find the proper extent information for any file block.
Without this patch, a 69MB file which had just one extent index pointing to a block with another 6 extents was read in approximately 3 minutes. With this patch applied the same file can be read in almost 20 seconds.
Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com>
show more ...
|
| b7b5f319 | 03-Feb-2014 |
Stephen Warren <swarren@nvidia.com> |
fat: implement exists() for FAT fs
This hooks into the generic "file exists" support added in an earlier patch, and provides an implementation for the FAT filesystem.
Signed-off-by: Stephen Warren
fat: implement exists() for FAT fs
This hooks into the generic "file exists" support added in an earlier patch, and provides an implementation for the FAT filesystem.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 55af5c93 | 03-Feb-2014 |
Stephen Warren <swarren@nvidia.com> |
ext4: implement exists() for ext4fs
This hooks into the generic "file exists" support added in an earlier patch, and provides an implementation for the ext4 filesystem.
Signed-off-by: Stephen Warre
ext4: implement exists() for ext4fs
This hooks into the generic "file exists" support added in an earlier patch, and provides an implementation for the ext4 filesystem.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 0a30aa1e | 03-Feb-2014 |
Stephen Warren <swarren@nvidia.com> |
sandbox: implement exists() function
This hooks into the generic "file exists" support added in an earlier patch, and provides an implementation for the sandbox test environment.
Signed-off-by: Ste
sandbox: implement exists() function
This hooks into the generic "file exists" support added in an earlier patch, and provides an implementation for the sandbox test environment.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 377202b5 | 03-Feb-2014 |
Stephen Warren <swarren@nvidia.com> |
fs: don't pass NULL dev_desc to most filesystems
FAT and ext4 expect that the passed in block device descriptor not be NULL. This causes problems on sandbox, where get_device_and_partition() succeed
fs: don't pass NULL dev_desc to most filesystems
FAT and ext4 expect that the passed in block device descriptor not be NULL. This causes problems on sandbox, where get_device_and_partition() succeeds for the "host" device, yet passes back a NULL device descriptor. Add special handling for this situation, so that the generic filesystem commands operate as expected on sandbox.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
show more ...
|
| 6152916a | 03-Feb-2014 |
Stephen Warren <swarren@nvidia.com> |
fs: implement infrastructure for an 'exists' function
This could be used in scripts such as:
if test -e mmc 0:1 /boot/boot.scr; then load mmc 0:1 ${scriptaddr} /boot/boot.scr source ${scrip
fs: implement infrastructure for an 'exists' function
This could be used in scripts such as:
if test -e mmc 0:1 /boot/boot.scr; then load mmc 0:1 ${scriptaddr} /boot/boot.scr source ${scriptaddr} fi
rather than:
if load mmc 0:1 ${scriptaddr} /boot/boot.scr; then source ${scriptaddr} fi
This prevents errors being printed by attempts to load non-existent files, which can be important when checking for a large set of files, such as /boot/boot.scr.uimg, /boot/boot.scr, /boot/extlinux.conf, /boot.scr.uimg, /boot.scr, /extlinux.conf.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
show more ...
|
| 55283635 | 20-Jan-2014 |
Charles Manning <cdhmanning@gmail.com> |
yaffs2: Remove block number check from summary verification
The summary already has other verification. This one is not needed.
The check caused summaries to be ignored if they were not on the numb
yaffs2: Remove block number check from summary verification
The summary already has other verification. This one is not needed.
The check caused summaries to be ignored if they were not on the numbered block. This caused problems when a summary was embedded in an image and the image is written to a flash with bad blocks.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
show more ...
|
| b5bbac1a | 13-Jan-2014 |
Ionut Nicu <ioan.nicu.ext@nsn.com> |
ext4fs: fix "invalid extent block" error
For files where we actually have extent indexes following an extent header (ext_block->eh_depth != 0), the do/while loop from ext4fs_get_extent_block() does
ext4fs: fix "invalid extent block" error
For files where we actually have extent indexes following an extent header (ext_block->eh_depth != 0), the do/while loop from ext4fs_get_extent_block() does not select the proper extent index structure.
For example, if we have:
ext_block->eh_depth = 1 ext_block->eh_entries = 1 fileblock = 0 index[0].ei_block = 0
the do/while loop will exit with i set to 0 and the ext4fs_get_extent_block() function will return 0, even if there was a valid extent index structure following the header.
Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com> Signed-off-by: Mathias Rulf <mathias.rulf@nsn.com>
show more ...
|
| 47017327 | 13-Jan-2014 |
Ionut Nicu <ioan.nicu.ext@nsn.com> |
ext4fs: use EXT2_BLOCK_SIZE instead of fs->blksz
Using fs->blksz in ext4fs_get_extent_block() is not correct since fs->blksz is not initialized on the read path. Use EXT2_BLOCK_SIZE() instead which
ext4fs: use EXT2_BLOCK_SIZE instead of fs->blksz
Using fs->blksz in ext4fs_get_extent_block() is not correct since fs->blksz is not initialized on the read path. Use EXT2_BLOCK_SIZE() instead which will produce the desired output.
Signed-off-by: Ionut Nicu <ioan.nicu.ext@nsn.com> Signed-off-by: Mathias Rulf <mathias.rulf@nsn.com>
show more ...
|
| 0550870b | 08-Jan-2014 |
Ma Haijun <mahaijuns@gmail.com> |
fs/ext4: fix calling put_ext4 with truncated offset
Curently, we are using 32 bit multiplication to calculate the offset, so the result will always be 32 bit. This can silently cause file system cor
fs/ext4: fix calling put_ext4 with truncated offset
Curently, we are using 32 bit multiplication to calculate the offset, so the result will always be 32 bit. This can silently cause file system corruption when performing a write operation on partition larger than 4 GiB.
This patch address the issue by simply promoting the terms to 64 bit, and let compilers decide how to do the multiplication efficiently.
Signed-off-by: Ma Haijun <mahaijuns@gmail.com>
show more ...
|