ARM: mach-shmobile: mackerel: enable REGULATOR in defconfig
[firefly-linux-kernel-4.4.55.git] / fs / ext4 / ext4.h
index fc1c0375c9f2e9d55dbdd79c66eb25a7bb48fef2..4a01ba315262259241081ec695c1f1d3d179eb32 100644 (file)
@@ -579,6 +579,8 @@ enum {
 #define EXT4_GET_BLOCKS_KEEP_SIZE              0x0080
        /* Do not take i_data_sem locking in ext4_map_blocks */
 #define EXT4_GET_BLOCKS_NO_LOCK                        0x0100
+       /* Do not put hole in extent cache */
+#define EXT4_GET_BLOCKS_NO_PUT_HOLE            0x0200
 
 /*
  * Flags used by ext4_free_blocks
@@ -807,17 +809,6 @@ do {                                                                              \
 
 #endif /* defined(__KERNEL__) || defined(__linux__) */
 
-/*
- * storage for cached extent
- * If ec_len == 0, then the cache is invalid.
- * If ec_start == 0, then the cache represents a gap (null mapping)
- */
-struct ext4_ext_cache {
-       ext4_fsblk_t    ec_start;
-       ext4_lblk_t     ec_block;
-       __u32           ec_len; /* must be 32bit to return holes */
-};
-
 #include "extents_status.h"
 
 /*
@@ -884,7 +875,6 @@ struct ext4_inode_info {
        struct inode vfs_inode;
        struct jbd2_inode *jinode;
 
-       struct ext4_ext_cache i_cached_extent;
        /*
         * File creation time. Its function is same as that of
         * struct timespec i_{a,c,m}time in the generic inode.
@@ -898,6 +888,8 @@ struct ext4_inode_info {
        /* extents status tree */
        struct ext4_es_tree i_es_tree;
        rwlock_t i_es_lock;
+       struct list_head i_es_lru;
+       unsigned int i_es_lru_nr;       /* protected by i_es_lock */
 
        /* ialloc */
        ext4_group_t    i_last_alloc_group;
@@ -1313,6 +1305,12 @@ struct ext4_sb_info {
 
        /* Precomputed FS UUID checksum for seeding other checksums */
        __u32 s_csum_seed;
+
+       /* Reclaim extents from extent status tree */
+       struct shrinker s_es_shrinker;
+       struct list_head s_es_lru;
+       struct percpu_counter s_extent_cache_cnt;
+       spinlock_t s_es_lru_lock ____cacheline_aligned_in_smp;
 };
 
 static inline struct ext4_sb_info *EXT4_SB(struct super_block *sb)
@@ -2602,6 +2600,9 @@ extern struct ext4_ext_path *ext4_ext_find_extent(struct inode *, ext4_lblk_t,
                                                  struct ext4_ext_path *);
 extern void ext4_ext_drop_refs(struct ext4_ext_path *);
 extern int ext4_ext_check_inode(struct inode *inode);
+extern int ext4_find_delalloc_range(struct inode *inode,
+                                   ext4_lblk_t lblk_start,
+                                   ext4_lblk_t lblk_end);
 extern int ext4_find_delalloc_cluster(struct inode *inode, ext4_lblk_t lblk);
 extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
                        __u64 start, __u64 len);