cleanup: rename common structure names

In order to convert reiserfscore into a externally-usable library,
we need to rename structures so they won't collide with other
namespaces.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
Jeff Mahoney committed 2013-08-26 17:12:09 -04:00
1 parent a465518a51
commit b23d40f723
25 files changed
+339 -339

No files matched your search

+22 -22
View File
@@ -541,7 +541,7 @@ struct offset_v2 {
/* Key of the object determines object's location in the tree, composed of 4 components */
struct key {
struct reiserfs_key {
__u32 k2_dir_id; /* packing locality: by default parent directory object id */
__u32 k2_objectid; /* object identifier */
union {
@@ -581,11 +581,11 @@ struct key {
#define set_key_objectid(key,n) ((key)->k_objectid = cpu_to_le32((n)))
*/
#define KEY_SIZE (sizeof(struct key))
#define KEY_SIZE (sizeof(struct reiserfs_key))
#define SHORT_KEY_SIZE 8
// values for k_uniqueness field of the struct key
// values for k_uniqueness field of the struct reiserfs_key
#define V1_SD_UNIQUENESS 0
#define V1_DIRENTRY_UNIQUENESS 500
#define DIRENTRY_UNIQUENESS 500
@@ -593,7 +593,7 @@ struct key {
#define V1_INDIRECT_UNIQUENESS 0xfffffffe
#define V1_UNKNOWN_UNIQUENESS 555
// values for k_type field of the struct key
// values for k_type field of the struct reiserfs_key
#define TYPE_STAT_DATA 0
#define TYPE_INDIRECT 1
#define TYPE_DIRECT 2
@@ -623,7 +623,7 @@ struct key {
struct item_head
{
struct key ih_key; /* Everything in the tree is found by searching for it
struct reiserfs_key ih_key; /* Everything in the tree is found by searching for it
based on its key.*/
union {
@@ -1108,7 +1108,7 @@ struct disk_child {
equal to given key, or which is the maximal key less than the given
key. */
struct path_element {
struct reiserfs_path_element {
struct buffer_head * pe_buffer; /* Pointer to the buffer at the path in
the tree. */
unsigned int pe_position; /* Position in the tree node which is placed
@@ -1134,14 +1134,14 @@ struct path_element {
is still valid. You'll need to read search_by_key and the comments
in it, especially about decrement_counters_in_path(), to understand
this structure. */
struct path {
struct reiserfs_path {
unsigned int path_length; /* Length of the array above. */
struct path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */
struct reiserfs_path_element path_elements[EXTENDED_MAX_HEIGHT]; /* Array of the path elements. */
unsigned int pos_in_item;
};
#define INITIALIZE_PATH(var) \
struct path var = {ILLEGAL_PATH_ELEMENT_OFFSET, }
#define INITIALIZE_REISERFS_PATH(var) \
struct reiserfs_path var = {ILLEGAL_PATH_ELEMENT_OFFSET, }
/* Get path element by path and path position. */
#define PATH_OFFSET_PELEMENT(p_s_path,n_offset) ((p_s_path)->path_elements +(n_offset))
@@ -1312,7 +1312,7 @@ struct tree_balance
{
struct reiserfs_transaction_handle *transaction_handle ;
reiserfs_filsys_t * tb_fs;
struct path * tb_path;
struct reiserfs_path *tb_path;
struct buffer_head * L[MAX_HEIGHT]; /* array of left neighbors of nodes in the path */
struct buffer_head * R[MAX_HEIGHT]; /* array of right neighbors of nodes in the path*/
struct buffer_head * FL[MAX_HEIGHT]; /* array of fathers of the left neighbors */
@@ -1480,7 +1480,7 @@ struct buffer_info {
#define B_N_PITEM_HEAD(bh,item_num) ( (struct item_head * )((bh)->b_data + BLKH_SIZE) + (item_num) )
/* get key */
#define B_N_PDELIM_KEY(bh,item_num) ( (struct key * )((bh)->b_data + BLKH_SIZE) + (item_num) )
#define B_N_PDELIM_KEY(bh,item_num) ( (struct reiserfs_key *)((bh)->b_data + BLKH_SIZE) + (item_num) )
/* get the key */
#define B_N_PKEY(bh,item_num) ( &(B_N_PITEM_HEAD(bh,item_num)->ih_key) )
@@ -1511,18 +1511,18 @@ struct buffer_info {
/* stree.c */
void padd_item (char * item, int total_length, int length);
int B_IS_IN_TREE(struct buffer_head *);
struct key * get_rkey (struct path * p_s_chk_path, reiserfs_filsys_t *);
struct reiserfs_key *get_rkey (struct reiserfs_path *p_s_chk_path, 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 key *, struct path *, int);
int search_by_entry_key (reiserfs_filsys_t *, struct key *, struct path *);
int search_for_position_by_key (reiserfs_filsys_t *, struct key *, struct path *);
int search_by_objectid (reiserfs_filsys_t *, struct key *, struct path *, int *);
void decrement_counters_in_path (struct path * p_s_search_path);
void pathrelse (struct path * p_s_search_path);
int search_by_key (reiserfs_filsys_t *, 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 *);
void decrement_counters_in_path (struct reiserfs_path *p_s_search_path);
void pathrelse (struct reiserfs_path *p_s_search_path);
int is_left_mergeable (reiserfs_filsys_t * s, struct path * path);
int is_right_mergeable (reiserfs_filsys_t * s, struct path * path);
int is_left_mergeable (reiserfs_filsys_t * s, struct reiserfs_path *path);
int is_right_mergeable (reiserfs_filsys_t * s, struct reiserfs_path *path);
int are_items_mergeable (struct item_head * left, struct item_head * right, int bsize);
@@ -1533,7 +1533,7 @@ int fix_nodes (/*struct reiserfs_transaction_handle *th,*/ int n_op_mode, struct
/*int n_pos_in_item,*/ struct item_head * p_s_ins_ih);
void unfix_nodes (/*struct reiserfs_transaction_handle *th,*/ struct tree_balance *);
void free_buffers_in_tb (struct tree_balance * p_s_tb);
void init_path (struct path *);
void init_path (struct reiserfs_path *);
/* prints.c */
/* options */
+35 -35
View File
@@ -76,7 +76,7 @@ typedef struct _transaction reiserfs_trans_t;
/* reiserfslib.c */
void init_tb_struct (struct tree_balance * tb, reiserfs_filsys_t *, struct path * path, int size);
void init_tb_struct (struct tree_balance * tb, reiserfs_filsys_t *, struct reiserfs_path *path, int size);
reiserfs_filsys_t * reiserfs_open (char * filename, int flags, int * error, void * vp, int skip_check);
reiserfs_filsys_t * reiserfs_create (char * filename, int version, unsigned long block_count,
@@ -106,50 +106,50 @@ int spread_bitmaps (reiserfs_filsys_t *);
int filesystem_dirty (reiserfs_filsys_t *);
void mark_filesystem_dirty (reiserfs_filsys_t *);
void reiserfs_paste_into_item (reiserfs_filsys_t *, struct path * path,
void reiserfs_paste_into_item (reiserfs_filsys_t *, struct reiserfs_path *path,
const void * body, int size);
void reiserfs_insert_item (reiserfs_filsys_t *, struct path * path,
void reiserfs_insert_item (reiserfs_filsys_t *, struct reiserfs_path *path,
struct item_head * ih, const void * body);
int reiserfs_locate_entry (reiserfs_filsys_t *, struct key * dir, char * name,
struct path * path);
int reiserfs_find_entry (reiserfs_filsys_t *, struct key * dir, char * name,
unsigned int * min_gen_counter, struct key * key);
int reiserfs_add_entry (reiserfs_filsys_t *, struct key * dir, char * name, int name_len,
struct key * key, __u16 fsck_need);
int reiserfs_locate_entry (reiserfs_filsys_t *, struct reiserfs_key *dir, char * name,
struct reiserfs_path *path);
int reiserfs_find_entry (reiserfs_filsys_t *, struct reiserfs_key *dir, char * name,
unsigned int * min_gen_counter, struct reiserfs_key *key);
int reiserfs_add_entry (reiserfs_filsys_t *, struct reiserfs_key *dir, char * name, int name_len,
struct reiserfs_key *key, __u16 fsck_need);
struct key * uget_lkey (struct path * path);
struct key * uget_rkey (struct path * path);
int reiserfs_search_by_key_3 (reiserfs_filsys_t *, struct key * key,
struct path * path);
int reiserfs_search_by_key_4 (reiserfs_filsys_t *, struct key * key,
struct path * path);
int reiserfs_search_by_entry_key (reiserfs_filsys_t *, struct key * key,
struct path * path);
int usearch_by_position (reiserfs_filsys_t *, struct key * key, int version, struct path * path);
struct key * reiserfs_next_key (struct path * path);
struct reiserfs_key *uget_lkey (struct reiserfs_path *path);
struct reiserfs_key *uget_rkey (struct reiserfs_path *path);
int reiserfs_search_by_key_3 (reiserfs_filsys_t *, struct reiserfs_key *key,
struct reiserfs_path *path);
int reiserfs_search_by_key_4 (reiserfs_filsys_t *, struct reiserfs_key *key,
struct reiserfs_path *path);
int reiserfs_search_by_entry_key (reiserfs_filsys_t *, struct reiserfs_key *key,
struct reiserfs_path *path);
int usearch_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);
void copy_key (void * to, void * from);
void copy_short_key (void * to, void * from);
void copy_item_head(void * p_v_to, void * p_v_from);
int comp_keys (const void * k1, const void * k2);
int comp_keys_3 (const void * k1, const void * k2);
int comp_short_keys (const void * p_s_key1, const void * p_s_key2);
int comp_items (struct item_head * p_s_ih, struct path * p_s_path);
int comp_items (struct item_head * p_s_ih, struct reiserfs_path *p_s_path);
__u32 hash_value (hashf_t func, char * name, int namelen);
int create_dir_sd (reiserfs_filsys_t * fs,
struct path * path, struct key * key,
struct reiserfs_path *path, 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 *),
int ih_flags);
typedef void (*badblock_func_t) (reiserfs_filsys_t *fs,
struct path *badblock_path,
struct reiserfs_path *badblock_path,
void *data);
void mark_badblock(reiserfs_filsys_t *fs, struct path *badblock_path, void *data);
void mark_badblock(reiserfs_filsys_t *fs, struct reiserfs_path *badblock_path, void *data);
int create_badblock_bitmap (reiserfs_filsys_t * fs, char * badblocks_file);
void add_badblock_list (reiserfs_filsys_t * fs, int no_badblock_in_tree_yet);
void badblock_list(reiserfs_filsys_t * fs, badblock_func_t action, void *data);
@@ -157,9 +157,9 @@ void badblock_list(reiserfs_filsys_t * fs, badblock_func_t action, void *data);
#define reiserfs_bmap_nr(count, blk_size) ((count - 1) / (blk_size * 8) + 1)
#define reiserfs_bmap_over(nr) (nr > ((1LL << 16) - 1))
extern struct key root_dir_key;
extern struct key parent_root_dir_key;
extern struct key lost_found_dir_key;
extern struct reiserfs_key root_dir_key;
extern struct reiserfs_key parent_root_dir_key;
extern struct reiserfs_key lost_found_dir_key;
extern __u16 root_dir_format;
extern __u16 lost_found_dir_format;
@@ -206,7 +206,7 @@ reiserfs_bitmap_t * reiserfs_bitmap_load (FILE * fp);
void reiserfs_bitmap_invert (reiserfs_bitmap_t * bm);
int reiserfs_remove_entry (reiserfs_filsys_t *, struct key * key);
int reiserfs_remove_entry (reiserfs_filsys_t *, struct reiserfs_key *key);
@@ -262,16 +262,16 @@ typedef void (*item_head_action_t) (struct item_head * ih);
void for_every_item (struct buffer_head * bh, item_head_action_t action,
item_action_t * actions);
int key_format (const struct key * key);
unsigned long long get_offset (const struct key * key);
int key_format (const struct reiserfs_key *key);
unsigned long long get_offset (const struct reiserfs_key *key);
int uniqueness2type (__u32 uniqueness);
__u32 type2uniqueness (int type);
int get_type (const struct key * key);
char * key_of_what (const struct key * key);
int type_unknown (struct key * key);
void set_type (int format, struct key * key, int type);
void set_offset (int format, struct key * key, loff_t offset);
void set_type_and_offset (int format, struct key * key, loff_t offset, 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);
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, int type);
typedef int (*check_unfm_func_t) (reiserfs_filsys_t *, __u32);