reiserfscore: constify struct pointer arguments

There are many cases where functions take pointers to keys, item heads,
paths, etc and don't modify them. Let's annotate them properly.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
Jeff Mahoney committed 2014-03-13 17:42:58 -04:00
1 parent 9b52a79ba2
commit 6daa8a9c5a
16 files changed
+97 -91

No files matched your search

+11 -11
View File
@@ -1436,11 +1436,11 @@ struct reiserfs_acl_header {
/* stree.c */
void padd_item (char * item, int total_length, int length);
int B_IS_IN_TREE(struct buffer_head *);
int B_IS_IN_TREE(const struct buffer_head *);
const struct reiserfs_key *get_rkey(const struct reiserfs_path *p_s_chk_path,
const reiserfs_filsys_t );
int bin_search (void * p_v_key, void * p_v_base, int p_n_num, int p_n_width, unsigned int * p_n_pos);
int search_by_key (reiserfs_filsys_t , struct reiserfs_key *, struct reiserfs_path *, int);
int bin_search (const void * p_v_key, const void * p_v_base, int p_n_num, int p_n_width, unsigned int * p_n_pos);
int search_by_key (reiserfs_filsys_t , const struct reiserfs_key *, struct reiserfs_path *, int);
int search_by_entry_key (reiserfs_filsys_t , struct reiserfs_key *, struct reiserfs_path *);
int search_for_position_by_key (reiserfs_filsys_t , struct reiserfs_key *, struct reiserfs_path *);
int search_by_objectid (reiserfs_filsys_t , struct reiserfs_key *, struct reiserfs_path *, int *);
@@ -1507,8 +1507,8 @@ int balance_internal (struct tree_balance * , int, int, struct item_head * ,
void do_balance (struct tree_balance * tb,
struct item_head * ih, const char * body, int flag, int zeros_num);
void reiserfs_invalidate_buffer (struct tree_balance * tb, struct buffer_head * bh);
int get_left_neighbor_position (struct tree_balance * tb, int h);
int get_right_neighbor_position (struct tree_balance * tb, int h);
int get_left_neighbor_position (const struct tree_balance * tb, int h);
int get_right_neighbor_position (const struct tree_balance * tb, int h);
void replace_key (reiserfs_filsys_t , struct buffer_head *, int, struct buffer_head *, int);
void replace_lkey (struct tree_balance *, int, struct item_head *);
void replace_rkey (struct tree_balance *, int, struct item_head *);
@@ -1535,7 +1535,7 @@ extern unsigned int get_journal_new_start_must (reiserfs_filsys_t fs);
extern unsigned int get_journal_start_must (reiserfs_filsys_t fs);
/*extern hashf_t hashes [];*/
static inline void buffer_info_init_left(struct tree_balance *tb,
static inline void buffer_info_init_left(const struct tree_balance *tb,
struct buffer_info *bi, int h)
{
bi->bi_fs = tb->tb_fs;
@@ -1544,7 +1544,7 @@ static inline void buffer_info_init_left(struct tree_balance *tb,
bi->bi_position = get_left_neighbor_position(tb, h);
}
static inline void buffer_info_init_right(struct tree_balance *tb,
static inline void buffer_info_init_right(const struct tree_balance *tb,
struct buffer_info *bi, int h)
{
bi->bi_fs = tb->tb_fs;
@@ -1553,7 +1553,7 @@ static inline void buffer_info_init_right(struct tree_balance *tb,
bi->bi_position = get_right_neighbor_position(tb, h);
}
static inline void buffer_info_init_last(struct tree_balance *tb,
static inline void buffer_info_init_last(const struct tree_balance *tb,
struct buffer_info *bi)
{
bi->bi_fs = tb->tb_fs;
@@ -1562,7 +1562,7 @@ static inline void buffer_info_init_last(struct tree_balance *tb,
bi->bi_position = PATH_H_B_ITEM_ORDER(tb->tb_path, 0);
}
static inline void buffer_info_init_tbSh(struct tree_balance *tb,
static inline void buffer_info_init_tbSh(const struct tree_balance *tb,
struct buffer_info *bi, int h)
{
bi->bi_fs = tb->tb_fs;
@@ -1571,13 +1571,13 @@ static inline void buffer_info_init_tbSh(struct tree_balance *tb,
bi->bi_position = PATH_H_POSITION(tb->tb_path, h + 1);
}
static inline void buffer_info_init_tbS0(struct tree_balance *tb,
static inline void buffer_info_init_tbS0(const struct tree_balance *tb,
struct buffer_info *bi)
{
buffer_info_init_tbSh(tb, bi, 0);
}
static inline void buffer_info_init_bh(struct tree_balance *tb,
static inline void buffer_info_init_bh(const struct tree_balance *tb,
struct buffer_info *bi,
struct buffer_head *bh)
{
+15 -15
View File
@@ -113,15 +113,15 @@ void reiserfs_insert_item(reiserfs_filsys_t , struct reiserfs_path *path,
int reiserfs_locate_entry(reiserfs_filsys_t , struct reiserfs_key *dir,
const char *name, struct reiserfs_path *path);
int reiserfs_find_entry(reiserfs_filsys_t , struct reiserfs_key *dir,
int reiserfs_find_entry(reiserfs_filsys_t , const struct reiserfs_key *dir,
const char *name, unsigned int *min_gen_counter,
struct reiserfs_key *key);
int reiserfs_add_entry(reiserfs_filsys_t , struct reiserfs_key *dir,
const char *name, int name_len, struct reiserfs_key *key,
__u16 fsck_need);
int reiserfs_add_entry(reiserfs_filsys_t , const struct reiserfs_key *dir,
const char *name, int name_len,
const struct reiserfs_key *key, __u16 fsck_need);
struct reiserfs_key *uget_lkey(struct reiserfs_path *path);
struct reiserfs_key *uget_rkey(struct reiserfs_path *path);
struct reiserfs_key *uget_lkey(const struct reiserfs_path *path);
struct reiserfs_key *uget_rkey(const struct reiserfs_path *path);
int reiserfs_search_by_key_3(reiserfs_filsys_t , const struct reiserfs_key *key,
struct reiserfs_path *path);
int reiserfs_search_by_key_4(reiserfs_filsys_t , const struct reiserfs_key *key,
@@ -131,7 +131,7 @@ int reiserfs_search_by_entry_key(reiserfs_filsys_t,
struct reiserfs_path *path);
int reiserfs_search_by_position(reiserfs_filsys_t , struct reiserfs_key *key,
int version, struct reiserfs_path *path);
struct reiserfs_key *reiserfs_next_key(struct reiserfs_path *path);
struct reiserfs_key *reiserfs_next_key(const struct reiserfs_path *path);
void copy_key(void *to, const void *from);
void copy_short_key(void *to, const void *from);
int comp_keys(const void *k1, const void *k2);
@@ -142,7 +142,7 @@ int comp_items(struct item_head *p_s_ih, struct reiserfs_path *p_s_path);
__u32 hash_value(hashf_t func, const char *name, int namelen);
int create_dir_sd(reiserfs_filsys_t fs,
struct reiserfs_path *path, struct reiserfs_key *key,
struct reiserfs_path *path, const struct reiserfs_key *key,
void (*modify_item) (struct item_head *, void *));
void make_sure_root_dir_exists(reiserfs_filsys_t fs,
void (*modyfy_item) (struct item_head *, void *),
@@ -234,7 +234,7 @@ int is_stage_magic_correct(FILE * fp);
reiserfs_bitmap_t *reiserfs_bitmap_load(FILE * fp);
void reiserfs_bitmap_invert(reiserfs_bitmap_t *bm);
int reiserfs_remove_entry(reiserfs_filsys_t , struct reiserfs_key *key);
int reiserfs_remove_entry(reiserfs_filsys_t, const struct reiserfs_key *key);
/* node_formats.c */
@@ -260,7 +260,7 @@ int who_is_this(const char *buf, int blocksize);
int leaf_count_ih(const char *buf, int blocksize);
int leaf_free_space_estimate(const char *buf, int blocksize);
int is_a_leaf(const char *buf, int blocksize);
int leaf_item_number_estimate(struct buffer_head *bh);
int leaf_item_number_estimate(const struct buffer_head *bh);
char *which_block(int code);
int get_journal_size(reiserfs_filsys_t );
@@ -293,7 +293,7 @@ int uniqueness2type(__u32 uniqueness);
__u32 type2uniqueness(int type);
int get_type(const struct reiserfs_key *key);
char *key_of_what(const struct reiserfs_key *key);
int type_unknown(struct reiserfs_key *key);
int type_unknown(const struct reiserfs_key *key);
void set_type(int format, struct reiserfs_key *key, int type);
void set_offset(int format, struct reiserfs_key *key, loff_t offset);
void set_type_and_offset(int format, struct reiserfs_key *key, loff_t offset,
@@ -314,11 +314,11 @@ hashf_t name2func(const char *hash);
int find_hash_in_use(const char *name, int namelen, __u32 deh_offset,
unsigned int code_to_try_first);
int entry_length(struct item_head *ih, struct reiserfs_de_head *deh,
int entry_length(const struct item_head *ih, const struct reiserfs_de_head *deh,
int pos_in_item);
char *name_in_entry(struct reiserfs_de_head *deh, int pos_in_item);
int name_in_entry_length(struct item_head *ih,
struct reiserfs_de_head *deh, int pos_in_item);
char *name_in_entry(const struct reiserfs_de_head *deh, int pos_in_item);
int name_in_entry_length(const struct item_head *ih,
const struct reiserfs_de_head *deh, int pos_in_item);
int name_length(const char *name, int key_format);
/* access to stat data fields */