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>
This commit is contained in:
Jeff Mahoney committed 2014-01-23 17:42:39 -05:00
1 parent fe448aeac4
commit c3084a6d48
5 files changed
-107

No files matched your search

-1
View File
@@ -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 "bitmap" saved in that file and build the tree of blocks marked used in
that "bitmap" that "bitmap"
*/ */
static char *where_to_save;
static char *badblocks_file; static char *badblocks_file;
static char *corruption_list_file; static char *corruption_list_file;
static char *program_name; static char *program_name;
-12
View File
@@ -24,18 +24,6 @@ struct buffer_head *make_buffer(int dev, unsigned long blocknr, int size,
return bh; 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) int is_item_reachable(struct item_head *ih)
{ {
return ih_reachable(ih) ? 1 : 0; return ih_reachable(ih) ? 1 : 0;
-61
View File
@@ -211,67 +211,6 @@ void reiserfs_warning(FILE * fp, const char *fmt, ...)
va_end(args); 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, static void print_directory_item(FILE *fp, reiserfs_filsys_t fs,
struct buffer_head *bh, struct item_head *ih) struct buffer_head *bh, struct item_head *ih)
{ {
-5
View File
@@ -322,11 +322,6 @@ int no_reiserfs_found(reiserfs_filsys_t fs)
return (fs == NULL || fs->fs_blocksize == 0) ? 1 : 0; 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) int spread_bitmaps(reiserfs_filsys_t fs)
{ {
return fs->fs_super_bh->b_blocknr != 2; return fs->fs_super_bh->b_blocknr != 2;
-28
View File
@@ -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)); 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;
}