ext4: make ext_debug() implementation to use pr_debug()
ext_debug() msgs could be helpful, provided those could be enabled without recompiling kernel and also if we could selectively enable only required prints for case by case debugging. So make ext_debug() implementation use pr_debug(). Also change ext_debug() to be defined with CONFIG_EXT4_DEBUG. So EXT_DEBUG macro now mostly remain for below 3 functions. ext4_ext_show_path/leaf/move() (whose print msgs use ext_debug() which again could be dynamically enabled using pr_debug()) This also changes the ext_debug() to take inode as a parameter to add inode no. in all of it's msgs. Prints additional info like process name / pid, superblock id etc. This also removes any explicit function names passed in ext_debug(). Since ext_debug() on it's own prints file, func and line no. Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com> Link: https://lore.kernel.org/r/d31dc189b0aeda9384fe7665e36da7cd8c61571f.1589086800.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:

committed by
Theodore Ts'o

parent
d3df14535f
commit
70aa1554b0
@@ -501,9 +501,8 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
|
||||
#endif
|
||||
|
||||
map->m_flags = 0;
|
||||
ext_debug("ext4_map_blocks(): inode %lu, flag %d, max_blocks %u,"
|
||||
"logical block %lu\n", inode->i_ino, flags, map->m_len,
|
||||
(unsigned long) map->m_lblk);
|
||||
ext_debug(inode, "flag 0x%x, max_blocks %u, logical block %lu\n",
|
||||
flags, map->m_len, (unsigned long) map->m_lblk);
|
||||
|
||||
/*
|
||||
* ext4_map_blocks returns an int, and m_len is an unsigned int
|
||||
@@ -734,8 +733,7 @@ out_sem:
|
||||
}
|
||||
|
||||
if (retval < 0)
|
||||
ext_debug("failed for inode %lu with err %d\n",
|
||||
inode->i_ino, retval);
|
||||
ext_debug(inode, "failed with err %d\n", retval);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -1691,8 +1689,7 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock,
|
||||
invalid_block = ~0;
|
||||
|
||||
map->m_flags = 0;
|
||||
ext_debug("ext4_da_map_blocks(): inode %lu, max_blocks %u,"
|
||||
"logical block %lu\n", inode->i_ino, map->m_len,
|
||||
ext_debug(inode, "max_blocks %u, logical block %lu\n", map->m_len,
|
||||
(unsigned long) map->m_lblk);
|
||||
|
||||
/* Lookup extent status tree firstly */
|
||||
|
Reference in New Issue
Block a user