diff options
author | Aditya Kali <adityakali@google.com> | 2011-09-09 19:04:51 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-09-09 19:04:51 -0400 |
commit | 7b415bf60f6afb0499fd3dc0ee33444f54e28567 (patch) | |
tree | 9c64fef2b8d60ce64865af6e4c2cc6008026e28c /fs/ext4/ext4.h | |
parent | 27baebb849d46d901e756e6502b0a65a62e43771 (diff) |
ext4: Fix bigalloc quota accounting and i_blocks value
With bigalloc changes, the i_blocks value was not correctly set (it was still
set to number of blocks being used, but in case of bigalloc, we want i_blocks
to represent the number of clusters being used). Since the quota subsystem sets
the i_blocks value, this patch fixes the quota accounting and makes sure that
the i_blocks value is set correctly.
Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index d2584224c89a..a6307f7c9807 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -144,9 +144,17 @@ struct ext4_allocation_request { | |||
144 | #define EXT4_MAP_UNWRITTEN (1 << BH_Unwritten) | 144 | #define EXT4_MAP_UNWRITTEN (1 << BH_Unwritten) |
145 | #define EXT4_MAP_BOUNDARY (1 << BH_Boundary) | 145 | #define EXT4_MAP_BOUNDARY (1 << BH_Boundary) |
146 | #define EXT4_MAP_UNINIT (1 << BH_Uninit) | 146 | #define EXT4_MAP_UNINIT (1 << BH_Uninit) |
147 | /* Sometimes (in the bigalloc case, from ext4_da_get_block_prep) the caller of | ||
148 | * ext4_map_blocks wants to know whether or not the underlying cluster has | ||
149 | * already been accounted for. EXT4_MAP_FROM_CLUSTER conveys to the caller that | ||
150 | * the requested mapping was from previously mapped (or delayed allocated) | ||
151 | * cluster. We use BH_AllocFromCluster only for this flag. BH_AllocFromCluster | ||
152 | * should never appear on buffer_head's state flags. | ||
153 | */ | ||
154 | #define EXT4_MAP_FROM_CLUSTER (1 << BH_AllocFromCluster) | ||
147 | #define EXT4_MAP_FLAGS (EXT4_MAP_NEW | EXT4_MAP_MAPPED |\ | 155 | #define EXT4_MAP_FLAGS (EXT4_MAP_NEW | EXT4_MAP_MAPPED |\ |
148 | EXT4_MAP_UNWRITTEN | EXT4_MAP_BOUNDARY |\ | 156 | EXT4_MAP_UNWRITTEN | EXT4_MAP_BOUNDARY |\ |
149 | EXT4_MAP_UNINIT) | 157 | EXT4_MAP_UNINIT | EXT4_MAP_FROM_CLUSTER) |
150 | 158 | ||
151 | struct ext4_map_blocks { | 159 | struct ext4_map_blocks { |
152 | ext4_fsblk_t m_pblk; | 160 | ext4_fsblk_t m_pblk; |
@@ -1884,6 +1892,7 @@ extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf); | |||
1884 | extern qsize_t *ext4_get_reserved_space(struct inode *inode); | 1892 | extern qsize_t *ext4_get_reserved_space(struct inode *inode); |
1885 | extern void ext4_da_update_reserve_space(struct inode *inode, | 1893 | extern void ext4_da_update_reserve_space(struct inode *inode, |
1886 | int used, int quota_claim); | 1894 | int used, int quota_claim); |
1895 | extern int ext4_da_reserve_space(struct inode *inode, ext4_lblk_t lblock); | ||
1887 | 1896 | ||
1888 | /* indirect.c */ | 1897 | /* indirect.c */ |
1889 | extern int ext4_ind_map_blocks(handle_t *handle, struct inode *inode, | 1898 | extern int ext4_ind_map_blocks(handle_t *handle, struct inode *inode, |
@@ -2284,6 +2293,11 @@ extern int ext4_multi_mount_protect(struct super_block *, ext4_fsblk_t); | |||
2284 | enum ext4_state_bits { | 2293 | enum ext4_state_bits { |
2285 | BH_Uninit /* blocks are allocated but uninitialized on disk */ | 2294 | BH_Uninit /* blocks are allocated but uninitialized on disk */ |
2286 | = BH_JBDPrivateStart, | 2295 | = BH_JBDPrivateStart, |
2296 | BH_AllocFromCluster, /* allocated blocks were part of already | ||
2297 | * allocated cluster. Note that this flag will | ||
2298 | * never, ever appear in a buffer_head's state | ||
2299 | * flag. See EXT4_MAP_FROM_CLUSTER to see where | ||
2300 | * this is used. */ | ||
2287 | }; | 2301 | }; |
2288 | 2302 | ||
2289 | BUFFER_FNS(Uninit, uninit) | 2303 | BUFFER_FNS(Uninit, uninit) |