aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index cfc4e01b3c83..c3411d4ce2da 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -571,6 +571,8 @@ enum {
571#define EXT4_GET_BLOCKS_NO_NORMALIZE 0x0040 571#define EXT4_GET_BLOCKS_NO_NORMALIZE 0x0040
572 /* Request will not result in inode size update (user for fallocate) */ 572 /* Request will not result in inode size update (user for fallocate) */
573#define EXT4_GET_BLOCKS_KEEP_SIZE 0x0080 573#define EXT4_GET_BLOCKS_KEEP_SIZE 0x0080
574 /* Do not take i_data_sem locking in ext4_map_blocks */
575#define EXT4_GET_BLOCKS_NO_LOCK 0x0100
574 576
575/* 577/*
576 * Flags used by ext4_free_blocks 578 * Flags used by ext4_free_blocks
@@ -1161,8 +1163,7 @@ struct ext4_sb_info {
1161 unsigned long s_desc_per_block; /* Number of group descriptors per block */ 1163 unsigned long s_desc_per_block; /* Number of group descriptors per block */
1162 ext4_group_t s_groups_count; /* Number of groups in the fs */ 1164 ext4_group_t s_groups_count; /* Number of groups in the fs */
1163 ext4_group_t s_blockfile_groups;/* Groups acceptable for non-extent files */ 1165 ext4_group_t s_blockfile_groups;/* Groups acceptable for non-extent files */
1164 unsigned long s_overhead_last; /* Last calculated overhead */ 1166 unsigned long s_overhead; /* # of fs overhead clusters */
1165 unsigned long s_blocks_last; /* Last seen block count */
1166 unsigned int s_cluster_ratio; /* Number of blocks per cluster */ 1167 unsigned int s_cluster_ratio; /* Number of blocks per cluster */
1167 unsigned int s_cluster_bits; /* log2 of s_cluster_ratio */ 1168 unsigned int s_cluster_bits; /* log2 of s_cluster_ratio */
1168 loff_t s_bitmap_maxbytes; /* max bytes for bitmap files */ 1169 loff_t s_bitmap_maxbytes; /* max bytes for bitmap files */
@@ -1314,6 +1315,8 @@ static inline struct timespec ext4_current_time(struct inode *inode)
1314static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) 1315static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
1315{ 1316{
1316 return ino == EXT4_ROOT_INO || 1317 return ino == EXT4_ROOT_INO ||
1318 ino == EXT4_USR_QUOTA_INO ||
1319 ino == EXT4_GRP_QUOTA_INO ||
1317 ino == EXT4_JOURNAL_INO || 1320 ino == EXT4_JOURNAL_INO ||
1318 ino == EXT4_RESIZE_INO || 1321 ino == EXT4_RESIZE_INO ||
1319 (ino >= EXT4_FIRST_INO(sb) && 1322 (ino >= EXT4_FIRST_INO(sb) &&
@@ -1496,7 +1499,8 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
1496 EXT4_FEATURE_RO_COMPAT_BTREE_DIR |\ 1499 EXT4_FEATURE_RO_COMPAT_BTREE_DIR |\
1497 EXT4_FEATURE_RO_COMPAT_HUGE_FILE |\ 1500 EXT4_FEATURE_RO_COMPAT_HUGE_FILE |\
1498 EXT4_FEATURE_RO_COMPAT_BIGALLOC |\ 1501 EXT4_FEATURE_RO_COMPAT_BIGALLOC |\
1499 EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) 1502 EXT4_FEATURE_RO_COMPAT_METADATA_CSUM|\
1503 EXT4_FEATURE_RO_COMPAT_QUOTA)
1500 1504
1501/* 1505/*
1502 * Default values for user and/or group using reserved blocks 1506 * Default values for user and/or group using reserved blocks
@@ -1663,10 +1667,12 @@ static inline u32 ext4_chksum(struct ext4_sb_info *sbi, u32 crc,
1663{ 1667{
1664 struct { 1668 struct {
1665 struct shash_desc shash; 1669 struct shash_desc shash;
1666 char ctx[crypto_shash_descsize(sbi->s_chksum_driver)]; 1670 char ctx[4];
1667 } desc; 1671 } desc;
1668 int err; 1672 int err;
1669 1673
1674 BUG_ON(crypto_shash_descsize(sbi->s_chksum_driver)!=sizeof(desc.ctx));
1675
1670 desc.shash.tfm = sbi->s_chksum_driver; 1676 desc.shash.tfm = sbi->s_chksum_driver;
1671 desc.shash.flags = 0; 1677 desc.shash.flags = 0;
1672 *(u32 *)desc.ctx = crc; 1678 *(u32 *)desc.ctx = crc;
@@ -1852,7 +1858,7 @@ struct mmpd_data {
1852# define NORET_AND noreturn, 1858# define NORET_AND noreturn,
1853 1859
1854/* bitmap.c */ 1860/* bitmap.c */
1855extern unsigned int ext4_count_free(struct buffer_head *, unsigned); 1861extern unsigned int ext4_count_free(char *bitmap, unsigned numchars);
1856void ext4_inode_bitmap_csum_set(struct super_block *sb, ext4_group_t group, 1862void ext4_inode_bitmap_csum_set(struct super_block *sb, ext4_group_t group,
1857 struct ext4_group_desc *gdp, 1863 struct ext4_group_desc *gdp,
1858 struct buffer_head *bh, int sz); 1864 struct buffer_head *bh, int sz);
@@ -2037,6 +2043,7 @@ extern int ext4_group_extend(struct super_block *sb,
2037extern int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count); 2043extern int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count);
2038 2044
2039/* super.c */ 2045/* super.c */
2046extern int ext4_calculate_overhead(struct super_block *sb);
2040extern int ext4_superblock_csum_verify(struct super_block *sb, 2047extern int ext4_superblock_csum_verify(struct super_block *sb,
2041 struct ext4_super_block *es); 2048 struct ext4_super_block *es);
2042extern void ext4_superblock_csum_set(struct super_block *sb, 2049extern void ext4_superblock_csum_set(struct super_block *sb,
@@ -2321,15 +2328,6 @@ static inline void ext4_unlock_group(struct super_block *sb,
2321 spin_unlock(ext4_group_lock_ptr(sb, group)); 2328 spin_unlock(ext4_group_lock_ptr(sb, group));
2322} 2329}
2323 2330
2324static inline void ext4_mark_super_dirty(struct super_block *sb)
2325{
2326 struct ext4_super_block *es = EXT4_SB(sb)->s_es;
2327
2328 ext4_superblock_csum_set(sb, es);
2329 if (EXT4_SB(sb)->s_journal == NULL)
2330 sb->s_dirt =1;
2331}
2332
2333/* 2331/*
2334 * Block validity checking 2332 * Block validity checking
2335 */ 2333 */