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.h41
1 files changed, 11 insertions, 30 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index db3f772e57ae..a75fba67bb1f 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -158,17 +158,8 @@ struct ext4_allocation_request {
158#define EXT4_MAP_MAPPED (1 << BH_Mapped) 158#define EXT4_MAP_MAPPED (1 << BH_Mapped)
159#define EXT4_MAP_UNWRITTEN (1 << BH_Unwritten) 159#define EXT4_MAP_UNWRITTEN (1 << BH_Unwritten)
160#define EXT4_MAP_BOUNDARY (1 << BH_Boundary) 160#define EXT4_MAP_BOUNDARY (1 << BH_Boundary)
161/* Sometimes (in the bigalloc case, from ext4_da_get_block_prep) the caller of
162 * ext4_map_blocks wants to know whether or not the underlying cluster has
163 * already been accounted for. EXT4_MAP_FROM_CLUSTER conveys to the caller that
164 * the requested mapping was from previously mapped (or delayed allocated)
165 * cluster. We use BH_AllocFromCluster only for this flag. BH_AllocFromCluster
166 * should never appear on buffer_head's state flags.
167 */
168#define EXT4_MAP_FROM_CLUSTER (1 << BH_AllocFromCluster)
169#define EXT4_MAP_FLAGS (EXT4_MAP_NEW | EXT4_MAP_MAPPED |\ 161#define EXT4_MAP_FLAGS (EXT4_MAP_NEW | EXT4_MAP_MAPPED |\
170 EXT4_MAP_UNWRITTEN | EXT4_MAP_BOUNDARY |\ 162 EXT4_MAP_UNWRITTEN | EXT4_MAP_BOUNDARY)
171 EXT4_MAP_FROM_CLUSTER)
172 163
173struct ext4_map_blocks { 164struct ext4_map_blocks {
174 ext4_fsblk_t m_pblk; 165 ext4_fsblk_t m_pblk;
@@ -565,10 +556,8 @@ enum {
565#define EXT4_GET_BLOCKS_KEEP_SIZE 0x0080 556#define EXT4_GET_BLOCKS_KEEP_SIZE 0x0080
566 /* Do not take i_data_sem locking in ext4_map_blocks */ 557 /* Do not take i_data_sem locking in ext4_map_blocks */
567#define EXT4_GET_BLOCKS_NO_LOCK 0x0100 558#define EXT4_GET_BLOCKS_NO_LOCK 0x0100
568 /* Do not put hole in extent cache */
569#define EXT4_GET_BLOCKS_NO_PUT_HOLE 0x0200
570 /* Convert written extents to unwritten */ 559 /* Convert written extents to unwritten */
571#define EXT4_GET_BLOCKS_CONVERT_UNWRITTEN 0x0400 560#define EXT4_GET_BLOCKS_CONVERT_UNWRITTEN 0x0200
572 561
573/* 562/*
574 * The bit position of these flags must not overlap with any of the 563 * The bit position of these flags must not overlap with any of the
@@ -889,10 +878,12 @@ struct ext4_inode_info {
889 /* extents status tree */ 878 /* extents status tree */
890 struct ext4_es_tree i_es_tree; 879 struct ext4_es_tree i_es_tree;
891 rwlock_t i_es_lock; 880 rwlock_t i_es_lock;
892 struct list_head i_es_lru; 881 struct list_head i_es_list;
893 unsigned int i_es_all_nr; /* protected by i_es_lock */ 882 unsigned int i_es_all_nr; /* protected by i_es_lock */
894 unsigned int i_es_lru_nr; /* protected by i_es_lock */ 883 unsigned int i_es_shk_nr; /* protected by i_es_lock */
895 unsigned long i_touch_when; /* jiffies of last accessing */ 884 ext4_lblk_t i_es_shrink_lblk; /* Offset where we start searching for
885 extents to shrink. Protected by
886 i_es_lock */
896 887
897 /* ialloc */ 888 /* ialloc */
898 ext4_group_t i_last_alloc_group; 889 ext4_group_t i_last_alloc_group;
@@ -1337,10 +1328,11 @@ struct ext4_sb_info {
1337 1328
1338 /* Reclaim extents from extent status tree */ 1329 /* Reclaim extents from extent status tree */
1339 struct shrinker s_es_shrinker; 1330 struct shrinker s_es_shrinker;
1340 struct list_head s_es_lru; 1331 struct list_head s_es_list; /* List of inodes with reclaimable extents */
1332 long s_es_nr_inode;
1341 struct ext4_es_stats s_es_stats; 1333 struct ext4_es_stats s_es_stats;
1342 struct mb_cache *s_mb_cache; 1334 struct mb_cache *s_mb_cache;
1343 spinlock_t s_es_lru_lock ____cacheline_aligned_in_smp; 1335 spinlock_t s_es_lock ____cacheline_aligned_in_smp;
1344 1336
1345 /* Ratelimit ext4 messages. */ 1337 /* Ratelimit ext4 messages. */
1346 struct ratelimit_state s_err_ratelimit_state; 1338 struct ratelimit_state s_err_ratelimit_state;
@@ -2196,7 +2188,6 @@ extern int ext4_calculate_overhead(struct super_block *sb);
2196extern void ext4_superblock_csum_set(struct super_block *sb); 2188extern void ext4_superblock_csum_set(struct super_block *sb);
2197extern void *ext4_kvmalloc(size_t size, gfp_t flags); 2189extern void *ext4_kvmalloc(size_t size, gfp_t flags);
2198extern void *ext4_kvzalloc(size_t size, gfp_t flags); 2190extern void *ext4_kvzalloc(size_t size, gfp_t flags);
2199extern void ext4_kvfree(void *ptr);
2200extern int ext4_alloc_flex_bg_array(struct super_block *sb, 2191extern int ext4_alloc_flex_bg_array(struct super_block *sb,
2201 ext4_group_t ngroup); 2192 ext4_group_t ngroup);
2202extern const char *ext4_decode_error(struct super_block *sb, int errno, 2193extern const char *ext4_decode_error(struct super_block *sb, int errno,
@@ -2647,7 +2638,7 @@ extern struct buffer_head *ext4_get_first_inline_block(struct inode *inode,
2647 int *retval); 2638 int *retval);
2648extern int ext4_inline_data_fiemap(struct inode *inode, 2639extern int ext4_inline_data_fiemap(struct inode *inode,
2649 struct fiemap_extent_info *fieinfo, 2640 struct fiemap_extent_info *fieinfo,
2650 int *has_inline); 2641 int *has_inline, __u64 start, __u64 len);
2651extern int ext4_try_to_evict_inline_data(handle_t *handle, 2642extern int ext4_try_to_evict_inline_data(handle_t *handle,
2652 struct inode *inode, 2643 struct inode *inode,
2653 int needed); 2644 int needed);
@@ -2795,16 +2786,6 @@ extern int ext4_bio_write_page(struct ext4_io_submit *io,
2795extern int ext4_multi_mount_protect(struct super_block *, ext4_fsblk_t); 2786extern int ext4_multi_mount_protect(struct super_block *, ext4_fsblk_t);
2796 2787
2797/* 2788/*
2798 * Note that these flags will never ever appear in a buffer_head's state flag.
2799 * See EXT4_MAP_... to see where this is used.
2800 */
2801enum ext4_state_bits {
2802 BH_AllocFromCluster /* allocated blocks were part of already
2803 * allocated cluster. */
2804 = BH_JBDPrivateStart
2805};
2806
2807/*
2808 * Add new method to test whether block and inode bitmaps are properly 2789 * Add new method to test whether block and inode bitmaps are properly
2809 * initialized. With uninit_bg reading the block from disk is not enough 2790 * initialized. With uninit_bg reading the block from disk is not enough
2810 * to mark the bitmap uptodate. We need to also zero-out the bitmap 2791 * to mark the bitmap uptodate. We need to also zero-out the bitmap