]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/ext4_fs.h
ext4: Make ext4_get_blocks_wrap take the truncate_mutex early.
[linux-2.6-omap-h63xx.git] / include / linux / ext4_fs.h
index be25eca9c040cc0ba6b250b4dd2ad6aa341dd7ca..583049c1d366120aabd20ffd0da0b16e64d148ab 100644 (file)
@@ -118,6 +118,11 @@ struct ext4_group_desc
        __le32  bg_block_bitmap_hi;     /* Blocks bitmap block MSB */
        __le32  bg_inode_bitmap_hi;     /* Inodes bitmap block MSB */
        __le32  bg_inode_table_hi;      /* Inodes table block MSB */
+       __le16  bg_free_blocks_count_hi;/* Free blocks count MSB */
+       __le16  bg_free_inodes_count_hi;/* Free inodes count MSB */
+       __le16  bg_used_dirs_count_hi;  /* Directories count MSB */
+       __le16  bg_itable_unused_hi;    /* Unused inodes count MSB */
+       __u32   bg_reserved2[3];
 };
 
 #define EXT4_BG_INODE_UNINIT   0x0001 /* Inode table/bitmap not in use */
@@ -178,8 +183,9 @@ struct ext4_group_desc
 #define EXT4_NOTAIL_FL                 0x00008000 /* file tail should not be merged */
 #define EXT4_DIRSYNC_FL                        0x00010000 /* dirsync behaviour (directories only) */
 #define EXT4_TOPDIR_FL                 0x00020000 /* Top of directory hierarchies*/
-#define EXT4_RESERVED_FL               0x80000000 /* reserved for ext4 lib */
+#define EXT4_HUGE_FILE_FL               0x00040000 /* Set to each huge file */
 #define EXT4_EXTENTS_FL                        0x00080000 /* Inode uses extents */
+#define EXT4_RESERVED_FL               0x80000000 /* reserved for ext4 lib */
 
 #define EXT4_FL_USER_VISIBLE           0x000BDFFF /* User visible flags */
 #define EXT4_FL_USER_MODIFIABLE                0x000380FF /* User modifiable flags */
@@ -1107,6 +1113,7 @@ ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
                        int create, int extend_disksize)
 {
        int retval;
+       mutex_lock(&EXT4_I(inode)->truncate_mutex);
        if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) {
                retval = ext4_ext_get_blocks(handle, inode,
                                                (ext4_lblk_t)block, max_blocks,
@@ -1116,6 +1123,7 @@ ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
                                                (ext4_lblk_t)block, max_blocks,
                                                bh, create, extend_disksize);
        }
+       mutex_unlock(&EXT4_I(inode)->truncate_mutex);
        return retval;
 }