aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2010-06-29 12:54:28 -0400
committerTheodore Ts'o <tytso@mit.edu>2010-06-29 12:54:28 -0400
commite29136f80e775b0310273932b4297a62f5574a29 (patch)
treed10d56b15b7968744ea0becdf61440aae7e609c5 /fs/ext4/inode.c
parentc67d859e39896e4286249da89c4ca0ef8bd949cb (diff)
ext4: Enhance ext4_grp_locked_error() to take block and function numbers
Also use a macro definition so that __func__ and __LINE__ is implicit. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index b485987f0146..64baadb4956d 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1128,8 +1128,8 @@ void ext4_da_update_reserve_space(struct inode *inode,
1128 ext4_discard_preallocations(inode); 1128 ext4_discard_preallocations(inode);
1129} 1129}
1130 1130
1131static int check_block_validity(struct inode *inode, const char *func, 1131static int __check_block_validity(struct inode *inode, const char *func,
1132 struct ext4_map_blocks *map) 1132 struct ext4_map_blocks *map)
1133{ 1133{
1134 if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), map->m_pblk, 1134 if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), map->m_pblk,
1135 map->m_len)) { 1135 map->m_len)) {
@@ -1142,6 +1142,9 @@ static int check_block_validity(struct inode *inode, const char *func,
1142 return 0; 1142 return 0;
1143} 1143}
1144 1144
1145#define check_block_validity(inode, map) \
1146 __check_block_validity((inode), __func__, (map))
1147
1145/* 1148/*
1146 * Return the number of contiguous dirty pages in a given inode 1149 * Return the number of contiguous dirty pages in a given inode
1147 * starting at page frame idx. 1150 * starting at page frame idx.
@@ -1244,7 +1247,7 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
1244 up_read((&EXT4_I(inode)->i_data_sem)); 1247 up_read((&EXT4_I(inode)->i_data_sem));
1245 1248
1246 if (retval > 0 && map->m_flags & EXT4_MAP_MAPPED) { 1249 if (retval > 0 && map->m_flags & EXT4_MAP_MAPPED) {
1247 int ret = check_block_validity(inode, __func__, map); 1250 int ret = check_block_validity(inode, map);
1248 if (ret != 0) 1251 if (ret != 0)
1249 return ret; 1252 return ret;
1250 } 1253 }
@@ -1324,9 +1327,7 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
1324 1327
1325 up_write((&EXT4_I(inode)->i_data_sem)); 1328 up_write((&EXT4_I(inode)->i_data_sem));
1326 if (retval > 0 && map->m_flags & EXT4_MAP_MAPPED) { 1329 if (retval > 0 && map->m_flags & EXT4_MAP_MAPPED) {
1327 int ret = check_block_validity(inode, 1330 int ret = check_block_validity(inode, map);
1328 "ext4_map_blocks_after_alloc",
1329 map);
1330 if (ret != 0) 1331 if (ret != 0)
1331 return ret; 1332 return ret;
1332 } 1333 }