Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-17117 misc: deduplicate log2/log10 functions
[tools/e2fsprogs.git]
/
debugfs
/
debugfs.c
diff --git
a/debugfs/debugfs.c
b/debugfs/debugfs.c
index
dd729f3
..
13a879e
100644
(file)
--- a/
debugfs/debugfs.c
+++ b/
debugfs/debugfs.c
@@
-657,18
+657,6
@@
static void dump_blocks(FILE *f, const char *prefix, ext2_ino_t inode)
fprintf(f,"\n");
}
fprintf(f,"\n");
}
-static int int_log10(unsigned long long arg)
-{
- int l = 0;
-
- arg = arg / 10;
- while (arg) {
- l++;
- arg = arg / 10;
- }
- return l;
-}
-
#define DUMP_LEAF_EXTENTS 0x01
#define DUMP_NODE_EXTENTS 0x02
#define DUMP_EXTENT_TABLE 0x04
#define DUMP_LEAF_EXTENTS 0x01
#define DUMP_NODE_EXTENTS 0x02
#define DUMP_EXTENT_TABLE 0x04
@@
-1070,11
+1058,11
@@
void do_dump_extents(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
return;
}
return;
}
- logical_width =
int
_log10((EXT2_I_SIZE(&inode)+current_fs->blocksize-1)/
+ logical_width =
ext2fs
_log10((EXT2_I_SIZE(&inode)+current_fs->blocksize-1)/
current_fs->blocksize) + 1;
if (logical_width < 5)
logical_width = 5;
current_fs->blocksize) + 1;
if (logical_width < 5)
logical_width = 5;
- physical_width =
int
_log10(ext2fs_blocks_count(current_fs->super)) + 1;
+ physical_width =
ext2fs
_log10(ext2fs_blocks_count(current_fs->super)) + 1;
if (physical_width < 5)
physical_width = 5;
if (physical_width < 5)
physical_width = 5;