Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
[pandora-kernel.git] / fs / ext4 / ext4.h
index b7ee66f..1de65f5 100644 (file)
@@ -561,7 +561,7 @@ struct ext4_new_group_data {
 #define EXT4_IOC32_SETVERSION_OLD      FS_IOC32_SETVERSION
 #endif
 
-/* Max physical block we can addres w/o extents */
+/* Max physical block we can address w/o extents */
 #define EXT4_MAX_BLOCK_FILE_PHYS       0xFFFFFFFF
 
 /*
@@ -738,12 +738,13 @@ do {                                                                             \
 
 /*
  * 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 */
-       __u32           ec_type;
 };
 
 /*
@@ -762,10 +763,12 @@ struct ext4_inode_info {
         * near to their parent directory's inode.
         */
        ext4_group_t    i_block_group;
+       ext4_lblk_t     i_dir_start_lookup;
+#if (BITS_PER_LONG < 64)
        unsigned long   i_state_flags;          /* Dynamic state flags */
+#endif
        unsigned long   i_flags;
 
-       ext4_lblk_t             i_dir_start_lookup;
 #ifdef CONFIG_EXT4_FS_XATTR
        /*
         * Extended attributes can be read independently of the main file
@@ -808,7 +811,7 @@ struct ext4_inode_info {
         */
        struct rw_semaphore i_data_sem;
        struct inode vfs_inode;
-       struct jbd2_inode jinode;
+       struct jbd2_inode *jinode;
 
        struct ext4_ext_cache i_cached_extent;
        /*
@@ -828,13 +831,12 @@ struct ext4_inode_info {
        unsigned int i_reserved_data_blocks;
        unsigned int i_reserved_meta_blocks;
        unsigned int i_allocated_meta_blocks;
-       sector_t i_da_metadata_calc_last_lblock;
+       ext4_lblk_t i_da_metadata_calc_last_lblock;
        int i_da_metadata_calc_len;
 
        /* on-disk additional length */
        __u16 i_extra_isize;
 
-       spinlock_t i_block_reservation_lock;
 #ifdef CONFIG_QUOTA
        /* quota space reservation, managed internally by quota code */
        qsize_t i_reserved_quota;
@@ -843,9 +845,11 @@ struct ext4_inode_info {
        /* completed IOs that might need unwritten extents handling */
        struct list_head i_completed_io_list;
        spinlock_t i_completed_io_lock;
+       atomic_t i_ioend_count; /* Number of outstanding io_end structs */
        /* current io_end structure for async DIO write*/
        ext4_io_end_t *cur_aio_dio;
-       atomic_t i_ioend_count; /* Number of outstanding io_end structs */
+
+       spinlock_t i_block_reservation_lock;
 
        /*
         * Transactions that contain inode's metadata needed to complete
@@ -1237,22 +1241,36 @@ enum {
        EXT4_STATE_DELALLOC_RESERVED,   /* blks already reserved for delalloc */
 };
 
-#define EXT4_INODE_BIT_FNS(name, field)                                        \
+#define EXT4_INODE_BIT_FNS(name, field, offset)                                \
 static inline int ext4_test_inode_##name(struct inode *inode, int bit) \
 {                                                                      \
-       return test_bit(bit, &EXT4_I(inode)->i_##field);                \
+       return test_bit(bit + (offset), &EXT4_I(inode)->i_##field);     \
 }                                                                      \
 static inline void ext4_set_inode_##name(struct inode *inode, int bit) \
 {                                                                      \
-       set_bit(bit, &EXT4_I(inode)->i_##field);                        \
+       set_bit(bit + (offset), &EXT4_I(inode)->i_##field);             \
 }                                                                      \
 static inline void ext4_clear_inode_##name(struct inode *inode, int bit) \
 {                                                                      \
-       clear_bit(bit, &EXT4_I(inode)->i_##field);                      \
+       clear_bit(bit + (offset), &EXT4_I(inode)->i_##field);           \
+}
+
+EXT4_INODE_BIT_FNS(flag, flags, 0)
+#if (BITS_PER_LONG < 64)
+EXT4_INODE_BIT_FNS(state, state_flags, 0)
+
+static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
+{
+       (ei)->i_state_flags = 0;
 }
+#else
+EXT4_INODE_BIT_FNS(state, flags, 32)
 
-EXT4_INODE_BIT_FNS(flag, flags)
-EXT4_INODE_BIT_FNS(state, state_flags)
+static inline void ext4_clear_state_flags(struct ext4_inode_info *ei)
+{
+       /* We depend on the fact that callers will set i_flags */
+}
+#endif
 #else
 /* Assume that user mode programs are passing in an ext4fs superblock, not
  * a kernel struct super_block.  This will allow us to call the feature-test
@@ -1653,6 +1671,7 @@ extern void ext4_htree_free_dir_info(struct dir_private_info *p);
 
 /* fsync.c */
 extern int ext4_sync_file(struct file *, int);
+extern int ext4_flush_completed_IO(struct inode *);
 
 /* hash.c */
 extern int ext4fs_dirhash(const char *name, int len, struct