diff options
Diffstat (limited to 'fs/ext4/ext4.h')
| -rw-r--r-- | fs/ext4/ext4.h | 133 |
1 files changed, 87 insertions, 46 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 295003241d3d..6690a41cdd9f 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
| @@ -44,9 +44,9 @@ | |||
| 44 | #ifdef EXT4FS_DEBUG | 44 | #ifdef EXT4FS_DEBUG |
| 45 | #define ext4_debug(f, a...) \ | 45 | #define ext4_debug(f, a...) \ |
| 46 | do { \ | 46 | do { \ |
| 47 | printk (KERN_DEBUG "EXT4-fs DEBUG (%s, %d): %s:", \ | 47 | printk(KERN_DEBUG "EXT4-fs DEBUG (%s, %d): %s:", \ |
| 48 | __FILE__, __LINE__, __func__); \ | 48 | __FILE__, __LINE__, __func__); \ |
| 49 | printk (KERN_DEBUG f, ## a); \ | 49 | printk(KERN_DEBUG f, ## a); \ |
| 50 | } while (0) | 50 | } while (0) |
| 51 | #else | 51 | #else |
| 52 | #define ext4_debug(f, a...) do {} while (0) | 52 | #define ext4_debug(f, a...) do {} while (0) |
| @@ -128,7 +128,7 @@ struct ext4_allocation_request { | |||
| 128 | #else | 128 | #else |
| 129 | # define EXT4_BLOCK_SIZE(s) (EXT4_MIN_BLOCK_SIZE << (s)->s_log_block_size) | 129 | # define EXT4_BLOCK_SIZE(s) (EXT4_MIN_BLOCK_SIZE << (s)->s_log_block_size) |
| 130 | #endif | 130 | #endif |
| 131 | #define EXT4_ADDR_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / sizeof (__u32)) | 131 | #define EXT4_ADDR_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / sizeof(__u32)) |
| 132 | #ifdef __KERNEL__ | 132 | #ifdef __KERNEL__ |
| 133 | # define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits) | 133 | # define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits) |
| 134 | #else | 134 | #else |
| @@ -245,7 +245,7 @@ struct flex_groups { | |||
| 245 | #define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */ | 245 | #define EXT4_RESERVED_FL 0x80000000 /* reserved for ext4 lib */ |
| 246 | 246 | ||
| 247 | #define EXT4_FL_USER_VISIBLE 0x000BDFFF /* User visible flags */ | 247 | #define EXT4_FL_USER_VISIBLE 0x000BDFFF /* User visible flags */ |
| 248 | #define EXT4_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ | 248 | #define EXT4_FL_USER_MODIFIABLE 0x000B80FF /* User modifiable flags */ |
| 249 | 249 | ||
| 250 | /* | 250 | /* |
| 251 | * Inode dynamic state flags | 251 | * Inode dynamic state flags |
| @@ -291,8 +291,6 @@ struct ext4_new_group_data { | |||
| 291 | #define EXT4_IOC_SETFLAGS FS_IOC_SETFLAGS | 291 | #define EXT4_IOC_SETFLAGS FS_IOC_SETFLAGS |
| 292 | #define EXT4_IOC_GETVERSION _IOR('f', 3, long) | 292 | #define EXT4_IOC_GETVERSION _IOR('f', 3, long) |
| 293 | #define EXT4_IOC_SETVERSION _IOW('f', 4, long) | 293 | #define EXT4_IOC_SETVERSION _IOW('f', 4, long) |
| 294 | #define EXT4_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) | ||
| 295 | #define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input) | ||
| 296 | #define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION | 294 | #define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION |
| 297 | #define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION | 295 | #define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION |
| 298 | #ifdef CONFIG_JBD2_DEBUG | 296 | #ifdef CONFIG_JBD2_DEBUG |
| @@ -300,7 +298,10 @@ struct ext4_new_group_data { | |||
| 300 | #endif | 298 | #endif |
| 301 | #define EXT4_IOC_GETRSVSZ _IOR('f', 5, long) | 299 | #define EXT4_IOC_GETRSVSZ _IOR('f', 5, long) |
| 302 | #define EXT4_IOC_SETRSVSZ _IOW('f', 6, long) | 300 | #define EXT4_IOC_SETRSVSZ _IOW('f', 6, long) |
| 303 | #define EXT4_IOC_MIGRATE _IO('f', 7) | 301 | #define EXT4_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) |
| 302 | #define EXT4_IOC_GROUP_ADD _IOW('f', 8, struct ext4_new_group_input) | ||
| 303 | #define EXT4_IOC_MIGRATE _IO('f', 9) | ||
| 304 | /* note ioctl 11 reserved for filesystem-independent FIEMAP ioctl */ | ||
| 304 | 305 | ||
| 305 | /* | 306 | /* |
| 306 | * ioctl commands in 32 bit emulation | 307 | * ioctl commands in 32 bit emulation |
| @@ -538,8 +539,9 @@ do { \ | |||
| 538 | #define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */ | 539 | #define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */ |
| 539 | #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */ | 540 | #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */ |
| 540 | #define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version support */ | 541 | #define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version support */ |
| 541 | #define EXT4_MOUNT_MBALLOC 0x4000000 /* Buddy allocation support */ | ||
| 542 | #define EXT4_MOUNT_DELALLOC 0x8000000 /* Delalloc support */ | 542 | #define EXT4_MOUNT_DELALLOC 0x8000000 /* Delalloc support */ |
| 543 | #define EXT4_MOUNT_DATA_ERR_ABORT 0x10000000 /* Abort on file data write */ | ||
| 544 | |||
| 543 | /* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */ | 545 | /* Compatibility, for having both ext2_fs.h and ext4_fs.h included at once */ |
| 544 | #ifndef _LINUX_EXT2_FS_H | 546 | #ifndef _LINUX_EXT2_FS_H |
| 545 | #define clear_opt(o, opt) o &= ~EXT4_MOUNT_##opt | 547 | #define clear_opt(o, opt) o &= ~EXT4_MOUNT_##opt |
| @@ -667,7 +669,7 @@ struct ext4_super_block { | |||
| 667 | }; | 669 | }; |
| 668 | 670 | ||
| 669 | #ifdef __KERNEL__ | 671 | #ifdef __KERNEL__ |
| 670 | static inline struct ext4_sb_info * EXT4_SB(struct super_block *sb) | 672 | static inline struct ext4_sb_info *EXT4_SB(struct super_block *sb) |
| 671 | { | 673 | { |
| 672 | return sb->s_fs_info; | 674 | return sb->s_fs_info; |
| 673 | } | 675 | } |
| @@ -725,11 +727,11 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) | |||
| 725 | */ | 727 | */ |
| 726 | 728 | ||
| 727 | #define EXT4_HAS_COMPAT_FEATURE(sb,mask) \ | 729 | #define EXT4_HAS_COMPAT_FEATURE(sb,mask) \ |
| 728 | ( EXT4_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) ) | 730 | (EXT4_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask)) |
| 729 | #define EXT4_HAS_RO_COMPAT_FEATURE(sb,mask) \ | 731 | #define EXT4_HAS_RO_COMPAT_FEATURE(sb,mask) \ |
| 730 | ( EXT4_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) ) | 732 | (EXT4_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask)) |
| 731 | #define EXT4_HAS_INCOMPAT_FEATURE(sb,mask) \ | 733 | #define EXT4_HAS_INCOMPAT_FEATURE(sb,mask) \ |
| 732 | ( EXT4_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) ) | 734 | (EXT4_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask)) |
| 733 | #define EXT4_SET_COMPAT_FEATURE(sb,mask) \ | 735 | #define EXT4_SET_COMPAT_FEATURE(sb,mask) \ |
| 734 | EXT4_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask) | 736 | EXT4_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask) |
| 735 | #define EXT4_SET_RO_COMPAT_FEATURE(sb,mask) \ | 737 | #define EXT4_SET_RO_COMPAT_FEATURE(sb,mask) \ |
| @@ -789,6 +791,8 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) | |||
| 789 | #define EXT4_DEF_RESUID 0 | 791 | #define EXT4_DEF_RESUID 0 |
| 790 | #define EXT4_DEF_RESGID 0 | 792 | #define EXT4_DEF_RESGID 0 |
| 791 | 793 | ||
| 794 | #define EXT4_DEF_INODE_READAHEAD_BLKS 32 | ||
| 795 | |||
| 792 | /* | 796 | /* |
| 793 | * Default mount options | 797 | * Default mount options |
| 794 | */ | 798 | */ |
| @@ -954,6 +958,24 @@ ext4_group_first_block_no(struct super_block *sb, ext4_group_t group_no) | |||
| 954 | void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, | 958 | void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, |
| 955 | unsigned long *blockgrpp, ext4_grpblk_t *offsetp); | 959 | unsigned long *blockgrpp, ext4_grpblk_t *offsetp); |
| 956 | 960 | ||
| 961 | extern struct proc_dir_entry *ext4_proc_root; | ||
| 962 | |||
| 963 | #ifdef CONFIG_PROC_FS | ||
| 964 | extern const struct file_operations ext4_ui_proc_fops; | ||
| 965 | |||
| 966 | #define EXT4_PROC_HANDLER(name, var) \ | ||
| 967 | do { \ | ||
| 968 | proc = proc_create_data(name, mode, sbi->s_proc, \ | ||
| 969 | &ext4_ui_proc_fops, &sbi->s_##var); \ | ||
| 970 | if (proc == NULL) { \ | ||
| 971 | printk(KERN_ERR "EXT4-fs: can't create %s\n", name); \ | ||
| 972 | goto err_out; \ | ||
| 973 | } \ | ||
| 974 | } while (0) | ||
| 975 | #else | ||
| 976 | #define EXT4_PROC_HANDLER(name, var) | ||
| 977 | #endif | ||
| 978 | |||
| 957 | /* | 979 | /* |
| 958 | * Function prototypes | 980 | * Function prototypes |
| 959 | */ | 981 | */ |
| @@ -981,23 +1003,20 @@ extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode, | |||
| 981 | extern ext4_fsblk_t ext4_new_blocks(handle_t *handle, struct inode *inode, | 1003 | extern ext4_fsblk_t ext4_new_blocks(handle_t *handle, struct inode *inode, |
| 982 | ext4_lblk_t iblock, ext4_fsblk_t goal, | 1004 | ext4_lblk_t iblock, ext4_fsblk_t goal, |
| 983 | unsigned long *count, int *errp); | 1005 | unsigned long *count, int *errp); |
| 984 | extern ext4_fsblk_t ext4_old_new_blocks(handle_t *handle, struct inode *inode, | 1006 | extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi, s64 nblocks); |
| 985 | ext4_fsblk_t goal, unsigned long *count, int *errp); | ||
| 986 | extern ext4_fsblk_t ext4_has_free_blocks(struct ext4_sb_info *sbi, | 1007 | extern ext4_fsblk_t ext4_has_free_blocks(struct ext4_sb_info *sbi, |
| 987 | ext4_fsblk_t nblocks); | 1008 | s64 nblocks); |
| 988 | extern void ext4_free_blocks (handle_t *handle, struct inode *inode, | 1009 | extern void ext4_free_blocks(handle_t *handle, struct inode *inode, |
| 989 | ext4_fsblk_t block, unsigned long count, int metadata); | 1010 | ext4_fsblk_t block, unsigned long count, int metadata); |
| 990 | extern void ext4_free_blocks_sb (handle_t *handle, struct super_block *sb, | 1011 | extern void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb, |
| 991 | ext4_fsblk_t block, unsigned long count, | 1012 | ext4_fsblk_t block, unsigned long count, |
| 992 | unsigned long *pdquot_freed_blocks); | 1013 | unsigned long *pdquot_freed_blocks); |
| 993 | extern ext4_fsblk_t ext4_count_free_blocks (struct super_block *); | 1014 | extern ext4_fsblk_t ext4_count_free_blocks(struct super_block *); |
| 994 | extern void ext4_check_blocks_bitmap (struct super_block *); | 1015 | extern void ext4_check_blocks_bitmap(struct super_block *); |
| 995 | extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb, | 1016 | extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb, |
| 996 | ext4_group_t block_group, | 1017 | ext4_group_t block_group, |
| 997 | struct buffer_head ** bh); | 1018 | struct buffer_head ** bh); |
| 998 | extern int ext4_should_retry_alloc(struct super_block *sb, int *retries); | 1019 | extern int ext4_should_retry_alloc(struct super_block *sb, int *retries); |
| 999 | extern void ext4_init_block_alloc_info(struct inode *); | ||
| 1000 | extern void ext4_rsv_window_add(struct super_block *sb, struct ext4_reserve_window_node *rsv); | ||
| 1001 | 1020 | ||
| 1002 | /* dir.c */ | 1021 | /* dir.c */ |
| 1003 | extern int ext4_check_dir_entry(const char *, struct inode *, | 1022 | extern int ext4_check_dir_entry(const char *, struct inode *, |
| @@ -1009,20 +1028,20 @@ extern int ext4_htree_store_dirent(struct file *dir_file, __u32 hash, | |||
| 1009 | extern void ext4_htree_free_dir_info(struct dir_private_info *p); | 1028 | extern void ext4_htree_free_dir_info(struct dir_private_info *p); |
| 1010 | 1029 | ||
| 1011 | /* fsync.c */ | 1030 | /* fsync.c */ |
| 1012 | extern int ext4_sync_file (struct file *, struct dentry *, int); | 1031 | extern int ext4_sync_file(struct file *, struct dentry *, int); |
| 1013 | 1032 | ||
| 1014 | /* hash.c */ | 1033 | /* hash.c */ |
| 1015 | extern int ext4fs_dirhash(const char *name, int len, struct | 1034 | extern int ext4fs_dirhash(const char *name, int len, struct |
| 1016 | dx_hash_info *hinfo); | 1035 | dx_hash_info *hinfo); |
| 1017 | 1036 | ||
| 1018 | /* ialloc.c */ | 1037 | /* ialloc.c */ |
| 1019 | extern struct inode * ext4_new_inode (handle_t *, struct inode *, int); | 1038 | extern struct inode * ext4_new_inode(handle_t *, struct inode *, int); |
| 1020 | extern void ext4_free_inode (handle_t *, struct inode *); | 1039 | extern void ext4_free_inode(handle_t *, struct inode *); |
| 1021 | extern struct inode * ext4_orphan_get (struct super_block *, unsigned long); | 1040 | extern struct inode * ext4_orphan_get(struct super_block *, unsigned long); |
| 1022 | extern unsigned long ext4_count_free_inodes (struct super_block *); | 1041 | extern unsigned long ext4_count_free_inodes(struct super_block *); |
| 1023 | extern unsigned long ext4_count_dirs (struct super_block *); | 1042 | extern unsigned long ext4_count_dirs(struct super_block *); |
| 1024 | extern void ext4_check_inodes_bitmap (struct super_block *); | 1043 | extern void ext4_check_inodes_bitmap(struct super_block *); |
| 1025 | extern unsigned long ext4_count_free (struct buffer_head *, unsigned); | 1044 | extern unsigned long ext4_count_free(struct buffer_head *, unsigned); |
| 1026 | 1045 | ||
| 1027 | /* mballoc.c */ | 1046 | /* mballoc.c */ |
| 1028 | extern long ext4_mb_stats; | 1047 | extern long ext4_mb_stats; |
| @@ -1032,7 +1051,7 @@ extern int ext4_mb_release(struct super_block *); | |||
| 1032 | extern ext4_fsblk_t ext4_mb_new_blocks(handle_t *, | 1051 | extern ext4_fsblk_t ext4_mb_new_blocks(handle_t *, |
| 1033 | struct ext4_allocation_request *, int *); | 1052 | struct ext4_allocation_request *, int *); |
| 1034 | extern int ext4_mb_reserve_blocks(struct super_block *, int); | 1053 | extern int ext4_mb_reserve_blocks(struct super_block *, int); |
| 1035 | extern void ext4_mb_discard_inode_preallocations(struct inode *); | 1054 | extern void ext4_discard_preallocations(struct inode *); |
| 1036 | extern int __init init_ext4_mballoc(void); | 1055 | extern int __init init_ext4_mballoc(void); |
| 1037 | extern void exit_ext4_mballoc(void); | 1056 | extern void exit_ext4_mballoc(void); |
| 1038 | extern void ext4_mb_free_blocks(handle_t *, struct inode *, | 1057 | extern void ext4_mb_free_blocks(handle_t *, struct inode *, |
| @@ -1050,24 +1069,25 @@ struct buffer_head *ext4_getblk(handle_t *, struct inode *, | |||
| 1050 | ext4_lblk_t, int, int *); | 1069 | ext4_lblk_t, int, int *); |
| 1051 | struct buffer_head *ext4_bread(handle_t *, struct inode *, | 1070 | struct buffer_head *ext4_bread(handle_t *, struct inode *, |
| 1052 | ext4_lblk_t, int, int *); | 1071 | ext4_lblk_t, int, int *); |
| 1072 | int ext4_get_block(struct inode *inode, sector_t iblock, | ||
| 1073 | struct buffer_head *bh_result, int create); | ||
| 1053 | int ext4_get_blocks_handle(handle_t *handle, struct inode *inode, | 1074 | int ext4_get_blocks_handle(handle_t *handle, struct inode *inode, |
| 1054 | ext4_lblk_t iblock, unsigned long maxblocks, | 1075 | ext4_lblk_t iblock, unsigned long maxblocks, |
| 1055 | struct buffer_head *bh_result, | 1076 | struct buffer_head *bh_result, |
| 1056 | int create, int extend_disksize); | 1077 | int create, int extend_disksize); |
| 1057 | 1078 | ||
| 1058 | extern struct inode *ext4_iget(struct super_block *, unsigned long); | 1079 | extern struct inode *ext4_iget(struct super_block *, unsigned long); |
| 1059 | extern int ext4_write_inode (struct inode *, int); | 1080 | extern int ext4_write_inode(struct inode *, int); |
| 1060 | extern int ext4_setattr (struct dentry *, struct iattr *); | 1081 | extern int ext4_setattr(struct dentry *, struct iattr *); |
| 1061 | extern int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry, | 1082 | extern int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry, |
| 1062 | struct kstat *stat); | 1083 | struct kstat *stat); |
| 1063 | extern void ext4_delete_inode (struct inode *); | 1084 | extern void ext4_delete_inode(struct inode *); |
| 1064 | extern int ext4_sync_inode (handle_t *, struct inode *); | 1085 | extern int ext4_sync_inode(handle_t *, struct inode *); |
| 1065 | extern void ext4_discard_reservation (struct inode *); | ||
| 1066 | extern void ext4_dirty_inode(struct inode *); | 1086 | extern void ext4_dirty_inode(struct inode *); |
| 1067 | extern int ext4_change_inode_journal_flag(struct inode *, int); | 1087 | extern int ext4_change_inode_journal_flag(struct inode *, int); |
| 1068 | extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); | 1088 | extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); |
| 1069 | extern int ext4_can_truncate(struct inode *inode); | 1089 | extern int ext4_can_truncate(struct inode *inode); |
| 1070 | extern void ext4_truncate (struct inode *); | 1090 | extern void ext4_truncate(struct inode *); |
| 1071 | extern void ext4_set_inode_flags(struct inode *); | 1091 | extern void ext4_set_inode_flags(struct inode *); |
| 1072 | extern void ext4_get_inode_flags(struct ext4_inode_info *); | 1092 | extern void ext4_get_inode_flags(struct ext4_inode_info *); |
| 1073 | extern void ext4_set_aops(struct inode *inode); | 1093 | extern void ext4_set_aops(struct inode *inode); |
| @@ -1080,11 +1100,10 @@ extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct page *page); | |||
| 1080 | 1100 | ||
| 1081 | /* ioctl.c */ | 1101 | /* ioctl.c */ |
| 1082 | extern long ext4_ioctl(struct file *, unsigned int, unsigned long); | 1102 | extern long ext4_ioctl(struct file *, unsigned int, unsigned long); |
| 1083 | extern long ext4_compat_ioctl (struct file *, unsigned int, unsigned long); | 1103 | extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long); |
| 1084 | 1104 | ||
| 1085 | /* migrate.c */ | 1105 | /* migrate.c */ |
| 1086 | extern int ext4_ext_migrate(struct inode *, struct file *, unsigned int, | 1106 | extern int ext4_ext_migrate(struct inode *); |
| 1087 | unsigned long); | ||
| 1088 | /* namei.c */ | 1107 | /* namei.c */ |
| 1089 | extern int ext4_orphan_add(handle_t *, struct inode *); | 1108 | extern int ext4_orphan_add(handle_t *, struct inode *); |
| 1090 | extern int ext4_orphan_del(handle_t *, struct inode *); | 1109 | extern int ext4_orphan_del(handle_t *, struct inode *); |
| @@ -1099,14 +1118,14 @@ extern int ext4_group_extend(struct super_block *sb, | |||
| 1099 | ext4_fsblk_t n_blocks_count); | 1118 | ext4_fsblk_t n_blocks_count); |
| 1100 | 1119 | ||
| 1101 | /* super.c */ | 1120 | /* super.c */ |
| 1102 | extern void ext4_error (struct super_block *, const char *, const char *, ...) | 1121 | extern void ext4_error(struct super_block *, const char *, const char *, ...) |
| 1103 | __attribute__ ((format (printf, 3, 4))); | 1122 | __attribute__ ((format (printf, 3, 4))); |
| 1104 | extern void __ext4_std_error (struct super_block *, const char *, int); | 1123 | extern void __ext4_std_error(struct super_block *, const char *, int); |
| 1105 | extern void ext4_abort (struct super_block *, const char *, const char *, ...) | 1124 | extern void ext4_abort(struct super_block *, const char *, const char *, ...) |
| 1106 | __attribute__ ((format (printf, 3, 4))); | 1125 | __attribute__ ((format (printf, 3, 4))); |
| 1107 | extern void ext4_warning (struct super_block *, const char *, const char *, ...) | 1126 | extern void ext4_warning(struct super_block *, const char *, const char *, ...) |
| 1108 | __attribute__ ((format (printf, 3, 4))); | 1127 | __attribute__ ((format (printf, 3, 4))); |
| 1109 | extern void ext4_update_dynamic_rev (struct super_block *sb); | 1128 | extern void ext4_update_dynamic_rev(struct super_block *sb); |
| 1110 | extern int ext4_update_compat_feature(handle_t *handle, struct super_block *sb, | 1129 | extern int ext4_update_compat_feature(handle_t *handle, struct super_block *sb, |
| 1111 | __u32 compat); | 1130 | __u32 compat); |
| 1112 | extern int ext4_update_rocompat_feature(handle_t *handle, | 1131 | extern int ext4_update_rocompat_feature(handle_t *handle, |
| @@ -1179,7 +1198,7 @@ static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size) | |||
| 1179 | 1198 | ||
| 1180 | static inline | 1199 | static inline |
| 1181 | struct ext4_group_info *ext4_get_group_info(struct super_block *sb, | 1200 | struct ext4_group_info *ext4_get_group_info(struct super_block *sb, |
| 1182 | ext4_group_t group) | 1201 | ext4_group_t group) |
| 1183 | { | 1202 | { |
| 1184 | struct ext4_group_info ***grp_info; | 1203 | struct ext4_group_info ***grp_info; |
| 1185 | long indexv, indexh; | 1204 | long indexv, indexh; |
| @@ -1207,6 +1226,28 @@ do { \ | |||
| 1207 | __ext4_std_error((sb), __func__, (errno)); \ | 1226 | __ext4_std_error((sb), __func__, (errno)); \ |
| 1208 | } while (0) | 1227 | } while (0) |
| 1209 | 1228 | ||
| 1229 | #ifdef CONFIG_SMP | ||
| 1230 | /* Each CPU can accumulate FBC_BATCH blocks in their local | ||
| 1231 | * counters. So we need to make sure we have free blocks more | ||
| 1232 | * than FBC_BATCH * nr_cpu_ids. Also add a window of 4 times. | ||
| 1233 | */ | ||
| 1234 | #define EXT4_FREEBLOCKS_WATERMARK (4 * (FBC_BATCH * nr_cpu_ids)) | ||
| 1235 | #else | ||
| 1236 | #define EXT4_FREEBLOCKS_WATERMARK 0 | ||
| 1237 | #endif | ||
| 1238 | |||
| 1239 | static inline void ext4_update_i_disksize(struct inode *inode, loff_t newsize) | ||
| 1240 | { | ||
| 1241 | /* | ||
| 1242 | * XXX: replace with spinlock if seen contended -bzzz | ||
| 1243 | */ | ||
| 1244 | down_write(&EXT4_I(inode)->i_data_sem); | ||
| 1245 | if (newsize > EXT4_I(inode)->i_disksize) | ||
| 1246 | EXT4_I(inode)->i_disksize = newsize; | ||
| 1247 | up_write(&EXT4_I(inode)->i_data_sem); | ||
| 1248 | return ; | ||
| 1249 | } | ||
| 1250 | |||
| 1210 | /* | 1251 | /* |
| 1211 | * Inodes and files operations | 1252 | * Inodes and files operations |
| 1212 | */ | 1253 | */ |
