reiserfsprogs: fix remaining sparse warnings

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
Jeff Mahoney committed 2013-08-26 19:02:19 -04:00
1 parent 20357cf349
commit 767f7b85df
25 files changed
+122 -116

No files matched your search

+1 -6
View File
@@ -66,6 +66,7 @@ int main(int argc, char *argv[]);
#define OPT_FORCE 1 << 11
/* pass0.c */
extern reiserfs_bitmap_t *leaves_bitmap;
void pass_0(reiserfs_filsys_t *);
void load_pass_0_result(FILE *, reiserfs_filsys_t *);
@@ -243,9 +244,6 @@ void mark_block_used(unsigned long block, int check_hardware);
void mark_block_uninsertable(unsigned long block);
int is_block_uninsertable(unsigned long block);
/* objectid.c */
int comp_ids(const void *p1, const void *p2);
typedef struct id_map {
void **index;
__u32 count, last_used;
@@ -469,9 +467,6 @@ int fsck_user_confirmed(reiserfs_filsys_t *fs, char *q, char *a,
int default_answer);
void stage_report(int, reiserfs_filsys_t *);
/* journal.c */
int replay_journal(reiserfs_filsys_t *);
/*pass1: rebuild super block*/
void rebuild_sb(reiserfs_filsys_t *fs, char *filename, struct fsck_data *data);
+1 -1
View File
@@ -330,7 +330,7 @@ void load_lost_found_result(reiserfs_filsys_t *fs)
*/
}
void after_lost_found(reiserfs_filsys_t *fs)
static void after_lost_found(reiserfs_filsys_t *fs)
{
/* update super block: objectid map, fsck state */
set_sb_fs_state(fs->fs_ondisk_sb, LOST_FOUND_DONE);
+5 -5
View File
@@ -15,7 +15,7 @@ extern int screen_savebuffer_len;
extern char *screen_savebuffer;
reiserfs_filsys_t *fs;
char *badblocks_file;
static char *badblocks_file;
#define print_usage_and_exit() { \
fsck_progress ("Usage: %s [mode] [options] " \
@@ -317,7 +317,7 @@ static char *parse_options(struct fsck_data *data, int argc, char *argv[])
** that -- and only then run this program. **\n\
*************************************************************\n\
\nWill rebuild the filesystem (%s) tree\n"
void warn_what_will_be_done(char *file_name, struct fsck_data *data)
static void warn_what_will_be_done(char *file_name, struct fsck_data *data)
{
FILE *warn_to;
@@ -422,7 +422,7 @@ void warn_what_will_be_done(char *file_name, struct fsck_data *data)
static dma_info_t dma_info;
static dma_info_t old_dma_info;
void check_dma()
static void check_dma(int sig)
{
old_dma_info = dma_info;
if (get_dma_info(&dma_info) == -1) {
@@ -476,7 +476,7 @@ void check_dma()
alarm(1);
}
void register_timer()
static void register_timer(void)
{
memset(&dma_info, 0, sizeof(dma_info));
memset(&old_dma_info, 0, sizeof(old_dma_info));
@@ -770,7 +770,7 @@ static void reiserfsck_replay_journal(reiserfs_filsys_t *fs)
fs->fs_ondisk_sb = getmem(sb_size);
memcpy(fs->fs_ondisk_sb, on_place_sb, sb_size);
replay_journal(fs);
reiserfs_replay_journal(fs);
/* Copy checked reliable sb fields from backed up sb to a new one. */
set_sb_block_count(on_place_sb, get_sb_block_count(fs->fs_ondisk_sb));
+2 -2
View File
@@ -18,13 +18,13 @@ reiserfs_bitmap_t *leaves_bitmap;
#define pass0_mark_leaf(block) __mark (leaves, block)
/* nodes which are referred to from only one indirect item */
reiserfs_bitmap_t *good_unfm_bitmap;
static reiserfs_bitmap_t *good_unfm_bitmap;
#define pass0_is_good_unfm(block) __is_marked (good_unfm, block)
#define pass0_mark_good_unfm(block) __mark (good_unfm, block)
#define pass0_unmark_good_unfm(block) __unmark (good_unfm, block)
/* nodes which are referred to from more than one indirect item */
reiserfs_bitmap_t *bad_unfm_bitmap;
static reiserfs_bitmap_t *bad_unfm_bitmap;
#define pass0_is_bad_unfm(block) __is_marked (bad_unfm, block)
#define pass0_mark_bad_unfm(block) __mark (bad_unfm, block)
#define pass0_unmark_bad_unfm(block) __unmark (bad_unfm, block)
+6 -6
View File
@@ -24,7 +24,8 @@ struct buffer_head *make_buffer(int dev, unsigned long blocknr, int size,
return bh;
}
int find_not_of_one_file(struct reiserfs_key *to_find, struct reiserfs_key *key)
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)))
@@ -165,7 +166,8 @@ static void insert_pointer(struct buffer_head *bh, struct reiserfs_path *path)
}
/* return 1 if left and right can be joined. 0 otherwise */
int balance_condition_fails(struct buffer_head *left, struct buffer_head *right)
static int balance_condition_fails(struct buffer_head *left,
struct buffer_head *right)
{
if (B_FREE_SPACE(left) >= B_CHILD_SIZE(right) -
(are_items_mergeable
@@ -177,8 +179,8 @@ int balance_condition_fails(struct buffer_head *left, struct buffer_head *right)
/* return 1 if new can be joined with last node on the path or with
its right neighbor, 0 otherwise */
int balance_condition_2_fails(struct buffer_head *new,
struct reiserfs_path *path)
static int balance_condition_2_fails(struct buffer_head *new,
struct reiserfs_path *path)
{
struct buffer_head *bh;
struct reiserfs_key *right_dkey;
@@ -672,8 +674,6 @@ void load_pass_1_result(FILE * fp, reiserfs_filsys_t *fs)
reiserfs_bitmap_zeros(fsck_uninsertables(fs)));
}
extern reiserfs_bitmap_t *leaves_bitmap;
/* reads blocks marked in leaves_bitmap and tries to insert them into
tree */
static void do_pass_1(reiserfs_filsys_t *fs)
+5 -5
View File
@@ -29,8 +29,8 @@ struct reiserfs_path_key {
struct reiserfs_path_key *next, *prev;
};
struct reiserfs_path_key *head_key = NULL;
struct reiserfs_path_key *tail_key = NULL;
static struct reiserfs_path_key *head_key = NULL;
static struct reiserfs_path_key *tail_key = NULL;
static int check_path_key(struct reiserfs_key *key)
{
@@ -68,7 +68,7 @@ static int add_path_key(struct reiserfs_key *key)
return 0;
}
void del_path_key()
static void del_path_key(void)
{
if (tail_key == NULL)
die("Wrong path_key structure");
@@ -750,7 +750,7 @@ static int check_semantic_pass(struct reiserfs_key *key,
return retval;
}
int check_safe_links()
static int check_safe_links(void)
{
struct reiserfs_path safe_link_path, path;
struct reiserfs_key safe_link_key = { -1, 0, {{0, 0}} };
@@ -858,7 +858,7 @@ int check_safe_links()
return OK;
}
void release_safe_links()
static void release_safe_links(void)
{
freemem(trunc_links);
}
+2 -2
View File
@@ -6,7 +6,7 @@
#include "fsck.h"
int screen_width;
int screen_curr_pos;
static int screen_curr_pos;
char *screen_savebuffer;
int screen_savebuffer_len;
@@ -1138,7 +1138,6 @@ static void make_sure_lost_found_exists(reiserfs_filsys_t *fs)
__u64 sd_size;
__u32 sd_blocks;
struct buffer_head *bh;
struct item_head *ih;
void *sd;
int item_len;
@@ -1202,6 +1201,7 @@ static void make_sure_lost_found_exists(reiserfs_filsys_t *fs)
&lost_found_dir_key, 1 << IH_Unreachable);
if (item_len) {
struct item_head *ih;
if (reiserfs_search_by_key_4(fs, &root_dir_key, &path) ==
ITEM_NOT_FOUND)
reiserfs_panic
+1 -1
View File
@@ -14,7 +14,7 @@
fsck_log(fmt, ## list); \
}
int what_fs_version()
static int what_fs_version(void)
{
size_t n = 0;
char *answer = NULL;
+1 -1
View File
@@ -60,7 +60,7 @@ void mark_block_used(unsigned long block, int check_hardware)
reiserfs_bitmap_set_bit(fsck_new_bitmap(fs), block);
}
void mark_block_free(unsigned long block)
static void mark_block_free(unsigned long block)
{
if (!is_block_used(block))
die("mark_block_free: (%lu) is free already", block);