diff options
author | Allison Henderson <achender@linux.vnet.ibm.com> | 2011-05-25 07:41:26 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-05-25 07:41:26 -0400 |
commit | 55f020db66ce187fb8c8e4002a94b0eb714da450 (patch) | |
tree | e98214511542f57fa93074be12e27c4819520333 /fs/ext4/ext4.h | |
parent | ae81230686282af745ebb7a74c0332349cb9131a (diff) |
ext4: add flag to ext4_has_free_blocks
This patch adds an allocation request flag to the ext4_has_free_blocks
function which enables the use of reserved blocks. This will allow a
punch hole to proceed even if the disk is full. Punching a hole may
require additional blocks to first split the extents.
Because ext4_has_free_blocks is a low level function, the flag needs
to be passed down through several functions listed below:
ext4_ext_insert_extent
ext4_ext_create_new_leaf
ext4_ext_grow_indepth
ext4_ext_split
ext4_ext_new_meta_block
ext4_mb_new_blocks
ext4_claim_free_blocks
ext4_has_free_blocks
[ext4 punch hole patch series 1/5 v7]
Signed-off-by: Allison Henderson <achender@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Mingming Cao <cmm@us.ibm.com>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 2bc4c21f1d26..2f310d1839ed 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -108,7 +108,8 @@ typedef unsigned int ext4_group_t; | |||
108 | #define EXT4_MB_DELALLOC_RESERVED 0x0400 | 108 | #define EXT4_MB_DELALLOC_RESERVED 0x0400 |
109 | /* We are doing stream allocation */ | 109 | /* We are doing stream allocation */ |
110 | #define EXT4_MB_STREAM_ALLOC 0x0800 | 110 | #define EXT4_MB_STREAM_ALLOC 0x0800 |
111 | 111 | /* Use reserved root blocks if needed */ | |
112 | #define EXT4_MB_USE_ROOT_BLOCKS 0x1000 | ||
112 | 113 | ||
113 | struct ext4_allocation_request { | 114 | struct ext4_allocation_request { |
114 | /* target inode for block we're allocating */ | 115 | /* target inode for block we're allocating */ |
@@ -514,6 +515,8 @@ struct ext4_new_group_data { | |||
514 | /* Convert extent to initialized after IO complete */ | 515 | /* Convert extent to initialized after IO complete */ |
515 | #define EXT4_GET_BLOCKS_IO_CONVERT_EXT (EXT4_GET_BLOCKS_CONVERT|\ | 516 | #define EXT4_GET_BLOCKS_IO_CONVERT_EXT (EXT4_GET_BLOCKS_CONVERT|\ |
516 | EXT4_GET_BLOCKS_CREATE_UNINIT_EXT) | 517 | EXT4_GET_BLOCKS_CREATE_UNINIT_EXT) |
518 | /* Punch out blocks of an extent */ | ||
519 | #define EXT4_GET_BLOCKS_PUNCH_OUT_EXT 0x0020 | ||
517 | 520 | ||
518 | /* | 521 | /* |
519 | * Flags used by ext4_free_blocks | 522 | * Flags used by ext4_free_blocks |
@@ -1718,8 +1721,12 @@ extern int ext4_bg_has_super(struct super_block *sb, ext4_group_t group); | |||
1718 | extern unsigned long ext4_bg_num_gdb(struct super_block *sb, | 1721 | extern unsigned long ext4_bg_num_gdb(struct super_block *sb, |
1719 | ext4_group_t group); | 1722 | ext4_group_t group); |
1720 | extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode, | 1723 | extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode, |
1721 | ext4_fsblk_t goal, unsigned long *count, int *errp); | 1724 | ext4_fsblk_t goal, |
1722 | extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi, s64 nblocks); | 1725 | unsigned int flags, |
1726 | unsigned long *count, | ||
1727 | int *errp); | ||
1728 | extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi, | ||
1729 | s64 nblocks, unsigned int flags); | ||
1723 | extern ext4_fsblk_t ext4_count_free_blocks(struct super_block *); | 1730 | extern ext4_fsblk_t ext4_count_free_blocks(struct super_block *); |
1724 | extern void ext4_check_blocks_bitmap(struct super_block *); | 1731 | extern void ext4_check_blocks_bitmap(struct super_block *); |
1725 | extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb, | 1732 | extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb, |