diff options
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 165 |
1 files changed, 136 insertions, 29 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index df163da388c9..8462eb3c33aa 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -57,6 +57,16 @@ | |||
57 | #define ext4_debug(fmt, ...) no_printk(fmt, ##__VA_ARGS__) | 57 | #define ext4_debug(fmt, ...) no_printk(fmt, ##__VA_ARGS__) |
58 | #endif | 58 | #endif |
59 | 59 | ||
60 | /* | ||
61 | * Turn on EXT_DEBUG to get lots of info about extents operations. | ||
62 | */ | ||
63 | #define EXT_DEBUG__ | ||
64 | #ifdef EXT_DEBUG | ||
65 | #define ext_debug(fmt, ...) printk(fmt, ##__VA_ARGS__) | ||
66 | #else | ||
67 | #define ext_debug(fmt, ...) no_printk(fmt, ##__VA_ARGS__) | ||
68 | #endif | ||
69 | |||
60 | #define EXT4_ERROR_INODE(inode, fmt, a...) \ | 70 | #define EXT4_ERROR_INODE(inode, fmt, a...) \ |
61 | ext4_error_inode((inode), __func__, __LINE__, 0, (fmt), ## a) | 71 | ext4_error_inode((inode), __func__, __LINE__, 0, (fmt), ## a) |
62 | 72 | ||
@@ -392,6 +402,7 @@ struct flex_groups { | |||
392 | #define EXT4_EXTENTS_FL 0x00080000 /* Inode uses extents */ | 402 | #define EXT4_EXTENTS_FL 0x00080000 /* Inode uses extents */ |
393 | #define EXT4_EA_INODE_FL 0x00200000 /* Inode used for large EA */ | 403 | #define EXT4_EA_INODE_FL 0x00200000 /* Inode used for large EA */ |
394 | #define EXT4_EOFBLOCKS_FL 0x00400000 /* Blocks allocated beyond EOF */ | 404 | #define EXT4_EOFBLOCKS_FL 0x00400000 /* Blocks allocated beyond EOF */ |
405 | #define EXT4_INLINE_DATA_FL 0x10000000 /* Inode has inline data. */ | ||
395 | #define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */ | 406 | #define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */ |
396 | 407 | ||
397 | #define EXT4_FL_USER_VISIBLE 0x004BDFFF /* User visible flags */ | 408 | #define EXT4_FL_USER_VISIBLE 0x004BDFFF /* User visible flags */ |
@@ -448,28 +459,26 @@ enum { | |||
448 | EXT4_INODE_EXTENTS = 19, /* Inode uses extents */ | 459 | EXT4_INODE_EXTENTS = 19, /* Inode uses extents */ |
449 | EXT4_INODE_EA_INODE = 21, /* Inode used for large EA */ | 460 | EXT4_INODE_EA_INODE = 21, /* Inode used for large EA */ |
450 | EXT4_INODE_EOFBLOCKS = 22, /* Blocks allocated beyond EOF */ | 461 | EXT4_INODE_EOFBLOCKS = 22, /* Blocks allocated beyond EOF */ |
462 | EXT4_INODE_INLINE_DATA = 28, /* Data in inode. */ | ||
451 | EXT4_INODE_RESERVED = 31, /* reserved for ext4 lib */ | 463 | EXT4_INODE_RESERVED = 31, /* reserved for ext4 lib */ |
452 | }; | 464 | }; |
453 | 465 | ||
454 | #define TEST_FLAG_VALUE(FLAG) (EXT4_##FLAG##_FL == (1 << EXT4_INODE_##FLAG)) | 466 | /* |
455 | #define CHECK_FLAG_VALUE(FLAG) if (!TEST_FLAG_VALUE(FLAG)) { \ | 467 | * Since it's pretty easy to mix up bit numbers and hex values, we use a |
456 | printk(KERN_EMERG "EXT4 flag fail: " #FLAG ": %d %d\n", \ | 468 | * build-time check to make sure that EXT4_XXX_FL is consistent with respect to |
457 | EXT4_##FLAG##_FL, EXT4_INODE_##FLAG); BUG_ON(1); } | 469 | * EXT4_INODE_XXX. If all is well, the macros will be dropped, so, it won't cost |
458 | 470 | * any extra space in the compiled kernel image, otherwise, the build will fail. | |
459 | /* | 471 | * It's important that these values are the same, since we are using |
460 | * Since it's pretty easy to mix up bit numbers and hex values, and we | 472 | * EXT4_INODE_XXX to test for flag values, but EXT4_XXX_FL must be consistent |
461 | * can't do a compile-time test for ENUM values, we use a run-time | 473 | * with the values of FS_XXX_FL defined in include/linux/fs.h and the on-disk |
462 | * test to make sure that EXT4_XXX_FL is consistent with respect to | 474 | * values found in ext2, ext3 and ext4 filesystems, and of course the values |
463 | * EXT4_INODE_XXX. If all is well the printk and BUG_ON will all drop | 475 | * defined in e2fsprogs. |
464 | * out so it won't cost any extra space in the compiled kernel image. | ||
465 | * But it's important that these values are the same, since we are | ||
466 | * using EXT4_INODE_XXX to test for the flag values, but EXT4_XX_FL | ||
467 | * must be consistent with the values of FS_XXX_FL defined in | ||
468 | * include/linux/fs.h and the on-disk values found in ext2, ext3, and | ||
469 | * ext4 filesystems, and of course the values defined in e2fsprogs. | ||
470 | * | 476 | * |
471 | * It's not paranoia if the Murphy's Law really *is* out to get you. :-) | 477 | * It's not paranoia if the Murphy's Law really *is* out to get you. :-) |
472 | */ | 478 | */ |
479 | #define TEST_FLAG_VALUE(FLAG) (EXT4_##FLAG##_FL == (1 << EXT4_INODE_##FLAG)) | ||
480 | #define CHECK_FLAG_VALUE(FLAG) BUILD_BUG_ON(!TEST_FLAG_VALUE(FLAG)) | ||
481 | |||
473 | static inline void ext4_check_flag_values(void) | 482 | static inline void ext4_check_flag_values(void) |
474 | { | 483 | { |
475 | CHECK_FLAG_VALUE(SECRM); | 484 | CHECK_FLAG_VALUE(SECRM); |
@@ -494,6 +503,7 @@ static inline void ext4_check_flag_values(void) | |||
494 | CHECK_FLAG_VALUE(EXTENTS); | 503 | CHECK_FLAG_VALUE(EXTENTS); |
495 | CHECK_FLAG_VALUE(EA_INODE); | 504 | CHECK_FLAG_VALUE(EA_INODE); |
496 | CHECK_FLAG_VALUE(EOFBLOCKS); | 505 | CHECK_FLAG_VALUE(EOFBLOCKS); |
506 | CHECK_FLAG_VALUE(INLINE_DATA); | ||
497 | CHECK_FLAG_VALUE(RESERVED); | 507 | CHECK_FLAG_VALUE(RESERVED); |
498 | } | 508 | } |
499 | 509 | ||
@@ -811,6 +821,8 @@ struct ext4_ext_cache { | |||
811 | __u32 ec_len; /* must be 32bit to return holes */ | 821 | __u32 ec_len; /* must be 32bit to return holes */ |
812 | }; | 822 | }; |
813 | 823 | ||
824 | #include "extents_status.h" | ||
825 | |||
814 | /* | 826 | /* |
815 | * fourth extended file system inode data in memory | 827 | * fourth extended file system inode data in memory |
816 | */ | 828 | */ |
@@ -833,7 +845,6 @@ struct ext4_inode_info { | |||
833 | #endif | 845 | #endif |
834 | unsigned long i_flags; | 846 | unsigned long i_flags; |
835 | 847 | ||
836 | #ifdef CONFIG_EXT4_FS_XATTR | ||
837 | /* | 848 | /* |
838 | * Extended attributes can be read independently of the main file | 849 | * Extended attributes can be read independently of the main file |
839 | * data. Taking i_mutex even when reading would cause contention | 850 | * data. Taking i_mutex even when reading would cause contention |
@@ -842,7 +853,6 @@ struct ext4_inode_info { | |||
842 | * EAs. | 853 | * EAs. |
843 | */ | 854 | */ |
844 | struct rw_semaphore xattr_sem; | 855 | struct rw_semaphore xattr_sem; |
845 | #endif | ||
846 | 856 | ||
847 | struct list_head i_orphan; /* unlinked but open inodes */ | 857 | struct list_head i_orphan; /* unlinked but open inodes */ |
848 | 858 | ||
@@ -888,6 +898,10 @@ struct ext4_inode_info { | |||
888 | struct list_head i_prealloc_list; | 898 | struct list_head i_prealloc_list; |
889 | spinlock_t i_prealloc_lock; | 899 | spinlock_t i_prealloc_lock; |
890 | 900 | ||
901 | /* extents status tree */ | ||
902 | struct ext4_es_tree i_es_tree; | ||
903 | rwlock_t i_es_lock; | ||
904 | |||
891 | /* ialloc */ | 905 | /* ialloc */ |
892 | ext4_group_t i_last_alloc_group; | 906 | ext4_group_t i_last_alloc_group; |
893 | 907 | ||
@@ -902,6 +916,10 @@ struct ext4_inode_info { | |||
902 | /* on-disk additional length */ | 916 | /* on-disk additional length */ |
903 | __u16 i_extra_isize; | 917 | __u16 i_extra_isize; |
904 | 918 | ||
919 | /* Indicate the inline data space. */ | ||
920 | u16 i_inline_off; | ||
921 | u16 i_inline_size; | ||
922 | |||
905 | #ifdef CONFIG_QUOTA | 923 | #ifdef CONFIG_QUOTA |
906 | /* quota space reservation, managed internally by quota code */ | 924 | /* quota space reservation, managed internally by quota code */ |
907 | qsize_t i_reserved_quota; | 925 | qsize_t i_reserved_quota; |
@@ -1360,6 +1378,7 @@ enum { | |||
1360 | EXT4_STATE_DELALLOC_RESERVED, /* blks already reserved for delalloc */ | 1378 | EXT4_STATE_DELALLOC_RESERVED, /* blks already reserved for delalloc */ |
1361 | EXT4_STATE_DIOREAD_LOCK, /* Disable support for dio read | 1379 | EXT4_STATE_DIOREAD_LOCK, /* Disable support for dio read |
1362 | nolocking */ | 1380 | nolocking */ |
1381 | EXT4_STATE_MAY_INLINE_DATA, /* may have in-inode data */ | ||
1363 | }; | 1382 | }; |
1364 | 1383 | ||
1365 | #define EXT4_INODE_BIT_FNS(name, field, offset) \ | 1384 | #define EXT4_INODE_BIT_FNS(name, field, offset) \ |
@@ -1481,7 +1500,7 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei) | |||
1481 | #define EXT4_FEATURE_INCOMPAT_DIRDATA 0x1000 /* data in dirent */ | 1500 | #define EXT4_FEATURE_INCOMPAT_DIRDATA 0x1000 /* data in dirent */ |
1482 | #define EXT4_FEATURE_INCOMPAT_BG_USE_META_CSUM 0x2000 /* use crc32c for bg */ | 1501 | #define EXT4_FEATURE_INCOMPAT_BG_USE_META_CSUM 0x2000 /* use crc32c for bg */ |
1483 | #define EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000 /* >2GB or 3-lvl htree */ | 1502 | #define EXT4_FEATURE_INCOMPAT_LARGEDIR 0x4000 /* >2GB or 3-lvl htree */ |
1484 | #define EXT4_FEATURE_INCOMPAT_INLINEDATA 0x8000 /* data in inode */ | 1503 | #define EXT4_FEATURE_INCOMPAT_INLINE_DATA 0x8000 /* data in inode */ |
1485 | 1504 | ||
1486 | #define EXT2_FEATURE_COMPAT_SUPP EXT4_FEATURE_COMPAT_EXT_ATTR | 1505 | #define EXT2_FEATURE_COMPAT_SUPP EXT4_FEATURE_COMPAT_EXT_ATTR |
1487 | #define EXT2_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \ | 1506 | #define EXT2_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \ |
@@ -1505,7 +1524,8 @@ static inline void ext4_clear_state_flags(struct ext4_inode_info *ei) | |||
1505 | EXT4_FEATURE_INCOMPAT_EXTENTS| \ | 1524 | EXT4_FEATURE_INCOMPAT_EXTENTS| \ |
1506 | EXT4_FEATURE_INCOMPAT_64BIT| \ | 1525 | EXT4_FEATURE_INCOMPAT_64BIT| \ |
1507 | EXT4_FEATURE_INCOMPAT_FLEX_BG| \ | 1526 | EXT4_FEATURE_INCOMPAT_FLEX_BG| \ |
1508 | EXT4_FEATURE_INCOMPAT_MMP) | 1527 | EXT4_FEATURE_INCOMPAT_MMP | \ |
1528 | EXT4_FEATURE_INCOMPAT_INLINE_DATA) | ||
1509 | #define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ | 1529 | #define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ |
1510 | EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ | 1530 | EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ |
1511 | EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \ | 1531 | EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \ |
@@ -1592,6 +1612,11 @@ struct ext4_dir_entry_tail { | |||
1592 | __le32 det_checksum; /* crc32c(uuid+inum+dirblock) */ | 1612 | __le32 det_checksum; /* crc32c(uuid+inum+dirblock) */ |
1593 | }; | 1613 | }; |
1594 | 1614 | ||
1615 | #define EXT4_DIRENT_TAIL(block, blocksize) \ | ||
1616 | ((struct ext4_dir_entry_tail *)(((void *)(block)) + \ | ||
1617 | ((blocksize) - \ | ||
1618 | sizeof(struct ext4_dir_entry_tail)))) | ||
1619 | |||
1595 | /* | 1620 | /* |
1596 | * Ext4 directory file types. Only the low 3 bits are used. The | 1621 | * Ext4 directory file types. Only the low 3 bits are used. The |
1597 | * other bits are reserved for now. | 1622 | * other bits are reserved for now. |
@@ -1936,14 +1961,42 @@ ext4_fsblk_t ext4_inode_to_goal_block(struct inode *); | |||
1936 | extern int __ext4_check_dir_entry(const char *, unsigned int, struct inode *, | 1961 | extern int __ext4_check_dir_entry(const char *, unsigned int, struct inode *, |
1937 | struct file *, | 1962 | struct file *, |
1938 | struct ext4_dir_entry_2 *, | 1963 | struct ext4_dir_entry_2 *, |
1939 | struct buffer_head *, unsigned int); | 1964 | struct buffer_head *, char *, int, |
1940 | #define ext4_check_dir_entry(dir, filp, de, bh, offset) \ | 1965 | unsigned int); |
1966 | #define ext4_check_dir_entry(dir, filp, de, bh, buf, size, offset) \ | ||
1941 | unlikely(__ext4_check_dir_entry(__func__, __LINE__, (dir), (filp), \ | 1967 | unlikely(__ext4_check_dir_entry(__func__, __LINE__, (dir), (filp), \ |
1942 | (de), (bh), (offset))) | 1968 | (de), (bh), (buf), (size), (offset))) |
1943 | extern int ext4_htree_store_dirent(struct file *dir_file, __u32 hash, | 1969 | extern int ext4_htree_store_dirent(struct file *dir_file, __u32 hash, |
1944 | __u32 minor_hash, | 1970 | __u32 minor_hash, |
1945 | struct ext4_dir_entry_2 *dirent); | 1971 | struct ext4_dir_entry_2 *dirent); |
1946 | extern void ext4_htree_free_dir_info(struct dir_private_info *p); | 1972 | extern void ext4_htree_free_dir_info(struct dir_private_info *p); |
1973 | extern int ext4_find_dest_de(struct inode *dir, struct inode *inode, | ||
1974 | struct buffer_head *bh, | ||
1975 | void *buf, int buf_size, | ||
1976 | const char *name, int namelen, | ||
1977 | struct ext4_dir_entry_2 **dest_de); | ||
1978 | void ext4_insert_dentry(struct inode *inode, | ||
1979 | struct ext4_dir_entry_2 *de, | ||
1980 | int buf_size, | ||
1981 | const char *name, int namelen); | ||
1982 | static inline void ext4_update_dx_flag(struct inode *inode) | ||
1983 | { | ||
1984 | if (!EXT4_HAS_COMPAT_FEATURE(inode->i_sb, | ||
1985 | EXT4_FEATURE_COMPAT_DIR_INDEX)) | ||
1986 | ext4_clear_inode_flag(inode, EXT4_INODE_INDEX); | ||
1987 | } | ||
1988 | static unsigned char ext4_filetype_table[] = { | ||
1989 | DT_UNKNOWN, DT_REG, DT_DIR, DT_CHR, DT_BLK, DT_FIFO, DT_SOCK, DT_LNK | ||
1990 | }; | ||
1991 | |||
1992 | static inline unsigned char get_dtype(struct super_block *sb, int filetype) | ||
1993 | { | ||
1994 | if (!EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FILETYPE) || | ||
1995 | (filetype >= EXT4_FT_MAX)) | ||
1996 | return DT_UNKNOWN; | ||
1997 | |||
1998 | return ext4_filetype_table[filetype]; | ||
1999 | } | ||
1947 | 2000 | ||
1948 | /* fsync.c */ | 2001 | /* fsync.c */ |
1949 | 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); |
@@ -1994,8 +2047,23 @@ struct buffer_head *ext4_getblk(handle_t *, struct inode *, | |||
1994 | ext4_lblk_t, int, int *); | 2047 | ext4_lblk_t, int, int *); |
1995 | struct buffer_head *ext4_bread(handle_t *, struct inode *, | 2048 | struct buffer_head *ext4_bread(handle_t *, struct inode *, |
1996 | ext4_lblk_t, int, int *); | 2049 | ext4_lblk_t, int, int *); |
2050 | int ext4_get_block_write(struct inode *inode, sector_t iblock, | ||
2051 | struct buffer_head *bh_result, int create); | ||
1997 | int ext4_get_block(struct inode *inode, sector_t iblock, | 2052 | int ext4_get_block(struct inode *inode, sector_t iblock, |
1998 | struct buffer_head *bh_result, int create); | 2053 | struct buffer_head *bh_result, int create); |
2054 | int ext4_da_get_block_prep(struct inode *inode, sector_t iblock, | ||
2055 | struct buffer_head *bh, int create); | ||
2056 | int ext4_walk_page_buffers(handle_t *handle, | ||
2057 | struct buffer_head *head, | ||
2058 | unsigned from, | ||
2059 | unsigned to, | ||
2060 | int *partial, | ||
2061 | int (*fn)(handle_t *handle, | ||
2062 | struct buffer_head *bh)); | ||
2063 | int do_journal_get_write_access(handle_t *handle, | ||
2064 | struct buffer_head *bh); | ||
2065 | #define FALL_BACK_TO_NONDELALLOC 1 | ||
2066 | #define CONVERT_INLINE_DATA 2 | ||
1999 | 2067 | ||
2000 | extern struct inode *ext4_iget(struct super_block *, unsigned long); | 2068 | extern struct inode *ext4_iget(struct super_block *, unsigned long); |
2001 | extern int ext4_write_inode(struct inode *, struct writeback_control *); | 2069 | extern int ext4_write_inode(struct inode *, struct writeback_control *); |
@@ -2050,6 +2118,20 @@ extern int ext4_orphan_add(handle_t *, struct inode *); | |||
2050 | extern int ext4_orphan_del(handle_t *, struct inode *); | 2118 | extern int ext4_orphan_del(handle_t *, struct inode *); |
2051 | extern int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash, | 2119 | extern int ext4_htree_fill_tree(struct file *dir_file, __u32 start_hash, |
2052 | __u32 start_minor_hash, __u32 *next_hash); | 2120 | __u32 start_minor_hash, __u32 *next_hash); |
2121 | extern int search_dir(struct buffer_head *bh, | ||
2122 | char *search_buf, | ||
2123 | int buf_size, | ||
2124 | struct inode *dir, | ||
2125 | const struct qstr *d_name, | ||
2126 | unsigned int offset, | ||
2127 | struct ext4_dir_entry_2 **res_dir); | ||
2128 | extern int ext4_generic_delete_entry(handle_t *handle, | ||
2129 | struct inode *dir, | ||
2130 | struct ext4_dir_entry_2 *de_del, | ||
2131 | struct buffer_head *bh, | ||
2132 | void *entry_buf, | ||
2133 | int buf_size, | ||
2134 | int csum_size); | ||
2053 | 2135 | ||
2054 | /* resize.c */ | 2136 | /* resize.c */ |
2055 | extern int ext4_group_add(struct super_block *sb, | 2137 | extern int ext4_group_add(struct super_block *sb, |
@@ -2376,6 +2458,15 @@ extern void ext4_unwritten_wait(struct inode *inode); | |||
2376 | extern const struct inode_operations ext4_dir_inode_operations; | 2458 | extern const struct inode_operations ext4_dir_inode_operations; |
2377 | extern const struct inode_operations ext4_special_inode_operations; | 2459 | extern const struct inode_operations ext4_special_inode_operations; |
2378 | extern struct dentry *ext4_get_parent(struct dentry *child); | 2460 | extern struct dentry *ext4_get_parent(struct dentry *child); |
2461 | extern struct ext4_dir_entry_2 *ext4_init_dot_dotdot(struct inode *inode, | ||
2462 | struct ext4_dir_entry_2 *de, | ||
2463 | int blocksize, int csum_size, | ||
2464 | unsigned int parent_ino, int dotdot_real_len); | ||
2465 | extern void initialize_dirent_tail(struct ext4_dir_entry_tail *t, | ||
2466 | unsigned int blocksize); | ||
2467 | extern int ext4_handle_dirty_dirent_node(handle_t *handle, | ||
2468 | struct inode *inode, | ||
2469 | struct buffer_head *bh); | ||
2379 | 2470 | ||
2380 | /* symlink.c */ | 2471 | /* symlink.c */ |
2381 | extern const struct inode_operations ext4_symlink_inode_operations; | 2472 | extern const struct inode_operations ext4_symlink_inode_operations; |
@@ -2393,6 +2484,9 @@ extern int ext4_check_blockref(const char *, unsigned int, | |||
2393 | struct inode *, __le32 *, unsigned int); | 2484 | struct inode *, __le32 *, unsigned int); |
2394 | 2485 | ||
2395 | /* extents.c */ | 2486 | /* extents.c */ |
2487 | struct ext4_ext_path; | ||
2488 | struct ext4_extent; | ||
2489 | |||
2396 | extern int ext4_ext_tree_init(handle_t *handle, struct inode *); | 2490 | extern int ext4_ext_tree_init(handle_t *handle, struct inode *); |
2397 | extern int ext4_ext_writepage_trans_blocks(struct inode *, int); | 2491 | extern int ext4_ext_writepage_trans_blocks(struct inode *, int); |
2398 | extern int ext4_ext_index_trans_blocks(struct inode *inode, int nrblocks, | 2492 | extern int ext4_ext_index_trans_blocks(struct inode *inode, int nrblocks, |
@@ -2410,8 +2504,27 @@ extern int ext4_convert_unwritten_extents(struct inode *inode, loff_t offset, | |||
2410 | ssize_t len); | 2504 | ssize_t len); |
2411 | extern int ext4_map_blocks(handle_t *handle, struct inode *inode, | 2505 | extern int ext4_map_blocks(handle_t *handle, struct inode *inode, |
2412 | struct ext4_map_blocks *map, int flags); | 2506 | struct ext4_map_blocks *map, int flags); |
2507 | extern int ext4_ext_calc_metadata_amount(struct inode *inode, | ||
2508 | ext4_lblk_t lblocks); | ||
2509 | extern int ext4_extent_tree_init(handle_t *, struct inode *); | ||
2510 | extern int ext4_ext_calc_credits_for_single_extent(struct inode *inode, | ||
2511 | int num, | ||
2512 | struct ext4_ext_path *path); | ||
2513 | extern int ext4_can_extents_be_merged(struct inode *inode, | ||
2514 | struct ext4_extent *ex1, | ||
2515 | struct ext4_extent *ex2); | ||
2516 | extern int ext4_ext_insert_extent(handle_t *, struct inode *, | ||
2517 | struct ext4_ext_path *, | ||
2518 | struct ext4_extent *, int); | ||
2519 | extern struct ext4_ext_path *ext4_ext_find_extent(struct inode *, ext4_lblk_t, | ||
2520 | struct ext4_ext_path *); | ||
2521 | extern void ext4_ext_drop_refs(struct ext4_ext_path *); | ||
2522 | extern int ext4_ext_check_inode(struct inode *inode); | ||
2523 | extern int ext4_find_delalloc_cluster(struct inode *inode, ext4_lblk_t lblk); | ||
2413 | extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | 2524 | extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, |
2414 | __u64 start, __u64 len); | 2525 | __u64 start, __u64 len); |
2526 | |||
2527 | |||
2415 | /* move_extent.c */ | 2528 | /* move_extent.c */ |
2416 | extern int ext4_move_extents(struct file *o_filp, struct file *d_filp, | 2529 | extern int ext4_move_extents(struct file *o_filp, struct file *d_filp, |
2417 | __u64 start_orig, __u64 start_donor, | 2530 | __u64 start_orig, __u64 start_donor, |
@@ -2445,14 +2558,10 @@ enum ext4_state_bits { | |||
2445 | * never, ever appear in a buffer_head's state | 2558 | * never, ever appear in a buffer_head's state |
2446 | * flag. See EXT4_MAP_FROM_CLUSTER to see where | 2559 | * flag. See EXT4_MAP_FROM_CLUSTER to see where |
2447 | * this is used. */ | 2560 | * this is used. */ |
2448 | BH_Da_Mapped, /* Delayed allocated block that now has a mapping. This | ||
2449 | * flag is set when ext4_map_blocks is called on a | ||
2450 | * delayed allocated block to get its real mapping. */ | ||
2451 | }; | 2561 | }; |
2452 | 2562 | ||
2453 | BUFFER_FNS(Uninit, uninit) | 2563 | BUFFER_FNS(Uninit, uninit) |
2454 | TAS_BUFFER_FNS(Uninit, uninit) | 2564 | TAS_BUFFER_FNS(Uninit, uninit) |
2455 | BUFFER_FNS(Da_Mapped, da_mapped) | ||
2456 | 2565 | ||
2457 | /* | 2566 | /* |
2458 | * Add new method to test whether block and inode bitmaps are properly | 2567 | * Add new method to test whether block and inode bitmaps are properly |
@@ -2503,6 +2612,4 @@ extern void ext4_resize_end(struct super_block *sb); | |||
2503 | 2612 | ||
2504 | #endif /* __KERNEL__ */ | 2613 | #endif /* __KERNEL__ */ |
2505 | 2614 | ||
2506 | #include "ext4_extents.h" | ||
2507 | |||
2508 | #endif /* _EXT4_H */ | 2615 | #endif /* _EXT4_H */ |