diff options
author | Egbert Eich <eich@suse.com> | 2013-05-01 01:13:19 +0000 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2013-05-10 08:16:33 -0400 |
commit | 50ce4c07df1c98aabf4630b35152ed95a87242f7 (patch) | |
tree | c7e506ab5bcb2839a697cb0a89faa3244077cf69 /include | |
parent | b1e6c4c3d4a2b394096766d959aaa9b51a38099b (diff) | |
download | u-boot-50ce4c07df1c98aabf4630b35152ed95a87242f7.tar.gz |
fs/ext4: Support device block sizes != 512 bytes
The 512 byte block size was hard coded in the ext4 file systems.
Large harddisks today support bigger block sizes typically 4096
bytes.
This patch removes this limitation.
Signed-off-by: Egbert Eich <eich@suse.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/ext4fs.h | 1 | ||||
-rw-r--r-- | include/ext_common.h | 12 |
2 files changed, 4 insertions, 9 deletions
diff --git a/include/ext4fs.h b/include/ext4fs.h index 025a2e89c2..379f7eb5e9 100644 --- a/include/ext4fs.h +++ b/include/ext4fs.h @@ -141,4 +141,5 @@ long int read_allocated_block(struct ext2_inode *inode, int fileblock); int ext4fs_probe(block_dev_desc_t *fs_dev_desc, disk_partition_t *fs_partition); int ext4_read_file(const char *filename, void *buf, int offset, int len); +int ext4_read_superblock(char *buffer); #endif diff --git a/include/ext_common.h b/include/ext_common.h index 86373a6e50..78a7808aa9 100644 --- a/include/ext_common.h +++ b/include/ext_common.h @@ -34,7 +34,6 @@ #define __EXT_COMMON__ #include <command.h> #define SECTOR_SIZE 0x200 -#define SECTOR_BITS 9 /* Magic value used to identify an ext2 filesystem. */ #define EXT2_MAGIC 0xEF53 @@ -58,18 +57,13 @@ #define FILETYPE_INO_SYMLINK 0120000 #define EXT2_ROOT_INO 2 /* Root inode */ -/* Bits used as offset in sector */ -#define DISK_SECTOR_BITS 9 /* The size of an ext2 block in bytes. */ #define EXT2_BLOCK_SIZE(data) (1 << LOG2_BLOCK_SIZE(data)) -/* Log2 size of ext2 block in 512 blocks. */ -#define LOG2_EXT2_BLOCK_SIZE(data) (__le32_to_cpu \ - (data->sblock.log2_block_size) + 1) - /* Log2 size of ext2 block in bytes. */ -#define LOG2_BLOCK_SIZE(data) (__le32_to_cpu \ - (data->sblock.log2_block_size) + 10) +#define LOG2_BLOCK_SIZE(data) (__le32_to_cpu \ + (data->sblock.log2_block_size) \ + + EXT2_MIN_BLOCK_LOG_SIZE) #define INODE_SIZE_FILESYSTEM(data) (__le32_to_cpu \ (data->sblock.inode_size)) |