@@ -158,7 +158,6 @@ struct ext4_allocation_request {
158
158
#define EXT4_MAP_MAPPED (1 << BH_Mapped)
159
159
#define EXT4_MAP_UNWRITTEN (1 << BH_Unwritten)
160
160
#define EXT4_MAP_BOUNDARY (1 << BH_Boundary)
161
- #define EXT4_MAP_UNINIT (1 << BH_Uninit)
162
161
/* Sometimes (in the bigalloc case, from ext4_da_get_block_prep) the caller of
163
162
* ext4_map_blocks wants to know whether or not the underlying cluster has
164
163
* already been accounted for. EXT4_MAP_FROM_CLUSTER conveys to the caller that
@@ -169,7 +168,7 @@ struct ext4_allocation_request {
169
168
#define EXT4_MAP_FROM_CLUSTER (1 << BH_AllocFromCluster)
170
169
#define EXT4_MAP_FLAGS (EXT4_MAP_NEW | EXT4_MAP_MAPPED |\
171
170
EXT4_MAP_UNWRITTEN | EXT4_MAP_BOUNDARY |\
172
- EXT4_MAP_UNINIT | EXT4_MAP_FROM_CLUSTER)
171
+ EXT4_MAP_FROM_CLUSTER)
173
172
174
173
struct ext4_map_blocks {
175
174
ext4_fsblk_t m_pblk ;
@@ -184,7 +183,7 @@ struct ext4_map_blocks {
184
183
#define EXT4_IO_END_UNWRITTEN 0x0001
185
184
186
185
/*
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
188
187
* buffered writeback.
189
188
*/
190
189
typedef struct ext4_io_end {
@@ -537,26 +536,26 @@ enum {
537
536
/*
538
537
* Flags used by ext4_map_blocks()
539
538
*/
540
- /* Allocate any needed blocks and/or convert an unitialized
539
+ /* Allocate any needed blocks and/or convert an unwritten
541
540
extent to be an initialized ext4 */
542
541
#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 |\
546
545
EXT4_GET_BLOCKS_CREATE)
547
546
/* Caller is from the delayed allocation writeout path
548
547
* finally doing the actual allocation of delayed blocks */
549
548
#define EXT4_GET_BLOCKS_DELALLOC_RESERVE 0x0004
550
549
/* 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
552
551
extent if blocks has been preallocated already*/
553
552
#define EXT4_GET_BLOCKS_PRE_IO 0x0008
554
553
#define EXT4_GET_BLOCKS_CONVERT 0x0010
555
554
#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 )
557
556
/* Convert extent to initialized after IO complete */
558
557
#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 )
560
559
/* Eventual metadata allocation (due to growing extent tree)
561
560
* should not fail, so try to use reserved blocks for that.*/
562
561
#define EXT4_GET_BLOCKS_METADATA_NOFAIL 0x0020
@@ -876,6 +875,8 @@ struct ext4_inode_info {
876
875
struct inode vfs_inode ;
877
876
struct jbd2_inode * jinode ;
878
877
878
+ spinlock_t i_raw_lock ; /* protects updates to the raw inode */
879
+
879
880
/*
880
881
* File creation time. Its function is same as that of
881
882
* struct timespec i_{a,c,m}time in the generic inode.
@@ -1159,7 +1160,8 @@ struct ext4_super_block {
1159
1160
__le32 s_usr_quota_inum ; /* inode for tracking user quota */
1160
1161
__le32 s_grp_quota_inum ; /* inode for tracking group quota */
1161
1162
__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 */
1163
1165
__le32 s_checksum ; /* crc32c(superblock) */
1164
1166
};
1165
1167
@@ -1505,6 +1507,7 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
1505
1507
#define EXT4_FEATURE_COMPAT_EXT_ATTR 0x0008
1506
1508
#define EXT4_FEATURE_COMPAT_RESIZE_INODE 0x0010
1507
1509
#define EXT4_FEATURE_COMPAT_DIR_INDEX 0x0020
1510
+ #define EXT4_FEATURE_COMPAT_SPARSE_SUPER2 0x0200
1508
1511
1509
1512
#define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
1510
1513
#define EXT4_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
@@ -1953,10 +1956,6 @@ extern void ext4_get_group_no_and_offset(struct super_block *sb,
1953
1956
extern ext4_group_t ext4_get_group_number (struct super_block * sb ,
1954
1957
ext4_fsblk_t block );
1955
1958
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 );
1960
1959
extern unsigned int ext4_block_group (struct super_block * sb ,
1961
1960
ext4_fsblk_t blocknr );
1962
1961
extern 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,
1985
1984
struct buffer_head * bh );
1986
1985
extern struct buffer_head * ext4_read_block_bitmap (struct super_block * sb ,
1987
1986
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 );
1992
1987
extern unsigned ext4_free_clusters_after_init (struct super_block * sb ,
1993
1988
ext4_group_t block_group ,
1994
1989
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 );
1998
1990
ext4_fsblk_t ext4_inode_to_goal_block (struct inode * );
1999
1991
2000
1992
/* dir.c */
@@ -2137,8 +2129,6 @@ extern int ext4_alloc_da_blocks(struct inode *inode);
2137
2129
extern void ext4_set_aops (struct inode * inode );
2138
2130
extern int ext4_writepage_trans_blocks (struct inode * );
2139
2131
extern 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 );
2142
2132
extern int ext4_zero_partial_blocks (handle_t * handle , struct inode * inode ,
2143
2133
loff_t lstart , loff_t lend );
2144
2134
extern 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);
2198
2188
2199
2189
/* super.c */
2200
2190
extern 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 );
2203
2191
extern void ext4_superblock_csum_set (struct super_block * sb );
2204
2192
extern void * ext4_kvmalloc (size_t size , gfp_t flags );
2205
2193
extern void * ext4_kvzalloc (size_t size , gfp_t flags );
@@ -2571,19 +2559,11 @@ extern const struct file_operations ext4_dir_operations;
2571
2559
extern const struct inode_operations ext4_file_inode_operations ;
2572
2560
extern const struct file_operations ext4_file_operations ;
2573
2561
extern loff_t ext4_llseek (struct file * file , loff_t offset , int origin );
2574
- extern void ext4_unwritten_wait (struct inode * inode );
2575
2562
2576
2563
/* inline.c */
2577
2564
extern int ext4_has_inline_data (struct inode * inode );
2578
- extern int ext4_get_inline_size (struct inode * inode );
2579
2565
extern int ext4_get_max_inline_size (struct inode * inode );
2580
2566
extern 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 );
2587
2567
extern int ext4_init_inline_data (handle_t * handle , struct inode * inode ,
2588
2568
unsigned int len );
2589
2569
extern 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);
2771
2751
extern int ext4_bio_write_page (struct ext4_io_submit * io ,
2772
2752
struct page * page ,
2773
2753
int len ,
2774
- struct writeback_control * wbc );
2754
+ struct writeback_control * wbc ,
2755
+ bool keep_towrite );
2775
2756
2776
2757
/* mmp.c */
2777
2758
extern 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 );
2781
2759
2782
2760
/*
2783
2761
* Note that these flags will never ever appear in a buffer_head's state flag.
2784
2762
* See EXT4_MAP_... to see where this is used.
2785
2763
*/
2786
2764
enum 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
2790
2766
* allocated cluster. */
2767
+ = BH_JBDPrivateStart
2791
2768
};
2792
2769
2793
2770
/*
0 commit comments