diff options
-rw-r--r-- | fs/ext4/ext4_common.c | 2 | ||||
-rw-r--r-- | fs/ext4/ext4_write.c | 2 | ||||
-rw-r--r-- | include/ext_common.h | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c index 464c33d0d74..8a142e2e6a1 100644 --- a/fs/ext4/ext4_common.c +++ b/fs/ext4/ext4_common.c @@ -570,7 +570,7 @@ restart_read: g_parent_inode->size = cpu_to_le32(new_size); new_blockcnt = le32_to_cpu(g_parent_inode->blockcnt); - new_blockcnt += fs->sect_perblk; + new_blockcnt += fs->blksz >> LOG2_SECTOR_SIZE; g_parent_inode->blockcnt = cpu_to_le32(new_blockcnt); if (ext4fs_put_metadata diff --git a/fs/ext4/ext4_write.c b/fs/ext4/ext4_write.c index 504d23a8956..3368bd8c005 100644 --- a/fs/ext4/ext4_write.c +++ b/fs/ext4/ext4_write.c @@ -957,7 +957,7 @@ int ext4fs_write(const char *fname, const char *buffer, ext4fs_allocate_blocks(file_inode, blocks_remaining, &blks_reqd_for_file); file_inode->blockcnt = cpu_to_le32((blks_reqd_for_file * fs->blksz) >> - fs->dev_desc->log2blksz); + LOG2_SECTOR_SIZE); temp_ptr = zalloc(fs->blksz); if (!temp_ptr) diff --git a/include/ext_common.h b/include/ext_common.h index 17c92f1750b..1c10c504748 100644 --- a/include/ext_common.h +++ b/include/ext_common.h @@ -21,6 +21,7 @@ #define __EXT_COMMON__ #include <command.h> #define SECTOR_SIZE 0x200 +#define LOG2_SECTOR_SIZE 9 /* Magic value used to identify an ext2 filesystem. */ #define EXT2_MAGIC 0xEF53 |