summaryrefslogtreecommitdiffstats
path: root/include/ext_common.h
diff options
context:
space:
mode:
authorEgbert Eich <eich@suse.com>2013-05-01 01:13:19 +0000
committerTom Rini <trini@ti.com>2013-05-10 08:16:33 -0400
commit50ce4c07df1c98aabf4630b35152ed95a87242f7 (patch)
treec7e506ab5bcb2839a697cb0a89faa3244077cf69 /include/ext_common.h
parentb1e6c4c3d4a2b394096766d959aaa9b51a38099b (diff)
downloadtalos-obmc-uboot-50ce4c07df1c98aabf4630b35152ed95a87242f7.tar.gz
talos-obmc-uboot-50ce4c07df1c98aabf4630b35152ed95a87242f7.zip
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/ext_common.h')
-rw-r--r--include/ext_common.h12
1 files changed, 3 insertions, 9 deletions
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))
OpenPOWER on IntegriCloud