@@ -158,7 +158,6 @@ struct ext4_allocation_request {
158158#define EXT4_MAP_MAPPED (1 << BH_Mapped)
159159#define EXT4_MAP_UNWRITTEN (1 << BH_Unwritten)
160160#define EXT4_MAP_BOUNDARY (1 << BH_Boundary)
161- #define EXT4_MAP_UNINIT (1 << BH_Uninit)
162161/* Sometimes (in the bigalloc case, from ext4_da_get_block_prep) the caller of
163162 * ext4_map_blocks wants to know whether or not the underlying cluster has
164163 * already been accounted for. EXT4_MAP_FROM_CLUSTER conveys to the caller that
@@ -169,7 +168,7 @@ struct ext4_allocation_request {
169168#define EXT4_MAP_FROM_CLUSTER (1 << BH_AllocFromCluster)
170169#define EXT4_MAP_FLAGS (EXT4_MAP_NEW | EXT4_MAP_MAPPED |\
171170 EXT4_MAP_UNWRITTEN | EXT4_MAP_BOUNDARY |\
172- EXT4_MAP_UNINIT | EXT4_MAP_FROM_CLUSTER)
171+ EXT4_MAP_FROM_CLUSTER)
173172
174173struct ext4_map_blocks {
175174 ext4_fsblk_t m_pblk ;
@@ -184,7 +183,7 @@ struct ext4_map_blocks {
184183#define EXT4_IO_END_UNWRITTEN 0x0001
185184
186185/*
187- * For converting uninitialized extents on a work queue. 'handle' is used for
186+ * For converting unwritten extents on a work queue. 'handle' is used for
188187 * buffered writeback.
189188 */
190189typedef struct ext4_io_end {
@@ -537,26 +536,26 @@ enum {
537536/*
538537 * Flags used by ext4_map_blocks()
539538 */
540- /* Allocate any needed blocks and/or convert an unitialized
539+ /* Allocate any needed blocks and/or convert an unwritten
541540 extent to be an initialized ext4 */
542541#define EXT4_GET_BLOCKS_CREATE 0x0001
543- /* Request the creation of an unitialized extent */
544- #define EXT4_GET_BLOCKS_UNINIT_EXT 0x0002
545- #define EXT4_GET_BLOCKS_CREATE_UNINIT_EXT (EXT4_GET_BLOCKS_UNINIT_EXT |\
542+ /* Request the creation of an unwritten extent */
543+ #define EXT4_GET_BLOCKS_UNWRIT_EXT 0x0002
544+ #define EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT (EXT4_GET_BLOCKS_UNWRIT_EXT |\
546545 EXT4_GET_BLOCKS_CREATE)
547546 /* Caller is from the delayed allocation writeout path
548547 * finally doing the actual allocation of delayed blocks */
549548#define EXT4_GET_BLOCKS_DELALLOC_RESERVE 0x0004
550549 /* caller is from the direct IO path, request to creation of an
551- unitialized extents if not allocated, split the uninitialized
550+ unwritten extents if not allocated, split the unwritten
552551 extent if blocks has been preallocated already*/
553552#define EXT4_GET_BLOCKS_PRE_IO 0x0008
554553#define EXT4_GET_BLOCKS_CONVERT 0x0010
555554#define EXT4_GET_BLOCKS_IO_CREATE_EXT (EXT4_GET_BLOCKS_PRE_IO|\
556- EXT4_GET_BLOCKS_CREATE_UNINIT_EXT )
555+ EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT )
557556 /* Convert extent to initialized after IO complete */
558557#define EXT4_GET_BLOCKS_IO_CONVERT_EXT (EXT4_GET_BLOCKS_CONVERT|\
559- EXT4_GET_BLOCKS_CREATE_UNINIT_EXT )
558+ EXT4_GET_BLOCKS_CREATE_UNWRIT_EXT )
560559 /* Eventual metadata allocation (due to growing extent tree)
561560 * should not fail, so try to use reserved blocks for that.*/
562561#define EXT4_GET_BLOCKS_METADATA_NOFAIL 0x0020
@@ -876,6 +875,8 @@ struct ext4_inode_info {
876875 struct inode vfs_inode ;
877876 struct jbd2_inode * jinode ;
878877
878+ spinlock_t i_raw_lock ; /* protects updates to the raw inode */
879+
879880 /*
880881 * File creation time. Its function is same as that of
881882 * struct timespec i_{a,c,m}time in the generic inode.
@@ -1159,7 +1160,8 @@ struct ext4_super_block {
11591160 __le32 s_usr_quota_inum ; /* inode for tracking user quota */
11601161 __le32 s_grp_quota_inum ; /* inode for tracking group quota */
11611162 __le32 s_overhead_clusters ; /* overhead blocks/clusters in fs */
1162- __le32 s_reserved [108 ]; /* Padding to the end of the block */
1163+ __le32 s_backup_bgs [2 ]; /* groups with sparse_super2 SBs */
1164+ __le32 s_reserved [106 ]; /* Padding to the end of the block */
11631165 __le32 s_checksum ; /* crc32c(superblock) */
11641166};
11651167
@@ -1505,6 +1507,7 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
15051507#define EXT4_FEATURE_COMPAT_EXT_ATTR 0x0008
15061508#define EXT4_FEATURE_COMPAT_RESIZE_INODE 0x0010
15071509#define EXT4_FEATURE_COMPAT_DIR_INDEX 0x0020
1510+ #define EXT4_FEATURE_COMPAT_SPARSE_SUPER2 0x0200
15081511
15091512#define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
15101513#define EXT4_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
@@ -1953,10 +1956,6 @@ extern void ext4_get_group_no_and_offset(struct super_block *sb,
19531956extern ext4_group_t ext4_get_group_number (struct super_block * sb ,
19541957 ext4_fsblk_t block );
19551958
1956- extern void ext4_validate_block_bitmap (struct super_block * sb ,
1957- struct ext4_group_desc * desc ,
1958- ext4_group_t block_group ,
1959- struct buffer_head * bh );
19601959extern unsigned int ext4_block_group (struct super_block * sb ,
19611960 ext4_fsblk_t blocknr );
19621961extern ext4_grpblk_t ext4_block_group_offset (struct super_block * sb ,
@@ -1985,16 +1984,9 @@ extern int ext4_wait_block_bitmap(struct super_block *sb,
19851984 struct buffer_head * bh );
19861985extern struct buffer_head * ext4_read_block_bitmap (struct super_block * sb ,
19871986 ext4_group_t block_group );
1988- extern void ext4_init_block_bitmap (struct super_block * sb ,
1989- struct buffer_head * bh ,
1990- ext4_group_t group ,
1991- struct ext4_group_desc * desc );
19921987extern unsigned ext4_free_clusters_after_init (struct super_block * sb ,
19931988 ext4_group_t block_group ,
19941989 struct ext4_group_desc * gdp );
1995- extern unsigned ext4_num_overhead_clusters (struct super_block * sb ,
1996- ext4_group_t block_group ,
1997- struct ext4_group_desc * gdp );
19981990ext4_fsblk_t ext4_inode_to_goal_block (struct inode * );
19991991
20001992/* dir.c */
@@ -2137,8 +2129,6 @@ extern int ext4_alloc_da_blocks(struct inode *inode);
21372129extern void ext4_set_aops (struct inode * inode );
21382130extern int ext4_writepage_trans_blocks (struct inode * );
21392131extern int ext4_chunk_trans_blocks (struct inode * , int nrblocks );
2140- extern int ext4_block_truncate_page (handle_t * handle ,
2141- struct address_space * mapping , loff_t from );
21422132extern int ext4_zero_partial_blocks (handle_t * handle , struct inode * inode ,
21432133 loff_t lstart , loff_t lend );
21442134extern int ext4_page_mkwrite (struct vm_area_struct * vma , struct vm_fault * vmf );
@@ -2198,8 +2188,6 @@ extern int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count);
21982188
21992189/* super.c */
22002190extern int ext4_calculate_overhead (struct super_block * sb );
2201- extern int ext4_superblock_csum_verify (struct super_block * sb ,
2202- struct ext4_super_block * es );
22032191extern void ext4_superblock_csum_set (struct super_block * sb );
22042192extern void * ext4_kvmalloc (size_t size , gfp_t flags );
22052193extern void * ext4_kvzalloc (size_t size , gfp_t flags );
@@ -2571,19 +2559,11 @@ extern const struct file_operations ext4_dir_operations;
25712559extern const struct inode_operations ext4_file_inode_operations ;
25722560extern const struct file_operations ext4_file_operations ;
25732561extern loff_t ext4_llseek (struct file * file , loff_t offset , int origin );
2574- extern void ext4_unwritten_wait (struct inode * inode );
25752562
25762563/* inline.c */
25772564extern int ext4_has_inline_data (struct inode * inode );
2578- extern int ext4_get_inline_size (struct inode * inode );
25792565extern int ext4_get_max_inline_size (struct inode * inode );
25802566extern int ext4_find_inline_data_nolock (struct inode * inode );
2581- extern void ext4_write_inline_data (struct inode * inode ,
2582- struct ext4_iloc * iloc ,
2583- void * buffer , loff_t pos ,
2584- unsigned int len );
2585- extern int ext4_prepare_inline_data (handle_t * handle , struct inode * inode ,
2586- unsigned int len );
25872567extern int ext4_init_inline_data (handle_t * handle , struct inode * inode ,
25882568 unsigned int len );
25892569extern int ext4_destroy_inline_data (handle_t * handle , struct inode * inode );
@@ -2771,23 +2751,20 @@ extern void ext4_io_submit(struct ext4_io_submit *io);
27712751extern int ext4_bio_write_page (struct ext4_io_submit * io ,
27722752 struct page * page ,
27732753 int len ,
2774- struct writeback_control * wbc );
2754+ struct writeback_control * wbc ,
2755+ bool keep_towrite );
27752756
27762757/* mmp.c */
27772758extern int ext4_multi_mount_protect (struct super_block * , ext4_fsblk_t );
2778- extern void ext4_mmp_csum_set (struct super_block * sb , struct mmp_struct * mmp );
2779- extern int ext4_mmp_csum_verify (struct super_block * sb ,
2780- struct mmp_struct * mmp );
27812759
27822760/*
27832761 * Note that these flags will never ever appear in a buffer_head's state flag.
27842762 * See EXT4_MAP_... to see where this is used.
27852763 */
27862764enum ext4_state_bits {
2787- BH_Uninit /* blocks are allocated but uninitialized on disk */
2788- = BH_JBDPrivateStart ,
2789- BH_AllocFromCluster , /* allocated blocks were part of already
2765+ BH_AllocFromCluster /* allocated blocks were part of already
27902766 * allocated cluster. */
2767+ = BH_JBDPrivateStart
27912768};
27922769
27932770/*
0 commit comments