aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2014-01-23 17:27:00 -0500
committerJeff Mahoney <jeffm@suse.com>2014-01-23 17:42:39 -0500
commitc3084a6d48b1d700774273958957d19bb4fe4bc4 (patch)
treebebbd90dd45534944cf5041ecd15f2971dcbf94e
parentfe448aeac49e5eb7d388bbc8dc5c559b24a3d1b4 (diff)
downloadreiserfsprogs-c3084a6d48b1d700774273958957d19bb4fe4bc4.tar.gz
reiserfsprogs: remove dead code
gcc with -Wall was complaining about defined but unused code. I've removed the functions/variables that weren't used. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
-rw-r--r--debugreiserfs/debugreiserfs.c1
-rw-r--r--fsck/pass1.c12
-rw-r--r--reiserfscore/prints.c61
-rw-r--r--reiserfscore/reiserfslib.c5
-rw-r--r--reiserfscore/stree.c28
5 files changed, 0 insertions, 107 deletions
diff --git a/debugreiserfs/debugreiserfs.c b/debugreiserfs/debugreiserfs.c
index 89bfece..139a3a1 100644
--- a/debugreiserfs/debugreiserfs.c
+++ b/debugreiserfs/debugreiserfs.c
@@ -238,7 +238,6 @@ static void print_one_block(reiserfs_filsys_t fs, unsigned long block)
"bitmap" saved in that file and build the tree of blocks marked used in
that "bitmap"
*/
-static char *where_to_save;
static char *badblocks_file;
static char *corruption_list_file;
static char *program_name;
diff --git a/fsck/pass1.c b/fsck/pass1.c
index 1246242..17dcbf7 100644
--- a/fsck/pass1.c
+++ b/fsck/pass1.c
@@ -24,18 +24,6 @@ struct buffer_head *make_buffer(int dev, unsigned long blocknr, int size,
return bh;
}
-static int find_not_of_one_file(struct reiserfs_key *to_find,
- struct reiserfs_key *key)
-{
- if ((get_key_objectid(to_find) != ~(__u32) 0) &&
- (get_key_objectid(to_find) != get_key_objectid(key)))
- return 1;
- if ((get_key_dirid(to_find) != ~(__u32) 0) &&
- (get_key_dirid(to_find) != get_key_dirid(key)))
- return 1;
- return 0;
-}
-
int is_item_reachable(struct item_head *ih)
{
return ih_reachable(ih) ? 1 : 0;
diff --git a/reiserfscore/prints.c b/reiserfscore/prints.c
index cd3e6f6..ce36463 100644
--- a/reiserfscore/prints.c
+++ b/reiserfscore/prints.c
@@ -211,67 +211,6 @@ void reiserfs_warning(FILE * fp, const char *fmt, ...)
va_end(args);
}
-static char *vi_type(struct virtual_item *vi)
-{
- static char *types[] =
- { "directory", "direct", "indirect", "stat data" };
-
- if (vi->vi_type & VI_TYPE_STAT_DATA)
- return types[3];
- if (vi->vi_type & VI_TYPE_INDIRECT)
- return types[2];
- if (vi->vi_type & VI_TYPE_DIRECT)
- return types[1];
- if (vi->vi_type & VI_TYPE_DIRECTORY)
- return types[0];
-
- reiserfs_panic("vi_type: 6000: unknown type (0x%x)", vi->vi_type);
- return NULL;
-}
-
-static void print_virtual_node(struct virtual_node *vn)
-{
- int i, j;
-
- printf
- ("VIRTUAL NODE CONTAINS %d items, has size %d,%s,%s, ITEM_POS=%d POS_IN_ITEM=%d MODE=\'%c\'\n",
- vn->vn_nr_item, vn->vn_size,
- (vn->vn_vi[0].
- vi_type & VI_TYPE_LEFT_MERGEABLE) ? "left mergeable" : "",
- (vn->vn_vi[vn->vn_nr_item - 1].
- vi_type & VI_TYPE_RIGHT_MERGEABLE) ? "right mergeable" : "",
- vn->vn_affected_item_num, vn->vn_pos_in_item, vn->vn_mode);
-
- for (i = 0; i < vn->vn_nr_item; i++) {
- printf("%s %d %d", vi_type(&vn->vn_vi[i]), i,
- vn->vn_vi[i].vi_item_len);
- if (vn->vn_vi[i].vi_entry_sizes) {
- printf("It is directory with %d entries: ",
- vn->vn_vi[i].vi_entry_count);
- for (j = 0; j < vn->vn_vi[i].vi_entry_count; j++)
- printf("%d ", vn->vn_vi[i].vi_entry_sizes[j]);
- }
- printf("\n");
- }
-}
-
-static void print_path(struct tree_balance *tb, struct reiserfs_path *path)
-{
- int offset = path->path_length;
- struct buffer_head *bh;
-
- printf("Offset Bh (b_blocknr, b_count) Position Nr_item\n");
- while (offset > ILLEGAL_PATH_ELEMENT_OFFSET) {
- bh = PATH_OFFSET_PBUFFER(path, offset);
- printf("%6d %10p (%9lu, %7d) %8d %7d\n", offset,
- bh, bh ? bh->b_blocknr : 0, bh ? bh->b_count : 0,
- PATH_OFFSET_POSITION(path, offset),
- bh ? B_NR_ITEMS(bh) : -1);
-
- offset--;
- }
-}
-
static void print_directory_item(FILE *fp, reiserfs_filsys_t fs,
struct buffer_head *bh, struct item_head *ih)
{
diff --git a/reiserfscore/reiserfslib.c b/reiserfscore/reiserfslib.c
index e8041f7..5c08ebb 100644
--- a/reiserfscore/reiserfslib.c
+++ b/reiserfscore/reiserfslib.c
@@ -322,11 +322,6 @@ int no_reiserfs_found(reiserfs_filsys_t fs)
return (fs == NULL || fs->fs_blocksize == 0) ? 1 : 0;
}
-static int new_format(reiserfs_filsys_t fs)
-{
- return fs->fs_super_bh->b_blocknr != 2;
-}
-
int spread_bitmaps(reiserfs_filsys_t fs)
{
return fs->fs_super_bh->b_blocknr != 2;
diff --git a/reiserfscore/stree.c b/reiserfscore/stree.c
index 29a69ad..ea928c4 100644
--- a/reiserfscore/stree.c
+++ b/reiserfscore/stree.c
@@ -409,31 +409,3 @@ int search_by_key(reiserfs_filsys_t fs, struct reiserfs_key *p_s_key, /* Key to
p_s_last_element->pe_position));
}
}
-
-static int bin_search_in_dir_item(struct item_head *ih,
- struct reiserfs_de_head *deh,
- struct reiserfs_key *key, int *pos_in_item)
-{
- int rbound, lbound, j;
-
- lbound = 0;
- rbound = get_ih_entry_count(ih) - 1;
-
- for (j = (rbound + lbound) / 2; lbound <= rbound;
- j = (rbound + lbound) / 2) {
- if (get_offset(key) < get_deh_offset(deh + j)) {
- rbound = j - 1;
- continue;
- }
- if (get_offset(key) > get_deh_offset(deh + j)) {
- lbound = j + 1;
- continue;
- }
- /* key found */
- *pos_in_item = j;
- return POSITION_FOUND;
- }
-
- *pos_in_item = lbound;
- return POSITION_NOT_FOUND;
-}