diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-01 13:12:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-06-01 13:12:15 -0400 |
commit | 4edebed86690eb8db9af3ab85baf4a34e73266cc (patch) | |
tree | 8ab144b08f490f239fa62be52470860c9311664d /fs/ext4/ext4_extents.h | |
parent | 51eab603f5c86dd1eae4c525df3e7f7eeab401d6 (diff) | |
parent | 5e44f8c374dc4f8eadf61cd18b2c0d46bc87c1b7 (diff) |
Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull Ext4 updates from Theodore Ts'o:
"The major new feature added in this update is Darrick J Wong's
metadata checksum feature, which adds crc32 checksums to ext4's
metadata fields.
There is also the usual set of cleanups and bug fixes."
* tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (44 commits)
ext4: hole-punch use truncate_pagecache_range
jbd2: use kmem_cache_zalloc wrapper instead of flag
ext4: remove mb_groups before tearing down the buddy_cache
ext4: add ext4_mb_unload_buddy in the error path
ext4: don't trash state flags in EXT4_IOC_SETFLAGS
ext4: let getattr report the right blocks in delalloc+bigalloc
ext4: add missing save_error_info() to ext4_error()
ext4: add debugging trigger for ext4_error()
ext4: protect group inode free counting with group lock
ext4: use consistent ssize_t type in ext4_file_write()
ext4: fix format flag in ext4_ext_binsearch_idx()
ext4: cleanup in ext4_discard_allocated_blocks()
ext4: return ENOMEM when mounts fail due to lack of memory
ext4: remove redundundant "(char *) bh->b_data" casts
ext4: disallow hard-linked directory in ext4_lookup
ext4: fix potential integer overflow in alloc_flex_gd()
ext4: remove needs_recovery in ext4_mb_init()
ext4: force ro mount if ext4_setup_super() fails
ext4: fix potential NULL dereference in ext4_free_inodes_counts()
ext4/jbd2: add metadata checksumming to the list of supported features
...
Diffstat (limited to 'fs/ext4/ext4_extents.h')
-rw-r--r-- | fs/ext4/ext4_extents.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/ext4/ext4_extents.h b/fs/ext4/ext4_extents.h index 0f58b86e3a02..cb1b2c919963 100644 --- a/fs/ext4/ext4_extents.h +++ b/fs/ext4/ext4_extents.h | |||
@@ -63,9 +63,22 @@ | |||
63 | * ext4_inode has i_block array (60 bytes total). | 63 | * ext4_inode has i_block array (60 bytes total). |
64 | * The first 12 bytes store ext4_extent_header; | 64 | * The first 12 bytes store ext4_extent_header; |
65 | * the remainder stores an array of ext4_extent. | 65 | * the remainder stores an array of ext4_extent. |
66 | * For non-inode extent blocks, ext4_extent_tail | ||
67 | * follows the array. | ||
66 | */ | 68 | */ |
67 | 69 | ||
68 | /* | 70 | /* |
71 | * This is the extent tail on-disk structure. | ||
72 | * All other extent structures are 12 bytes long. It turns out that | ||
73 | * block_size % 12 >= 4 for at least all powers of 2 greater than 512, which | ||
74 | * covers all valid ext4 block sizes. Therefore, this tail structure can be | ||
75 | * crammed into the end of the block without having to rebalance the tree. | ||
76 | */ | ||
77 | struct ext4_extent_tail { | ||
78 | __le32 et_checksum; /* crc32c(uuid+inum+extent_block) */ | ||
79 | }; | ||
80 | |||
81 | /* | ||
69 | * This is the extent on-disk structure. | 82 | * This is the extent on-disk structure. |
70 | * It's used at the bottom of the tree. | 83 | * It's used at the bottom of the tree. |
71 | */ | 84 | */ |
@@ -101,6 +114,17 @@ struct ext4_extent_header { | |||
101 | 114 | ||
102 | #define EXT4_EXT_MAGIC cpu_to_le16(0xf30a) | 115 | #define EXT4_EXT_MAGIC cpu_to_le16(0xf30a) |
103 | 116 | ||
117 | #define EXT4_EXTENT_TAIL_OFFSET(hdr) \ | ||
118 | (sizeof(struct ext4_extent_header) + \ | ||
119 | (sizeof(struct ext4_extent) * le16_to_cpu((hdr)->eh_max))) | ||
120 | |||
121 | static inline struct ext4_extent_tail * | ||
122 | find_ext4_extent_tail(struct ext4_extent_header *eh) | ||
123 | { | ||
124 | return (struct ext4_extent_tail *)(((void *)eh) + | ||
125 | EXT4_EXTENT_TAIL_OFFSET(eh)); | ||
126 | } | ||
127 | |||
104 | /* | 128 | /* |
105 | * Array of ext4_ext_path contains path to some extent. | 129 | * Array of ext4_ext_path contains path to some extent. |
106 | * Creation/lookup routines use it for traversal/splitting/etc. | 130 | * Creation/lookup routines use it for traversal/splitting/etc. |