📄 reiserfs_lib.h
字号:
/* node_formats.c */#define THE_LEAF 1#define THE_INTERNAL 2#define THE_SUPER 3#define THE_JDESC 4#define HAS_IH_ARRAY 5#define THE_UNKNOWN 6int is_blocksize_correct (unsigned int blocksize);int is_reiserfs_3_5_magic_string (struct reiserfs_super_block * rs);int is_reiserfs_3_6_magic_string (struct reiserfs_super_block * rs);int is_reiserfs_jr_magic_string (struct reiserfs_super_block * rs);int does_look_like_super_block (struct reiserfs_super_block * rs);int is_any_reiserfs_magic_string (struct reiserfs_super_block * rs);int get_reiserfs_format (struct reiserfs_super_block * sb);int reiserfs_super_block_size (struct reiserfs_super_block * rs);/*int magic_2_version (struct reiserfs_super_block * rs);*/int is_prejournaled_reiserfs (struct reiserfs_super_block * rs);int who_is_this (char * buf, int blocksize);int leaf_count_ih(char * buf, int blocksize);int leaf_free_space_estimate(char * buf, int blocksize);int is_a_leaf(char * buf, int blocksize);int leaf_item_number_estimate(struct buffer_head * bh);char * which_block (int code);int get_journal_size (reiserfs_filsys_t *);int not_data_block (reiserfs_filsys_t *, unsigned long block);int not_journalable (reiserfs_filsys_t *, unsigned long block);int block_of_bitmap (reiserfs_filsys_t *, unsigned long block);int block_of_journal (reiserfs_filsys_t *, unsigned long block);int is_tree_node (struct buffer_head * bh, int level);int is_properly_hashed (reiserfs_filsys_t *, char * name, int namelen, __u32 offset);int dir_entry_bad_location (struct reiserfs_de_head * deh, struct item_head * ih, int first);void make_dir_stat_data (int blocksize, int key_format, __u32 dirid, __u32 objectid, struct item_head * ih, void * sd);void make_empty_dir_item_v1 (char * body, __u32 dirid, __u32 objid, __u32 par_dirid, __u32 par_objid);void make_empty_dir_item (char * body, __u32 dirid, __u32 objid, __u32 par_dirid, __u32 par_objid);int reiserfs_is_fs_consistent (reiserfs_filsys_t * fs);typedef void (*item_action_t) (struct buffer_head * bh, struct item_head * ih);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 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);typedef int (*check_unfm_func_t) (reiserfs_filsys_t *, __u32);int is_it_bad_item (reiserfs_filsys_t *, struct item_head *, char *, check_unfm_func_t, int bad_dir);#define hash_func_is_unknown(fs) ((fs)->fs_hash_function == 0)#define reiserfs_hash(fs) ((fs)->fs_hash_function)int known_hashes (void);char *code2name (unsigned int code);int func2code (hashf_t func);hashf_t code2func (unsigned int code);hashf_t name2func (char * hash);int find_hash_in_use (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 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);int name_length (char * name, int key_format);/* access to stat data fields */void get_set_sd_field (int field, struct item_head * ih, void * sd, void * value, int set);#define GET_SD_MODE 0#define GET_SD_SIZE 1#define GET_SD_NLINK 2#define GET_SD_BLOCKS 3#define GET_SD_FIRST_DIRECT_BYTE 4#define get_sd_mode(ih,sd,pmode) get_set_sd_field (GET_SD_MODE, ih, sd, pmode, 0/*get*/)#define set_sd_mode(ih,sd,pmode) get_set_sd_field (GET_SD_MODE, ih, sd, pmode, 1/*set*/)#define get_sd_size(ih,sd,psize) get_set_sd_field (GET_SD_SIZE, ih, sd, psize, 0/*get*/)#define set_sd_size(ih,sd,psize) get_set_sd_field (GET_SD_SIZE, ih, sd, psize, 1/*set*/)#define get_sd_blocks(ih,sd,pblocks) get_set_sd_field (GET_SD_BLOCKS, ih, sd, pblocks, 0/*get*/)#define set_sd_blocks(ih,sd,pblocks) get_set_sd_field (GET_SD_BLOCKS, ih, sd, pblocks, 1/*set*/)//#define get_sd_rdev(ih,sd,pblocks) get_set_sd_field (GET_SD_RDEV, ih, sd, pblocks, 0/*get*/)//#define set_sd_rdev(ih,sd,pblocks) get_set_sd_field (GET_SD_RDEV, ih, sd, pblocks, 1/*set*/)//#define get_sd_generation(ih,sd,pblocks) get_set_sd_field (GET_SD_GENER, ih, sd, pblocks, 0/*get*/)//#define set_sd_generation(ih,sd,pblocks) get_set_sd_field (GET_SD_GENER, ih, sd, pblocks, 1/*set*/)#define get_sd_nlink(ih,sd,pnlink) get_set_sd_field (GET_SD_NLINK, ih, sd, pnlink, 0/*get*/)#define set_sd_nlink(ih,sd,pnlink) get_set_sd_field (GET_SD_NLINK, ih, sd, pnlink, 1/*set*/)#define get_sd_first_direct_byte(ih,sd,pfdb) get_set_sd_field (GET_SD_FIRST_DIRECT_BYTE, ih, sd, pfdb, 0/*get*/)#define set_sd_first_direct_byte(ih,sd,pfdb) get_set_sd_field (GET_SD_FIRST_DIRECT_BYTE, ih, sd, pfdb, 1/*set*/)int is_objectid_used (reiserfs_filsys_t * fs, __u32 objectid);void mark_objectid_used (reiserfs_filsys_t * fs, __u32 objectid);/* journal.c */int get_boundary_transactions (reiserfs_filsys_t *, reiserfs_trans_t *, reiserfs_trans_t *);int next_transaction (reiserfs_filsys_t *, reiserfs_trans_t *, reiserfs_trans_t);int replay_one_transaction (reiserfs_filsys_t *, reiserfs_trans_t *);typedef void (*action_on_trans_t) (reiserfs_filsys_t *, reiserfs_trans_t *);void for_each_transaction (reiserfs_filsys_t *, action_on_trans_t);typedef void (*action_on_block_t) (reiserfs_filsys_t *, reiserfs_trans_t *, unsigned int index, unsigned long in_journal, unsigned long in_place);void for_each_block (reiserfs_filsys_t * fs, reiserfs_trans_t * trans, action_on_block_t action);int reiserfs_open_journal (reiserfs_filsys_t *, char *, int flags);int reiserfs_journal_params_check(reiserfs_filsys_t *fs);int reiserfs_create_journal (reiserfs_filsys_t * fs, char * j_filename, unsigned long offset, unsigned long len, int transaction_max_size);int reiserfs_journal_opened (reiserfs_filsys_t *);void reiserfs_flush_journal (reiserfs_filsys_t * fs);void reiserfs_free_journal (reiserfs_filsys_t * fs);void reiserfs_close_journal (reiserfs_filsys_t *);void reiserfs_reopen_journal (reiserfs_filsys_t * fs, int flag);__u32 advise_journal_max_trans_age (void);__u32 advise_journal_max_commit_age (void);__u32 advise_journal_max_batch (unsigned long journal_trans_max);__u32 advise_journal_max_trans_len (__u32 desired, __u32 journal_size, int blocksize, int verbose);/* prints.c */void print_indirect_item (FILE * fp, struct buffer_head * bh, int item_num);void print_block (FILE * fp, reiserfs_filsys_t *, struct buffer_head * bh, ...);//int print_mode, int first, int last);int print_super_block (FILE * fp, reiserfs_filsys_t *, char * file_name, struct buffer_head * bh, int short_print);void print_journal (reiserfs_filsys_t *);void print_journal_header (reiserfs_filsys_t * fs);void reiserfs_warning (FILE * fp, const char * fmt, ...);char ftypelet (mode_t mode);void reiserfs_print_item (FILE * fp, struct buffer_head * bh, struct item_head * ih);void print_filesystem_state (FILE * fp, reiserfs_filsys_t * fs);void print_one_transaction (reiserfs_filsys_t * fs, reiserfs_trans_t * trans);void print_journal_params (FILE * fp, struct journal_params * jp);char * get_reiserfs_version (__u16 version);int can_we_format_it (char * device_name, int force);#define reiserfs_panic(fmt, list...) \{\ fflush (stdout);\ fprintf (stderr, "%s %d %s\n", __FILE__, __LINE__, __FUNCTION__);\ reiserfs_warning (stderr, (const char *)fmt, ## list);\ reiserfs_warning (stderr, "\n" );\ abort ();\}#define reiserfs_exit(val, fmt, list...) \{\ fflush (stdout);\ reiserfs_warning (stderr, (const char *)fmt, ## list);\ reiserfs_warning (stderr, "\n" );\ exit (val);\}#define check_forcing_ask_confirmation(force) \ if (force < 1) {\ /* avoid formatting it without being forced */\ reiserfs_warning (stderr, "Use -f to force over\n");\ return 0;\ }\ if (force < 2) {\ if (!user_confirmed (stderr, "Continue (y/n):", "y\n"))\ return 0;\ }\#endif /* REISERFSPROGS_LIB_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -