aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorAllison Henderson <achender@linux.vnet.ibm.com>2011-05-25 07:41:26 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-05-25 07:41:26 -0400
commit55f020db66ce187fb8c8e4002a94b0eb714da450 (patch)
treee98214511542f57fa93074be12e27c4819520333 /fs/ext4/ext4.h
parentae81230686282af745ebb7a74c0332349cb9131a (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.h13
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
113struct ext4_allocation_request { 114struct 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);
1718extern unsigned long ext4_bg_num_gdb(struct super_block *sb, 1721extern unsigned long ext4_bg_num_gdb(struct super_block *sb,
1719 ext4_group_t group); 1722 ext4_group_t group);
1720extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode, 1723extern 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,
1722extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi, s64 nblocks); 1725 unsigned int flags,
1726 unsigned long *count,
1727 int *errp);
1728extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi,
1729 s64 nblocks, unsigned int flags);
1723extern ext4_fsblk_t ext4_count_free_blocks(struct super_block *); 1730extern ext4_fsblk_t ext4_count_free_blocks(struct super_block *);
1724extern void ext4_check_blocks_bitmap(struct super_block *); 1731extern void ext4_check_blocks_bitmap(struct super_block *);
1725extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb, 1732extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,