From 6d879a999bad95724304a2a5158d7da4fcd599e7 Mon Sep 17 00:00:00 2001 From: Valerie Aurora Henson Date: Sat, 22 Aug 2009 20:22:42 -0400 Subject: [PATCH] debugfs: Move everything to new bitmap interface Signed-off-by: Valerie Aurora Henson Signed-off-by: "Theodore Ts'o" --- debugfs/debugfs.c | 28 ++++++++++++++-------------- debugfs/lsdel.c | 2 +- debugfs/unused.c | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index a72d800..93227e3 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -955,9 +955,9 @@ void do_freei(int argc, char *argv[]) CHECK_FS_RW | CHECK_FS_BITMAPS)) return; - if (!ext2fs_test_inode_bitmap(current_fs->inode_map,inode)) + if (!ext2fs_test_inode_bitmap2(current_fs->inode_map,inode)) com_err(argv[0], 0, "Warning: inode already clear"); - ext2fs_unmark_inode_bitmap(current_fs->inode_map,inode); + ext2fs_unmark_inode_bitmap2(current_fs->inode_map,inode); ext2fs_mark_ib_dirty(current_fs); } @@ -969,9 +969,9 @@ void do_seti(int argc, char *argv[]) CHECK_FS_RW | CHECK_FS_BITMAPS)) return; - if (ext2fs_test_inode_bitmap(current_fs->inode_map,inode)) + if (ext2fs_test_inode_bitmap2(current_fs->inode_map,inode)) com_err(argv[0], 0, "Warning: inode already set"); - ext2fs_mark_inode_bitmap(current_fs->inode_map,inode); + ext2fs_mark_inode_bitmap2(current_fs->inode_map,inode); ext2fs_mark_ib_dirty(current_fs); } @@ -982,7 +982,7 @@ void do_testi(int argc, char *argv[]) if (common_inode_args_process(argc, argv, &inode, CHECK_FS_BITMAPS)) return; - if (ext2fs_test_inode_bitmap(current_fs->inode_map,inode)) + if (ext2fs_test_inode_bitmap2(current_fs->inode_map,inode)) printf("Inode %u is marked in use\n", inode); else printf("Inode %u is not in use\n", inode); @@ -998,10 +998,10 @@ void do_freeb(int argc, char *argv[]) if (check_fs_read_write(argv[0])) return; while (count-- > 0) { - if (!ext2fs_test_block_bitmap(current_fs->block_map,block)) + if (!ext2fs_test_block_bitmap2(current_fs->block_map,block)) com_err(argv[0], 0, "Warning: block %u already clear", block); - ext2fs_unmark_block_bitmap(current_fs->block_map,block); + ext2fs_unmark_block_bitmap2(current_fs->block_map,block); block++; } ext2fs_mark_bb_dirty(current_fs); @@ -1017,10 +1017,10 @@ void do_setb(int argc, char *argv[]) if (check_fs_read_write(argv[0])) return; while (count-- > 0) { - if (ext2fs_test_block_bitmap(current_fs->block_map,block)) + if (ext2fs_test_block_bitmap2(current_fs->block_map,block)) com_err(argv[0], 0, "Warning: block %u already set", block); - ext2fs_mark_block_bitmap(current_fs->block_map,block); + ext2fs_mark_block_bitmap2(current_fs->block_map,block); block++; } ext2fs_mark_bb_dirty(current_fs); @@ -1034,7 +1034,7 @@ void do_testb(int argc, char *argv[]) if (common_block_args_process(argc, argv, &block, &count)) return; while (count-- > 0) { - if (ext2fs_test_block_bitmap(current_fs->block_map,block)) + if (ext2fs_test_block_bitmap2(current_fs->block_map,block)) printf("Block %u marked in use\n", block); else printf("Block %u not in use\n", block); @@ -1357,7 +1357,7 @@ void do_undel(int argc, char *argv[]) if (debugfs_read_inode(ino, &inode, argv[1])) return; - if (ext2fs_test_inode_bitmap(current_fs->inode_map, ino)) { + if (ext2fs_test_inode_bitmap2(current_fs->inode_map, ino)) { com_err(argv[1], 0, "Inode is not marked as deleted"); return; } @@ -1599,7 +1599,7 @@ void do_write(int argc, char *argv[]) close(fd); return; } - if (ext2fs_test_inode_bitmap(current_fs->inode_map,newfile)) + if (ext2fs_test_inode_bitmap2(current_fs->inode_map,newfile)) com_err(argv[0], 0, "Warning: inode already set"); ext2fs_inode_alloc_stats2(current_fs, newfile, +1, 0); memset(&inode, 0, sizeof(inode)); @@ -1689,9 +1689,9 @@ void do_mknod(int argc, char *argv[]) com_err(argv[1], retval, 0); return; } - if (ext2fs_test_inode_bitmap(current_fs->inode_map,newfile)) + if (ext2fs_test_inode_bitmap2(current_fs->inode_map,newfile)) com_err(argv[0], 0, "Warning: inode already set"); - ext2fs_mark_inode_bitmap(current_fs->inode_map, newfile); + ext2fs_mark_inode_bitmap2(current_fs->inode_map, newfile); ext2fs_mark_ib_dirty(current_fs); memset(&inode, 0, sizeof(inode)); inode.i_mode = mode; diff --git a/debugfs/lsdel.c b/debugfs/lsdel.c index 265753b..074fd16 100644 --- a/debugfs/lsdel.c +++ b/debugfs/lsdel.c @@ -64,7 +64,7 @@ static int lsdel_proc(ext2_filsys fs, return BLOCK_ABORT; } - if (!ext2fs_test_block_bitmap(fs->block_map,*block_nr)) + if (!ext2fs_test_block_bitmap2(fs->block_map,*block_nr)) lsd->free_blocks++; return 0; diff --git a/debugfs/unused.c b/debugfs/unused.c index 818fef1..15837fa 100644 --- a/debugfs/unused.c +++ b/debugfs/unused.c @@ -37,7 +37,7 @@ void do_dump_unused(int argc EXT2FS_ATTR((unused)), char **argv) for (blk=current_fs->super->s_first_data_block; blk < current_fs->super->s_blocks_count; blk++) { - if (ext2fs_test_block_bitmap(current_fs->block_map,blk)) + if (ext2fs_test_block_bitmap2(current_fs->block_map,blk)) continue; retval = io_channel_read_blk(current_fs->io, blk, 1, buf); if (retval) { -- 1.8.3.1