mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH 5/7] ext4: Update ext2/3/4 superblock, group descriptor and inode structures
Date: Mon, 20 Mar 2017 15:35:30 +0300	[thread overview]
Message-ID: <20170320123532.24059-6-antonynpavlov@gmail.com> (raw)
In-Reply-To: <20170320123532.24059-1-antonynpavlov@gmail.com>

This is an adoption of the U-Boot commit

| commit 3ee2f977f3649bcc1d0de86356145e8e6999575a
| Author: Stefan Brüns <stefan.bruens@rwth-aachen.de>
| Date:   Sat Sep 17 02:10:06 2016 +0200
|
|     ext4: Update ext2/3/4 superblock, group descriptor and inode structures
|
|     Most importantly, the superblock provides the used group descriptor size,
|     which is required for the EXT4_FEATURE_INCOMPAT_64BIT.
|
|     Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 fs/ext4/ext_common.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 46 insertions(+), 4 deletions(-)

diff --git a/fs/ext4/ext_common.h b/fs/ext4/ext_common.h
index 63cd4d26c..e82b56b86 100644
--- a/fs/ext4/ext_common.h
+++ b/fs/ext4/ext_common.h
@@ -112,6 +112,33 @@ struct ext2_sblock {
 	char volume_name[16];
 	char last_mounted_on[64];
 	__le32 compression_info;
+	uint8_t prealloc_blocks;
+	uint8_t prealloc_dir_blocks;
+	__le16 reserved_gdt_blocks;
+	uint8_t journal_uuid[16];
+	__le32 journal_inode;
+	__le32 journal_dev;
+	__le32 last_orphan;
+	__le32 hash_seed[4];
+	uint8_t default_hash_version;
+	uint8_t journal_backup_type;
+	__le16 descriptor_size;
+	__le32 default_mount_options;
+	__le32 first_meta_block_group;
+	__le32 mkfs_time;
+	__le32 journal_blocks[17];
+	__le32 total_blocks_high;
+	__le32 reserved_blocks_high;
+	__le32 free_blocks_high;
+	__le16 min_extra_inode_size;
+	__le16 want_extra_inode_size;
+	__le32 flags;
+	__le16 raid_stride;
+	__le16 mmp_interval;
+	__le64 mmp_block;
+	__le32 raid_stripe_width;
+	uint8_t log2_groups_per_flex;
+	uint8_t checksum_type;
 };
 
 struct ext2_block_group {
@@ -122,9 +149,23 @@ struct ext2_block_group {
 	__le16 free_inodes;	/* Free inodes count */
 	__le16 used_dir_cnt;	/* Directories count */
 	__le16 bg_flags;
-	__le32 bg_reserved[2];
+	__le32 bg_exclude_bitmap;
+	__le16 bg_block_id_csum;
+	__le16 bg_inode_id_csum;
 	__le16 bg_itable_unused; /* Unused inodes count */
-	__le16 bg_checksum;	/* crc16(s_uuid+grouo_num+group_desc)*/
+	__le16 bg_checksum;	/* crc16(s_uuid+group_num+group_desc)*/
+	/* following fields only exist if descriptor size is 64 */
+	__le32 block_id_high;
+	__le32 inode_id_high;
+	__le32 inode_table_id_high;
+	__le16 free_blocks_high;
+	__le16 free_inodes_high;
+	__le16 used_dir_cnt_high;
+	__le16 bg_itable_unused_high;
+	__le32 bg_exclude_bitmap_high;
+	__le16 bg_block_id_csum_high;
+	__le16 bg_inode_id_csum_high;
+	__le32 bg_reserved;
 };
 
 /* The ext2 inode. */
@@ -138,7 +179,7 @@ struct ext2_inode {
 	__le32 dtime;
 	__le16 gid;
 	__le16 nlinks;
-	__le32 blockcnt;	/* Blocks of 512 bytes!! */
+	__le32 blockcnt;	/* Blocks of either 512 or block_size bytes */
 	__le32 flags;
 	__le32 osd1;
 	union {
@@ -149,10 +190,11 @@ struct ext2_inode {
 			__le32 triple_indir_block;
 		} blocks;
 		char symlink[60];
+		char inline_data[60];
 	} b;
 	__le32 version;
 	__le32 acl;
-	__le32 dir_acl;
+	__le32 size_high;	/* previously dir_acl, but never used */
 	__le32 fragment_addr;
 	__le32 osd2[3];
 };
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2017-03-20 12:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 12:35 [PATCH 0/7] fix ext4 support for volumes greater than 4 GiB Antony Pavlov
2017-03-20 12:35 ` [PATCH 1/7] ext4: change structure fields to __le/__be types Antony Pavlov
2017-03-20 12:35 ` [PATCH 2/7] ext4: use kernel names for byte swaps Antony Pavlov
2017-03-20 12:35 ` [PATCH 3/7] ext4: drop unused and misdefined INODE_SIZE_FILESYSTEM macro Antony Pavlov
2017-03-20 12:35 ` [PATCH 4/7] ext4: fix wrong usage of le32_to_cpu() Antony Pavlov
2017-03-20 12:35 ` Antony Pavlov [this message]
2017-03-20 12:35 ` [PATCH 6/7] ext4: determine group descriptor size for 64bit feature Antony Pavlov
2017-03-20 12:35 ` [PATCH 7/7] ext4: Use correct descriptor size when reading the block group descriptor Antony Pavlov
2017-03-22  6:57 ` [PATCH 0/7] fix ext4 support for volumes greater than 4 GiB Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170320123532.24059-6-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox