diff options
author | Alex Tomas <alex@clusterfs.com> | 2006-10-11 04:21:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-11 14:14:16 -0400 |
commit | a86c61812637c7dd0c57e29880cffd477b62f2e7 (patch) | |
tree | 10737307293afde2999a887cfeac32c7d7584aa7 /include/linux/ext4_fs.h | |
parent | c3fcc8137ce4296ad6ab94f88bd60cbe03d21527 (diff) |
[PATCH] ext3: add extent map support
On disk extents format:
/*
* this is extent on-disk structure
* it's used at the bottom of the tree
*/
struct ext3_extent {
__le32 ee_block; /* first logical block extent covers */
__le16 ee_len; /* number of blocks covered by extent */
__le16 ee_start_hi; /* high 16 bits of physical block */
__le32 ee_start; /* low 32 bigs of physical block */
};
Signed-off-by: Alex Tomas <alex@clusterfs.com>
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/ext4_fs.h')
-rw-r--r-- | include/linux/ext4_fs.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h index f582cd762caf..b61181aadcbb 100644 --- a/include/linux/ext4_fs.h +++ b/include/linux/ext4_fs.h | |||
@@ -178,8 +178,9 @@ struct ext4_group_desc | |||
178 | #define EXT4_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ | 178 | #define EXT4_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ |
179 | #define EXT4_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ | 179 | #define EXT4_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ |
180 | #define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */ | 180 | #define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */ |
181 | #define EXT4_EXTENTS_FL 0x00080000 /* Inode uses extents */ | ||
181 | 182 | ||
182 | #define EXT4_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ | 183 | #define EXT4_FL_USER_VISIBLE 0x000BDFFF /* User visible flags */ |
183 | #define EXT4_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ | 184 | #define EXT4_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ |
184 | 185 | ||
185 | /* | 186 | /* |
@@ -384,6 +385,7 @@ struct ext4_inode { | |||
384 | #define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */ | 385 | #define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */ |
385 | #define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ | 386 | #define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ |
386 | #define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ | 387 | #define EXT4_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ |
388 | #define EXT4_MOUNT_EXTENTS 0x400000 /* Extents support */ | ||
387 | 389 | ||
388 | /* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */ | 390 | /* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */ |
389 | #ifndef _LINUX_EXT2_FS_H | 391 | #ifndef _LINUX_EXT2_FS_H |
@@ -582,11 +584,13 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) | |||
582 | #define EXT4_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */ | 584 | #define EXT4_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */ |
583 | #define EXT4_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 /* Journal device */ | 585 | #define EXT4_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 /* Journal device */ |
584 | #define EXT4_FEATURE_INCOMPAT_META_BG 0x0010 | 586 | #define EXT4_FEATURE_INCOMPAT_META_BG 0x0010 |
587 | #define EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040 /* extents support */ | ||
585 | 588 | ||
586 | #define EXT4_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR | 589 | #define EXT4_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR |
587 | #define EXT4_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \ | 590 | #define EXT4_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \ |
588 | EXT4_FEATURE_INCOMPAT_RECOVER| \ | 591 | EXT4_FEATURE_INCOMPAT_RECOVER| \ |
589 | EXT4_FEATURE_INCOMPAT_META_BG) | 592 | EXT4_FEATURE_INCOMPAT_META_BG| \ |
593 | EXT4_FEATURE_INCOMPAT_EXTENTS) | ||
590 | #define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ | 594 | #define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ |
591 | EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ | 595 | EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ |
592 | EXT4_FEATURE_RO_COMPAT_BTREE_DIR) | 596 | EXT4_FEATURE_RO_COMPAT_BTREE_DIR) |
@@ -825,6 +829,9 @@ extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); | |||
825 | extern void ext4_truncate (struct inode *); | 829 | extern void ext4_truncate (struct inode *); |
826 | extern void ext4_set_inode_flags(struct inode *); | 830 | extern void ext4_set_inode_flags(struct inode *); |
827 | extern void ext4_set_aops(struct inode *inode); | 831 | extern void ext4_set_aops(struct inode *inode); |
832 | extern int ext4_writepage_trans_blocks(struct inode *); | ||
833 | extern int ext4_block_truncate_page(handle_t *handle, struct page *page, | ||
834 | struct address_space *mapping, loff_t from); | ||
828 | 835 | ||
829 | /* ioctl.c */ | 836 | /* ioctl.c */ |
830 | extern int ext4_ioctl (struct inode *, struct file *, unsigned int, | 837 | extern int ext4_ioctl (struct inode *, struct file *, unsigned int, |
@@ -879,6 +886,28 @@ extern struct inode_operations ext4_special_inode_operations; | |||
879 | extern struct inode_operations ext4_symlink_inode_operations; | 886 | extern struct inode_operations ext4_symlink_inode_operations; |
880 | extern struct inode_operations ext4_fast_symlink_inode_operations; | 887 | extern struct inode_operations ext4_fast_symlink_inode_operations; |
881 | 888 | ||
889 | /* extents.c */ | ||
890 | extern int ext4_ext_tree_init(handle_t *handle, struct inode *); | ||
891 | extern int ext4_ext_writepage_trans_blocks(struct inode *, int); | ||
892 | extern int ext4_ext_get_blocks(handle_t *handle, struct inode *inode, | ||
893 | ext4_fsblk_t iblock, | ||
894 | unsigned long max_blocks, struct buffer_head *bh_result, | ||
895 | int create, int extend_disksize); | ||
896 | extern void ext4_ext_truncate(struct inode *, struct page *); | ||
897 | extern void ext4_ext_init(struct super_block *); | ||
898 | extern void ext4_ext_release(struct super_block *); | ||
899 | static inline int | ||
900 | ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block, | ||
901 | unsigned long max_blocks, struct buffer_head *bh, | ||
902 | int create, int extend_disksize) | ||
903 | { | ||
904 | if (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) | ||
905 | return ext4_ext_get_blocks(handle, inode, block, max_blocks, | ||
906 | bh, create, extend_disksize); | ||
907 | return ext4_get_blocks_handle(handle, inode, block, max_blocks, bh, | ||
908 | create, extend_disksize); | ||
909 | } | ||
910 | |||
882 | 911 | ||
883 | #endif /* __KERNEL__ */ | 912 | #endif /* __KERNEL__ */ |
884 | 913 | ||