[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 17/17] ext2fs: remove 2 unused functions
From: |
Etienne Brateau |
Subject: |
[PATCH 17/17] ext2fs: remove 2 unused functions |
Date: |
Sun, 23 Jan 2022 05:17:15 +0100 |
---
ext2fs/ialloc.c | 72 -------------------------------------------------
1 file changed, 72 deletions(-)
diff --git a/ext2fs/ialloc.c b/ext2fs/ialloc.c
index 568d7eae..e1a09a82 100644
--- a/ext2fs/ialloc.c
+++ b/ext2fs/ialloc.c
@@ -344,75 +344,3 @@ diskfs_alloc_node (struct node *dir, mode_t mode, struct
node **node)
*node = np;
return 0;
}
-
-/* ---------------------------------------------------------------- */
-
-unsigned long
-ext2_count_free_inodes ()
-{
-#ifdef EXT2FS_DEBUG
- unsigned long desc_count, bitmap_count, x;
- struct ext2_group_desc *gdp;
- int i;
-
- pthread_spin_lock (&global_lock);
-
- desc_count = 0;
- bitmap_count = 0;
- gdp = NULL;
- for (i = 0; i < groups_count; i++)
- {
- void *bh;
- gdp = group_desc (i);
- desc_count += le16toh (gdp->bg_free_inodes_count);
- bh = disk_cache_block_ref (le32toh (gdp->bg_inode_bitmap));
- x = count_free (bh, le32toh (sblock->s_inodes_per_group) / 8);
- disk_cache_block_deref (bh);
- ext2_debug ("group %d: stored = %d, counted = %lu",
- i, le16toh (gdp->bg_free_inodes_count), x);
- bitmap_count += x;
- }
- ext2_debug ("stored = %u, computed = %lu, %lu",
- le32toh (sblock->s_free_inodes_count), desc_count, bitmap_count);
- pthread_spin_unlock (&global_lock);
- return desc_count;
-#else
- return le32toh (sblock->s_free_inodes_count);
-#endif
-}
-
-/* ---------------------------------------------------------------- */
-
-void
-ext2_check_inodes_bitmap ()
-{
- int i;
- struct ext2_group_desc *gdp;
- unsigned long desc_count, bitmap_count, x;
-
- pthread_spin_lock (&global_lock);
-
- desc_count = 0;
- bitmap_count = 0;
- gdp = NULL;
- for (i = 0; i < groups_count; i++)
- {
- void *bh;
- gdp = group_desc (i);
- desc_count += le16toh (gdp->bg_free_inodes_count);
- bh = disk_cache_block_ref (le32toh (gdp->bg_inode_bitmap));
- x = count_free (bh, le32toh (sblock->s_inodes_per_group) / 8);
- disk_cache_block_deref (bh);
- if (le16toh (gdp->bg_free_inodes_count) != x)
- ext2_error ("wrong free inodes count in group %d, "
- "stored = %d, counted = %lu",
- i, le16toh (gdp->bg_free_inodes_count), x);
- bitmap_count += x;
- }
- if (le32toh (sblock->s_free_inodes_count) != bitmap_count)
- ext2_error ("wrong free inodes count in super block, "
- "stored = %lu, counted = %lu",
- (unsigned long) le32toh (sblock->s_free_inodes_count),
bitmap_count);
-
- pthread_spin_unlock (&global_lock);
-}
--
2.34.1
- Re: [PATCH 06/17] ext2fs: reindent files, (continued)
- [PATCH 08/17] ext2fs: Take cares of indiannes, Etienne Brateau, 2022/01/22
- [PATCH 10/17] ext2fs: set the writing time in the superblock, Etienne Brateau, 2022/01/22
- [PATCH 11/17] ext2fs: resolve a todo, check writability before writing, Etienne Brateau, 2022/01/22
- [PATCH 14/17] ext2fs: refactor add a method for dupplicated code, Etienne Brateau, 2022/01/22
- [PATCH 17/17] ext2fs: remove 2 unused functions,
Etienne Brateau <=
- [PATCH 16/17] ext2fs: remove a commented block of code, Etienne Brateau, 2022/01/22
- [PATCH 02/17] ext2fs: update ext2_fs.h header, Etienne Brateau, 2022/01/22
- [PATCH 13/17] ext2fs: remove a #define not_yet, Etienne Brateau, 2022/01/22