diff options
author | Petros Koutoupis <petros@petroskoutoupis.com> | 2018-01-07 23:36:19 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2018-01-07 23:36:19 -0500 |
commit | e7093f0d6371cefb4934c8f98847a56cb854e4a9 (patch) | |
tree | 89ec09e566e06d81ccc61bfa1a567980f5397f80 | |
parent | 22446423108f3687167c9fdc080e6f21dd784d18 (diff) |
ext4: fixed alignment and minor code cleanup in ext4.h
Signed-off-by: Petros Koutoupis <petros@petroskoutoupis.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | fs/ext4/ext4.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 891d7636a9d0..3241475a1733 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -611,10 +611,10 @@ enum { | |||
611 | /* | 611 | /* |
612 | * Flags used by ext4_free_blocks | 612 | * Flags used by ext4_free_blocks |
613 | */ | 613 | */ |
614 | #define EXT4_FREE_BLOCKS_METADATA 0x0001 | 614 | #define EXT4_FREE_BLOCKS_METADATA 0x0001 |
615 | #define EXT4_FREE_BLOCKS_FORGET 0x0002 | 615 | #define EXT4_FREE_BLOCKS_FORGET 0x0002 |
616 | #define EXT4_FREE_BLOCKS_VALIDATED 0x0004 | 616 | #define EXT4_FREE_BLOCKS_VALIDATED 0x0004 |
617 | #define EXT4_FREE_BLOCKS_NO_QUOT_UPDATE 0x0008 | 617 | #define EXT4_FREE_BLOCKS_NO_QUOT_UPDATE 0x0008 |
618 | #define EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER 0x0010 | 618 | #define EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER 0x0010 |
619 | #define EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER 0x0020 | 619 | #define EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER 0x0020 |
620 | 620 | ||
@@ -1986,10 +1986,10 @@ static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize) | |||
1986 | 1986 | ||
1987 | /* Legal values for the dx_root hash_version field: */ | 1987 | /* Legal values for the dx_root hash_version field: */ |
1988 | 1988 | ||
1989 | #define DX_HASH_LEGACY 0 | 1989 | #define DX_HASH_LEGACY 0 |
1990 | #define DX_HASH_HALF_MD4 1 | 1990 | #define DX_HASH_HALF_MD4 1 |
1991 | #define DX_HASH_TEA 2 | 1991 | #define DX_HASH_TEA 2 |
1992 | #define DX_HASH_LEGACY_UNSIGNED 3 | 1992 | #define DX_HASH_LEGACY_UNSIGNED 3 |
1993 | #define DX_HASH_HALF_MD4_UNSIGNED 4 | 1993 | #define DX_HASH_HALF_MD4_UNSIGNED 4 |
1994 | #define DX_HASH_TEA_UNSIGNED 5 | 1994 | #define DX_HASH_TEA_UNSIGNED 5 |
1995 | 1995 | ||
@@ -2000,7 +2000,6 @@ static inline u32 ext4_chksum(struct ext4_sb_info *sbi, u32 crc, | |||
2000 | struct shash_desc shash; | 2000 | struct shash_desc shash; |
2001 | char ctx[4]; | 2001 | char ctx[4]; |
2002 | } desc; | 2002 | } desc; |
2003 | int err; | ||
2004 | 2003 | ||
2005 | BUG_ON(crypto_shash_descsize(sbi->s_chksum_driver)!=sizeof(desc.ctx)); | 2004 | BUG_ON(crypto_shash_descsize(sbi->s_chksum_driver)!=sizeof(desc.ctx)); |
2006 | 2005 | ||
@@ -2008,8 +2007,7 @@ static inline u32 ext4_chksum(struct ext4_sb_info *sbi, u32 crc, | |||
2008 | desc.shash.flags = 0; | 2007 | desc.shash.flags = 0; |
2009 | *(u32 *)desc.ctx = crc; | 2008 | *(u32 *)desc.ctx = crc; |
2010 | 2009 | ||
2011 | err = crypto_shash_update(&desc.shash, address, length); | 2010 | BUG_ON(crypto_shash_update(&desc.shash, address, length)); |
2012 | BUG_ON(err); | ||
2013 | 2011 | ||
2014 | return *(u32 *)desc.ctx; | 2012 | return *(u32 *)desc.ctx; |
2015 | } | 2013 | } |