diff options
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 189 |
1 files changed, 123 insertions, 66 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 5aae3d12d400..b577e45425b0 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -177,38 +177,28 @@ struct ext4_map_blocks { | |||
177 | }; | 177 | }; |
178 | 178 | ||
179 | /* | 179 | /* |
180 | * For delayed allocation tracking | ||
181 | */ | ||
182 | struct mpage_da_data { | ||
183 | struct inode *inode; | ||
184 | sector_t b_blocknr; /* start block number of extent */ | ||
185 | size_t b_size; /* size of extent */ | ||
186 | unsigned long b_state; /* state of the extent */ | ||
187 | unsigned long first_page, next_page; /* extent of pages */ | ||
188 | struct writeback_control *wbc; | ||
189 | int io_done; | ||
190 | int pages_written; | ||
191 | int retval; | ||
192 | }; | ||
193 | |||
194 | /* | ||
195 | * Flags for ext4_io_end->flags | 180 | * Flags for ext4_io_end->flags |
196 | */ | 181 | */ |
197 | #define EXT4_IO_END_UNWRITTEN 0x0001 | 182 | #define EXT4_IO_END_UNWRITTEN 0x0001 |
198 | #define EXT4_IO_END_ERROR 0x0002 | 183 | #define EXT4_IO_END_DIRECT 0x0002 |
199 | #define EXT4_IO_END_DIRECT 0x0004 | ||
200 | 184 | ||
201 | /* | 185 | /* |
202 | * For converting uninitialized extents on a work queue. | 186 | * For converting uninitialized extents on a work queue. 'handle' is used for |
187 | * buffered writeback. | ||
203 | */ | 188 | */ |
204 | typedef struct ext4_io_end { | 189 | typedef struct ext4_io_end { |
205 | struct list_head list; /* per-file finished IO list */ | 190 | struct list_head list; /* per-file finished IO list */ |
191 | handle_t *handle; /* handle reserved for extent | ||
192 | * conversion */ | ||
206 | struct inode *inode; /* file being written to */ | 193 | struct inode *inode; /* file being written to */ |
194 | struct bio *bio; /* Linked list of completed | ||
195 | * bios covering the extent */ | ||
207 | unsigned int flag; /* unwritten or not */ | 196 | unsigned int flag; /* unwritten or not */ |
208 | loff_t offset; /* offset in the file */ | 197 | loff_t offset; /* offset in the file */ |
209 | ssize_t size; /* size of the extent */ | 198 | ssize_t size; /* size of the extent */ |
210 | struct kiocb *iocb; /* iocb struct for AIO */ | 199 | struct kiocb *iocb; /* iocb struct for AIO */ |
211 | int result; /* error value for AIO */ | 200 | int result; /* error value for AIO */ |
201 | atomic_t count; /* reference counter */ | ||
212 | } ext4_io_end_t; | 202 | } ext4_io_end_t; |
213 | 203 | ||
214 | struct ext4_io_submit { | 204 | struct ext4_io_submit { |
@@ -581,11 +571,6 @@ enum { | |||
581 | #define EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER 0x0020 | 571 | #define EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER 0x0020 |
582 | 572 | ||
583 | /* | 573 | /* |
584 | * Flags used by ext4_discard_partial_page_buffers | ||
585 | */ | ||
586 | #define EXT4_DISCARD_PARTIAL_PG_ZERO_UNMAPPED 0x0001 | ||
587 | |||
588 | /* | ||
589 | * ioctl commands | 574 | * ioctl commands |
590 | */ | 575 | */ |
591 | #define EXT4_IOC_GETFLAGS FS_IOC_GETFLAGS | 576 | #define EXT4_IOC_GETFLAGS FS_IOC_GETFLAGS |
@@ -879,6 +864,7 @@ struct ext4_inode_info { | |||
879 | rwlock_t i_es_lock; | 864 | rwlock_t i_es_lock; |
880 | struct list_head i_es_lru; | 865 | struct list_head i_es_lru; |
881 | unsigned int i_es_lru_nr; /* protected by i_es_lock */ | 866 | unsigned int i_es_lru_nr; /* protected by i_es_lock */ |
867 | unsigned long i_touch_when; /* jiffies of last accessing */ | ||
882 | 868 | ||
883 | /* ialloc */ | 869 | /* ialloc */ |
884 | ext4_group_t i_last_alloc_group; | 870 | ext4_group_t i_last_alloc_group; |
@@ -903,12 +889,22 @@ struct ext4_inode_info { | |||
903 | qsize_t i_reserved_quota; | 889 | qsize_t i_reserved_quota; |
904 | #endif | 890 | #endif |
905 | 891 | ||
906 | /* completed IOs that might need unwritten extents handling */ | 892 | /* Lock protecting lists below */ |
907 | struct list_head i_completed_io_list; | ||
908 | spinlock_t i_completed_io_lock; | 893 | spinlock_t i_completed_io_lock; |
894 | /* | ||
895 | * Completed IOs that need unwritten extents handling and have | ||
896 | * transaction reserved | ||
897 | */ | ||
898 | struct list_head i_rsv_conversion_list; | ||
899 | /* | ||
900 | * Completed IOs that need unwritten extents handling and don't have | ||
901 | * transaction reserved | ||
902 | */ | ||
903 | struct list_head i_unrsv_conversion_list; | ||
909 | atomic_t i_ioend_count; /* Number of outstanding io_end structs */ | 904 | atomic_t i_ioend_count; /* Number of outstanding io_end structs */ |
910 | atomic_t i_unwritten; /* Nr. of inflight conversions pending */ | 905 | atomic_t i_unwritten; /* Nr. of inflight conversions pending */ |
911 | struct work_struct i_unwritten_work; /* deferred extent conversion */ | 906 | struct work_struct i_rsv_conversion_work; |
907 | struct work_struct i_unrsv_conversion_work; | ||
912 | 908 | ||
913 | spinlock_t i_block_reservation_lock; | 909 | spinlock_t i_block_reservation_lock; |
914 | 910 | ||
@@ -1245,7 +1241,6 @@ struct ext4_sb_info { | |||
1245 | unsigned int s_mb_stats; | 1241 | unsigned int s_mb_stats; |
1246 | unsigned int s_mb_order2_reqs; | 1242 | unsigned int s_mb_order2_reqs; |
1247 | unsigned int s_mb_group_prealloc; | 1243 | unsigned int s_mb_group_prealloc; |
1248 | unsigned int s_max_writeback_mb_bump; | ||
1249 | unsigned int s_max_dir_size_kb; | 1244 | unsigned int s_max_dir_size_kb; |
1250 | /* where last allocation was done - for stream allocation */ | 1245 | /* where last allocation was done - for stream allocation */ |
1251 | unsigned long s_mb_last_group; | 1246 | unsigned long s_mb_last_group; |
@@ -1281,8 +1276,10 @@ struct ext4_sb_info { | |||
1281 | struct flex_groups *s_flex_groups; | 1276 | struct flex_groups *s_flex_groups; |
1282 | ext4_group_t s_flex_groups_allocated; | 1277 | ext4_group_t s_flex_groups_allocated; |
1283 | 1278 | ||
1284 | /* workqueue for dio unwritten */ | 1279 | /* workqueue for unreserved extent convertions (dio) */ |
1285 | struct workqueue_struct *dio_unwritten_wq; | 1280 | struct workqueue_struct *unrsv_conversion_wq; |
1281 | /* workqueue for reserved extent conversions (buffered io) */ | ||
1282 | struct workqueue_struct *rsv_conversion_wq; | ||
1286 | 1283 | ||
1287 | /* timer for periodic error stats printing */ | 1284 | /* timer for periodic error stats printing */ |
1288 | struct timer_list s_err_report; | 1285 | struct timer_list s_err_report; |
@@ -1307,6 +1304,7 @@ struct ext4_sb_info { | |||
1307 | /* Reclaim extents from extent status tree */ | 1304 | /* Reclaim extents from extent status tree */ |
1308 | struct shrinker s_es_shrinker; | 1305 | struct shrinker s_es_shrinker; |
1309 | struct list_head s_es_lru; | 1306 | struct list_head s_es_lru; |
1307 | unsigned long s_es_last_sorted; | ||
1310 | struct percpu_counter s_extent_cache_cnt; | 1308 | struct percpu_counter s_extent_cache_cnt; |
1311 | spinlock_t s_es_lru_lock ____cacheline_aligned_in_smp; | 1309 | spinlock_t s_es_lru_lock ____cacheline_aligned_in_smp; |
1312 | }; | 1310 | }; |
@@ -1342,6 +1340,9 @@ static inline void ext4_set_io_unwritten_flag(struct inode *inode, | |||
1342 | struct ext4_io_end *io_end) | 1340 | struct ext4_io_end *io_end) |
1343 | { | 1341 | { |
1344 | if (!(io_end->flag & EXT4_IO_END_UNWRITTEN)) { | 1342 | if (!(io_end->flag & EXT4_IO_END_UNWRITTEN)) { |
1343 | /* Writeback has to have coversion transaction reserved */ | ||
1344 | WARN_ON(EXT4_SB(inode->i_sb)->s_journal && !io_end->handle && | ||
1345 | !(io_end->flag & EXT4_IO_END_DIRECT)); | ||
1345 | io_end->flag |= EXT4_IO_END_UNWRITTEN; | 1346 | io_end->flag |= EXT4_IO_END_UNWRITTEN; |
1346 | atomic_inc(&EXT4_I(inode)->i_unwritten); | 1347 | atomic_inc(&EXT4_I(inode)->i_unwritten); |
1347 | } | 1348 | } |
@@ -1999,7 +2000,6 @@ static inline unsigned char get_dtype(struct super_block *sb, int filetype) | |||
1999 | 2000 | ||
2000 | /* fsync.c */ | 2001 | /* fsync.c */ |
2001 | extern int ext4_sync_file(struct file *, loff_t, loff_t, int); | 2002 | extern int ext4_sync_file(struct file *, loff_t, loff_t, int); |
2002 | extern int ext4_flush_unwritten_io(struct inode *); | ||
2003 | 2003 | ||
2004 | /* hash.c */ | 2004 | /* hash.c */ |
2005 | extern int ext4fs_dirhash(const char *name, int len, struct | 2005 | extern int ext4fs_dirhash(const char *name, int len, struct |
@@ -2088,7 +2088,7 @@ extern int ext4_change_inode_journal_flag(struct inode *, int); | |||
2088 | extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); | 2088 | extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); |
2089 | extern int ext4_can_truncate(struct inode *inode); | 2089 | extern int ext4_can_truncate(struct inode *inode); |
2090 | extern void ext4_truncate(struct inode *); | 2090 | extern void ext4_truncate(struct inode *); |
2091 | extern int ext4_punch_hole(struct file *file, loff_t offset, loff_t length); | 2091 | extern int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length); |
2092 | extern int ext4_truncate_restart_trans(handle_t *, struct inode *, int nblocks); | 2092 | extern int ext4_truncate_restart_trans(handle_t *, struct inode *, int nblocks); |
2093 | extern void ext4_set_inode_flags(struct inode *); | 2093 | extern void ext4_set_inode_flags(struct inode *); |
2094 | extern void ext4_get_inode_flags(struct ext4_inode_info *); | 2094 | extern void ext4_get_inode_flags(struct ext4_inode_info *); |
@@ -2096,9 +2096,12 @@ extern int ext4_alloc_da_blocks(struct inode *inode); | |||
2096 | extern void ext4_set_aops(struct inode *inode); | 2096 | extern void ext4_set_aops(struct inode *inode); |
2097 | extern int ext4_writepage_trans_blocks(struct inode *); | 2097 | extern int ext4_writepage_trans_blocks(struct inode *); |
2098 | extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks); | 2098 | extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks); |
2099 | extern int ext4_discard_partial_page_buffers(handle_t *handle, | 2099 | extern int ext4_block_truncate_page(handle_t *handle, |
2100 | struct address_space *mapping, loff_t from, | 2100 | struct address_space *mapping, loff_t from); |
2101 | loff_t length, int flags); | 2101 | extern int ext4_block_zero_page_range(handle_t *handle, |
2102 | struct address_space *mapping, loff_t from, loff_t length); | ||
2103 | extern int ext4_zero_partial_blocks(handle_t *handle, struct inode *inode, | ||
2104 | loff_t lstart, loff_t lend); | ||
2102 | extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); | 2105 | extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); |
2103 | extern qsize_t *ext4_get_reserved_space(struct inode *inode); | 2106 | extern qsize_t *ext4_get_reserved_space(struct inode *inode); |
2104 | extern void ext4_da_update_reserve_space(struct inode *inode, | 2107 | extern void ext4_da_update_reserve_space(struct inode *inode, |
@@ -2111,7 +2114,7 @@ extern ssize_t ext4_ind_direct_IO(int rw, struct kiocb *iocb, | |||
2111 | const struct iovec *iov, loff_t offset, | 2114 | const struct iovec *iov, loff_t offset, |
2112 | unsigned long nr_segs); | 2115 | unsigned long nr_segs); |
2113 | extern int ext4_ind_calc_metadata_amount(struct inode *inode, sector_t lblock); | 2116 | extern int ext4_ind_calc_metadata_amount(struct inode *inode, sector_t lblock); |
2114 | extern int ext4_ind_trans_blocks(struct inode *inode, int nrblocks, int chunk); | 2117 | extern int ext4_ind_trans_blocks(struct inode *inode, int nrblocks); |
2115 | extern void ext4_ind_truncate(handle_t *, struct inode *inode); | 2118 | extern void ext4_ind_truncate(handle_t *, struct inode *inode); |
2116 | extern int ext4_free_hole_blocks(handle_t *handle, struct inode *inode, | 2119 | extern int ext4_free_hole_blocks(handle_t *handle, struct inode *inode, |
2117 | ext4_lblk_t first, ext4_lblk_t stop); | 2120 | ext4_lblk_t first, ext4_lblk_t stop); |
@@ -2166,42 +2169,96 @@ extern int ext4_alloc_flex_bg_array(struct super_block *sb, | |||
2166 | ext4_group_t ngroup); | 2169 | ext4_group_t ngroup); |
2167 | extern const char *ext4_decode_error(struct super_block *sb, int errno, | 2170 | extern const char *ext4_decode_error(struct super_block *sb, int errno, |
2168 | char nbuf[16]); | 2171 | char nbuf[16]); |
2172 | |||
2169 | extern __printf(4, 5) | 2173 | extern __printf(4, 5) |
2170 | void __ext4_error(struct super_block *, const char *, unsigned int, | 2174 | void __ext4_error(struct super_block *, const char *, unsigned int, |
2171 | const char *, ...); | 2175 | const char *, ...); |
2172 | #define ext4_error(sb, message...) __ext4_error(sb, __func__, \ | ||
2173 | __LINE__, ## message) | ||
2174 | extern __printf(5, 6) | 2176 | extern __printf(5, 6) |
2175 | void ext4_error_inode(struct inode *, const char *, unsigned int, ext4_fsblk_t, | 2177 | void __ext4_error_inode(struct inode *, const char *, unsigned int, ext4_fsblk_t, |
2176 | const char *, ...); | 2178 | const char *, ...); |
2177 | extern __printf(5, 6) | 2179 | extern __printf(5, 6) |
2178 | void ext4_error_file(struct file *, const char *, unsigned int, ext4_fsblk_t, | 2180 | void __ext4_error_file(struct file *, const char *, unsigned int, ext4_fsblk_t, |
2179 | const char *, ...); | 2181 | const char *, ...); |
2180 | extern void __ext4_std_error(struct super_block *, const char *, | 2182 | extern void __ext4_std_error(struct super_block *, const char *, |
2181 | unsigned int, int); | 2183 | unsigned int, int); |
2182 | extern __printf(4, 5) | 2184 | extern __printf(4, 5) |
2183 | void __ext4_abort(struct super_block *, const char *, unsigned int, | 2185 | void __ext4_abort(struct super_block *, const char *, unsigned int, |
2184 | const char *, ...); | 2186 | const char *, ...); |
2185 | #define ext4_abort(sb, message...) __ext4_abort(sb, __func__, \ | ||
2186 | __LINE__, ## message) | ||
2187 | extern __printf(4, 5) | 2187 | extern __printf(4, 5) |
2188 | void __ext4_warning(struct super_block *, const char *, unsigned int, | 2188 | void __ext4_warning(struct super_block *, const char *, unsigned int, |
2189 | const char *, ...); | 2189 | const char *, ...); |
2190 | #define ext4_warning(sb, message...) __ext4_warning(sb, __func__, \ | ||
2191 | __LINE__, ## message) | ||
2192 | extern __printf(3, 4) | 2190 | extern __printf(3, 4) |
2193 | void ext4_msg(struct super_block *, const char *, const char *, ...); | 2191 | void __ext4_msg(struct super_block *, const char *, const char *, ...); |
2194 | extern void __dump_mmp_msg(struct super_block *, struct mmp_struct *mmp, | 2192 | extern void __dump_mmp_msg(struct super_block *, struct mmp_struct *mmp, |
2195 | const char *, unsigned int, const char *); | 2193 | const char *, unsigned int, const char *); |
2196 | #define dump_mmp_msg(sb, mmp, msg) __dump_mmp_msg(sb, mmp, __func__, \ | ||
2197 | __LINE__, msg) | ||
2198 | extern __printf(7, 8) | 2194 | extern __printf(7, 8) |
2199 | void __ext4_grp_locked_error(const char *, unsigned int, | 2195 | void __ext4_grp_locked_error(const char *, unsigned int, |
2200 | struct super_block *, ext4_group_t, | 2196 | struct super_block *, ext4_group_t, |
2201 | unsigned long, ext4_fsblk_t, | 2197 | unsigned long, ext4_fsblk_t, |
2202 | const char *, ...); | 2198 | const char *, ...); |
2203 | #define ext4_grp_locked_error(sb, grp, message...) \ | 2199 | |
2204 | __ext4_grp_locked_error(__func__, __LINE__, (sb), (grp), ## message) | 2200 | #ifdef CONFIG_PRINTK |
2201 | |||
2202 | #define ext4_error_inode(inode, func, line, block, fmt, ...) \ | ||
2203 | __ext4_error_inode(inode, func, line, block, fmt, ##__VA_ARGS__) | ||
2204 | #define ext4_error_file(file, func, line, block, fmt, ...) \ | ||
2205 | __ext4_error_file(file, func, line, block, fmt, ##__VA_ARGS__) | ||
2206 | #define ext4_error(sb, fmt, ...) \ | ||
2207 | __ext4_error(sb, __func__, __LINE__, fmt, ##__VA_ARGS__) | ||
2208 | #define ext4_abort(sb, fmt, ...) \ | ||
2209 | __ext4_abort(sb, __func__, __LINE__, fmt, ##__VA_ARGS__) | ||
2210 | #define ext4_warning(sb, fmt, ...) \ | ||
2211 | __ext4_warning(sb, __func__, __LINE__, fmt, ##__VA_ARGS__) | ||
2212 | #define ext4_msg(sb, level, fmt, ...) \ | ||
2213 | __ext4_msg(sb, level, fmt, ##__VA_ARGS__) | ||
2214 | #define dump_mmp_msg(sb, mmp, msg) \ | ||
2215 | __dump_mmp_msg(sb, mmp, __func__, __LINE__, msg) | ||
2216 | #define ext4_grp_locked_error(sb, grp, ino, block, fmt, ...) \ | ||
2217 | __ext4_grp_locked_error(__func__, __LINE__, sb, grp, ino, block, \ | ||
2218 | fmt, ##__VA_ARGS__) | ||
2219 | |||
2220 | #else | ||
2221 | |||
2222 | #define ext4_error_inode(inode, func, line, block, fmt, ...) \ | ||
2223 | do { \ | ||
2224 | no_printk(fmt, ##__VA_ARGS__); \ | ||
2225 | __ext4_error_inode(inode, "", 0, block, " "); \ | ||
2226 | } while (0) | ||
2227 | #define ext4_error_file(file, func, line, block, fmt, ...) \ | ||
2228 | do { \ | ||
2229 | no_printk(fmt, ##__VA_ARGS__); \ | ||
2230 | __ext4_error_file(file, "", 0, block, " "); \ | ||
2231 | } while (0) | ||
2232 | #define ext4_error(sb, fmt, ...) \ | ||
2233 | do { \ | ||
2234 | no_printk(fmt, ##__VA_ARGS__); \ | ||
2235 | __ext4_error(sb, "", 0, " "); \ | ||
2236 | } while (0) | ||
2237 | #define ext4_abort(sb, fmt, ...) \ | ||
2238 | do { \ | ||
2239 | no_printk(fmt, ##__VA_ARGS__); \ | ||
2240 | __ext4_abort(sb, "", 0, " "); \ | ||
2241 | } while (0) | ||
2242 | #define ext4_warning(sb, fmt, ...) \ | ||
2243 | do { \ | ||
2244 | no_printk(fmt, ##__VA_ARGS__); \ | ||
2245 | __ext4_warning(sb, "", 0, " "); \ | ||
2246 | } while (0) | ||
2247 | #define ext4_msg(sb, level, fmt, ...) \ | ||
2248 | do { \ | ||
2249 | no_printk(fmt, ##__VA_ARGS__); \ | ||
2250 | __ext4_msg(sb, "", " "); \ | ||
2251 | } while (0) | ||
2252 | #define dump_mmp_msg(sb, mmp, msg) \ | ||
2253 | __dump_mmp_msg(sb, mmp, "", 0, "") | ||
2254 | #define ext4_grp_locked_error(sb, grp, ino, block, fmt, ...) \ | ||
2255 | do { \ | ||
2256 | no_printk(fmt, ##__VA_ARGS__); \ | ||
2257 | __ext4_grp_locked_error("", 0, sb, grp, ino, block, " "); \ | ||
2258 | } while (0) | ||
2259 | |||
2260 | #endif | ||
2261 | |||
2205 | extern void ext4_update_dynamic_rev(struct super_block *sb); | 2262 | extern void ext4_update_dynamic_rev(struct super_block *sb); |
2206 | extern int ext4_update_compat_feature(handle_t *handle, struct super_block *sb, | 2263 | extern int ext4_update_compat_feature(handle_t *handle, struct super_block *sb, |
2207 | __u32 compat); | 2264 | __u32 compat); |
@@ -2312,6 +2369,7 @@ struct ext4_group_info *ext4_get_group_info(struct super_block *sb, | |||
2312 | { | 2369 | { |
2313 | struct ext4_group_info ***grp_info; | 2370 | struct ext4_group_info ***grp_info; |
2314 | long indexv, indexh; | 2371 | long indexv, indexh; |
2372 | BUG_ON(group >= EXT4_SB(sb)->s_groups_count); | ||
2315 | grp_info = EXT4_SB(sb)->s_group_info; | 2373 | grp_info = EXT4_SB(sb)->s_group_info; |
2316 | indexv = group >> (EXT4_DESC_PER_BLOCK_BITS(sb)); | 2374 | indexv = group >> (EXT4_DESC_PER_BLOCK_BITS(sb)); |
2317 | indexh = group & ((EXT4_DESC_PER_BLOCK(sb)) - 1); | 2375 | indexh = group & ((EXT4_DESC_PER_BLOCK(sb)) - 1); |
@@ -2515,7 +2573,7 @@ extern int ext4_try_create_inline_dir(handle_t *handle, | |||
2515 | struct inode *parent, | 2573 | struct inode *parent, |
2516 | struct inode *inode); | 2574 | struct inode *inode); |
2517 | extern int ext4_read_inline_dir(struct file *filp, | 2575 | extern int ext4_read_inline_dir(struct file *filp, |
2518 | void *dirent, filldir_t filldir, | 2576 | struct dir_context *ctx, |
2519 | int *has_inline_data); | 2577 | int *has_inline_data); |
2520 | extern int htree_inlinedir_to_tree(struct file *dir_file, | 2578 | extern int htree_inlinedir_to_tree(struct file *dir_file, |
2521 | struct inode *dir, ext4_lblk_t block, | 2579 | struct inode *dir, ext4_lblk_t block, |
@@ -2598,8 +2656,7 @@ struct ext4_extent; | |||
2598 | 2656 | ||
2599 | extern int ext4_ext_tree_init(handle_t *handle, struct inode *); | 2657 | extern int ext4_ext_tree_init(handle_t *handle, struct inode *); |
2600 | extern int ext4_ext_writepage_trans_blocks(struct inode *, int); | 2658 | extern int ext4_ext_writepage_trans_blocks(struct inode *, int); |
2601 | extern int ext4_ext_index_trans_blocks(struct inode *inode, int nrblocks, | 2659 | extern int ext4_ext_index_trans_blocks(struct inode *inode, int extents); |
2602 | int chunk); | ||
2603 | extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, | 2660 | extern int ext4_ext_map_blocks(handle_t *handle, struct inode *inode, |
2604 | struct ext4_map_blocks *map, int flags); | 2661 | struct ext4_map_blocks *map, int flags); |
2605 | extern void ext4_ext_truncate(handle_t *, struct inode *); | 2662 | extern void ext4_ext_truncate(handle_t *, struct inode *); |
@@ -2609,8 +2666,8 @@ extern void ext4_ext_init(struct super_block *); | |||
2609 | extern void ext4_ext_release(struct super_block *); | 2666 | extern void ext4_ext_release(struct super_block *); |
2610 | extern long ext4_fallocate(struct file *file, int mode, loff_t offset, | 2667 | extern long ext4_fallocate(struct file *file, int mode, loff_t offset, |
2611 | loff_t len); | 2668 | loff_t len); |
2612 | extern int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset, | 2669 | extern int ext4_convert_unwritten_extents(handle_t *handle, struct inode *inode, |
2613 | ssize_t len); | 2670 | loff_t offset, ssize_t len); |
2614 | extern int ext4_map_blocks(handle_t *handle, struct inode *inode, | 2671 | extern int ext4_map_blocks(handle_t *handle, struct inode *inode, |
2615 | struct ext4_map_blocks *map, int flags); | 2672 | struct ext4_map_blocks *map, int flags); |
2616 | extern int ext4_ext_calc_metadata_amount(struct inode *inode, | 2673 | extern int ext4_ext_calc_metadata_amount(struct inode *inode, |
@@ -2650,12 +2707,15 @@ extern int ext4_move_extents(struct file *o_filp, struct file *d_filp, | |||
2650 | 2707 | ||
2651 | /* page-io.c */ | 2708 | /* page-io.c */ |
2652 | extern int __init ext4_init_pageio(void); | 2709 | extern int __init ext4_init_pageio(void); |
2653 | extern void ext4_add_complete_io(ext4_io_end_t *io_end); | ||
2654 | extern void ext4_exit_pageio(void); | 2710 | extern void ext4_exit_pageio(void); |
2655 | extern void ext4_ioend_shutdown(struct inode *); | ||
2656 | extern void ext4_free_io_end(ext4_io_end_t *io); | ||
2657 | extern ext4_io_end_t *ext4_init_io_end(struct inode *inode, gfp_t flags); | 2711 | extern ext4_io_end_t *ext4_init_io_end(struct inode *inode, gfp_t flags); |
2658 | extern void ext4_end_io_work(struct work_struct *work); | 2712 | extern ext4_io_end_t *ext4_get_io_end(ext4_io_end_t *io_end); |
2713 | extern int ext4_put_io_end(ext4_io_end_t *io_end); | ||
2714 | extern void ext4_put_io_end_defer(ext4_io_end_t *io_end); | ||
2715 | extern void ext4_io_submit_init(struct ext4_io_submit *io, | ||
2716 | struct writeback_control *wbc); | ||
2717 | extern void ext4_end_io_rsv_work(struct work_struct *work); | ||
2718 | extern void ext4_end_io_unrsv_work(struct work_struct *work); | ||
2659 | extern void ext4_io_submit(struct ext4_io_submit *io); | 2719 | extern void ext4_io_submit(struct ext4_io_submit *io); |
2660 | extern int ext4_bio_write_page(struct ext4_io_submit *io, | 2720 | extern int ext4_bio_write_page(struct ext4_io_submit *io, |
2661 | struct page *page, | 2721 | struct page *page, |
@@ -2668,20 +2728,17 @@ extern void ext4_mmp_csum_set(struct super_block *sb, struct mmp_struct *mmp); | |||
2668 | extern int ext4_mmp_csum_verify(struct super_block *sb, | 2728 | extern int ext4_mmp_csum_verify(struct super_block *sb, |
2669 | struct mmp_struct *mmp); | 2729 | struct mmp_struct *mmp); |
2670 | 2730 | ||
2671 | /* BH_Uninit flag: blocks are allocated but uninitialized on disk */ | 2731 | /* |
2732 | * Note that these flags will never ever appear in a buffer_head's state flag. | ||
2733 | * See EXT4_MAP_... to see where this is used. | ||
2734 | */ | ||
2672 | enum ext4_state_bits { | 2735 | enum ext4_state_bits { |
2673 | BH_Uninit /* blocks are allocated but uninitialized on disk */ | 2736 | BH_Uninit /* blocks are allocated but uninitialized on disk */ |
2674 | = BH_JBDPrivateStart, | 2737 | = BH_JBDPrivateStart, |
2675 | BH_AllocFromCluster, /* allocated blocks were part of already | 2738 | BH_AllocFromCluster, /* allocated blocks were part of already |
2676 | * allocated cluster. Note that this flag will | 2739 | * allocated cluster. */ |
2677 | * never, ever appear in a buffer_head's state | ||
2678 | * flag. See EXT4_MAP_FROM_CLUSTER to see where | ||
2679 | * this is used. */ | ||
2680 | }; | 2740 | }; |
2681 | 2741 | ||
2682 | BUFFER_FNS(Uninit, uninit) | ||
2683 | TAS_BUFFER_FNS(Uninit, uninit) | ||
2684 | |||
2685 | /* | 2742 | /* |
2686 | * Add new method to test whether block and inode bitmaps are properly | 2743 | * Add new method to test whether block and inode bitmaps are properly |
2687 | * initialized. With uninit_bg reading the block from disk is not enough | 2744 | * initialized. With uninit_bg reading the block from disk is not enough |