Bugzilla – Attachment 39001 Details for
Bug 84600
grub cannot load current STABLE kernel
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
preprocessed instrumented fsys_reiserfs.i showing the problem
fsys_reiserfs.i (text/plain), 48.04 KB, created by
Michael Matz
on 2005-06-11 03:36:41 UTC
(
hide
)
Description:
preprocessed instrumented fsys_reiserfs.i showing the problem
Filename:
MIME Type:
Creator:
Michael Matz
Created:
2005-06-11 03:36:41 UTC
Size:
48.04 KB
patch
obsolete
># 1 "fsys_reiserfs.c" ># 1 "<built-in>" ># 1 "<command line>" ># 1 "fsys_reiserfs.c" ># 22 "fsys_reiserfs.c" ># 1 "shared.h" 1 ># 28 "shared.h" ># 1 "../config.h" 1 ># 29 "shared.h" 2 ># 194 "shared.h" ># 1 "../stage1/stage1.h" 1 ># 195 "shared.h" 2 ># 405 "shared.h" ># 1 "mb_header.h" 1 ># 24 "mb_header.h" >struct multiboot_header >{ > > unsigned magic; > > > unsigned flags; > > > > > > > unsigned checksum; > > > unsigned header_addr; > unsigned load_addr; > unsigned load_end_addr; > unsigned bss_end_addr; > unsigned entry_addr; > > > unsigned mode_type; > unsigned width; > unsigned height; > unsigned depth; >}; ># 406 "shared.h" 2 ># 1 "mb_info.h" 1 ># 24 "mb_info.h" >struct mod_list >{ > > unsigned long mod_start; > unsigned long mod_end; > > > unsigned long cmdline; > > > unsigned long pad; >}; ># 45 "mb_info.h" >struct AddrRangeDesc >{ > unsigned long size; > unsigned long long BaseAddr; > unsigned long long Length; > unsigned long Type; > > >} __attribute__ ((packed)); > > > > > > >struct drive_info >{ > > unsigned long size; > > > unsigned char drive_number; > > > unsigned char drive_mode; > > > unsigned short drive_cylinders; > unsigned char drive_heads; > unsigned char drive_sectors; > > > unsigned short drive_ports[0]; >}; > > > > > > > >struct apm_info >{ > unsigned short version; > unsigned short cseg; > unsigned long offset; > unsigned short cseg_16; > unsigned short dseg_16; > unsigned short cseg_len; > unsigned short cseg_16_len; > unsigned short dseg_16_len; >}; ># 106 "mb_info.h" >struct multiboot_info >{ > > unsigned long flags; > > > unsigned long mem_lower; > unsigned long mem_upper; > > > unsigned long boot_device; > > > unsigned long cmdline; > > > unsigned long mods_count; > unsigned long mods_addr; > > union > { > struct > { > > unsigned long tabsize; > unsigned long strsize; > unsigned long addr; > unsigned long pad; > } > a; > > struct > { > > unsigned long num; > unsigned long size; > unsigned long addr; > unsigned long shndx; > } > e; > } > syms; > > > unsigned long mmap_length; > unsigned long mmap_addr; > > > unsigned long drives_length; > unsigned long drives_addr; > > > unsigned long config_table; > > > unsigned long boot_loader_name; > > > unsigned long apm_table; > > > unsigned long vbe_control_info; > unsigned long vbe_mode_info; > unsigned short vbe_mode; > unsigned short vbe_interface_seg; > unsigned short vbe_interface_off; > unsigned short vbe_interface_len; >}; ># 407 "shared.h" 2 > > >struct linux_kernel_header >{ > char code1[0x0020]; > unsigned short cl_magic; > unsigned short cl_offset; > char code2[0x01F1 - 0x0020 - 2 - 2]; > unsigned char setup_sects; > unsigned short root_flags; > unsigned short syssize; > unsigned short swap_dev; > unsigned short ram_size; > unsigned short vid_mode; > unsigned short root_dev; > unsigned short boot_flag; > unsigned short jump; > unsigned long header; > unsigned short version; > unsigned long realmode_swtch; > unsigned long start_sys; > unsigned char type_of_loader; > unsigned char loadflags; > unsigned short setup_move_size; > unsigned long code32_start; > unsigned long ramdisk_image; > unsigned long ramdisk_size; > unsigned long bootsect_kludge; > unsigned short heap_end_ptr; > unsigned short pad1; > char *cmd_line_ptr; > unsigned long initrd_addr_max; >} __attribute__ ((packed)); > > >struct mmar_desc >{ > unsigned long desc_len; > unsigned long long addr; > unsigned long long length; > unsigned long type; >} __attribute__ ((packed)); > > >struct vbe_controller >{ > unsigned char signature[4]; > unsigned short version; > unsigned long oem_string; > unsigned long capabilities; > unsigned long video_mode; > unsigned short total_memory; > unsigned short oem_software_rev; > unsigned long oem_vendor_name; > unsigned long oem_product_name; > unsigned long oem_product_rev; > unsigned char reserved[222]; > unsigned char oem_data[256]; >} __attribute__ ((packed)); > > >struct vbe_mode >{ > unsigned short mode_attributes; > unsigned char win_a_attributes; > unsigned char win_b_attributes; > unsigned short win_granularity; > unsigned short win_size; > unsigned short win_a_segment; > unsigned short win_b_segment; > unsigned long win_func; > unsigned short bytes_per_scanline; > > > unsigned short x_resolution; > unsigned short y_resolution; > unsigned char x_char_size; > unsigned char y_char_size; > unsigned char number_of_planes; > unsigned char bits_per_pixel; > unsigned char number_of_banks; > unsigned char memory_model; > unsigned char bank_size; > unsigned char number_of_image_pages; > unsigned char reserved0; > > > unsigned char red_mask_size; > unsigned char red_field_position; > unsigned char green_mask_size; > unsigned char green_field_position; > unsigned char blue_mask_size; > unsigned char blue_field_position; > unsigned char reserved_mask_size; > unsigned char reserved_field_position; > unsigned char direct_color_mode_info; > > > unsigned long phys_base; > unsigned long reserved1; > unsigned short reversed2; > > > unsigned short linear_bytes_per_scanline; > unsigned char banked_number_of_image_pages; > unsigned char linear_number_of_image_pages; > unsigned char linear_red_mask_size; > unsigned char linear_red_field_position; > unsigned char linear_green_mask_size; > unsigned char linear_green_field_position; > unsigned char linear_blue_mask_size; > unsigned char linear_blue_field_position; > unsigned char linear_reserved_mask_size; > unsigned char linear_reserved_field_position; > unsigned long max_pixel_clock; > > unsigned char reserved3[189]; >} __attribute__ ((packed)); > > > > > > >typedef enum >{ > ERR_NONE = 0, > ERR_BAD_FILENAME, > ERR_BAD_FILETYPE, > ERR_BAD_GZIP_DATA, > ERR_BAD_GZIP_HEADER, > ERR_BAD_PART_TABLE, > ERR_BAD_VERSION, > ERR_BELOW_1MB, > ERR_BOOT_COMMAND, > ERR_BOOT_FAILURE, > ERR_BOOT_FEATURES, > ERR_DEV_FORMAT, > ERR_DEV_VALUES, > ERR_EXEC_FORMAT, > ERR_FILELENGTH, > ERR_FILE_NOT_FOUND, > ERR_FSYS_CORRUPT, > ERR_FSYS_MOUNT, > ERR_GEOM, > ERR_NEED_LX_KERNEL, > ERR_NEED_MB_KERNEL, > ERR_NO_DISK, > ERR_NO_PART, > ERR_NUMBER_PARSING, > ERR_OUTSIDE_PART, > ERR_READ, > ERR_SYMLINK_LOOP, > ERR_UNRECOGNIZED, > ERR_WONT_FIT, > ERR_WRITE, > ERR_BAD_ARGUMENT, > ERR_UNALIGNED, > ERR_PRIVILEGED, > ERR_DEV_NEED_INIT, > ERR_NO_DISK_SPACE, > ERR_NUMBER_OVERFLOW, > > MAX_ERR_NUM >} grub_error_t; > >extern unsigned long install_partition; >extern unsigned long boot_drive; >extern unsigned long install_second_sector; >extern struct apm_info apm_bios_info; >extern unsigned long boot_part_addr; >extern int saved_entryno; >extern unsigned char force_lba; >extern char version_string[]; >extern char config_file[]; >extern unsigned long linux_text_len; >extern char *linux_data_tmp_addr; >extern char *linux_data_real_addr; ># 614 "shared.h" >extern int fallback_entries[8]; >extern int fallback_entryno; >extern int default_entry; >extern int current_entryno; > > > > > > > >typedef struct { > unsigned ok; > unsigned mem_start, mem_cur, mem_max; > unsigned code_seg; > unsigned jmp_table[12]; > unsigned char sys_cfg[32]; > char *cmdline; > unsigned cmdline_len; > char *menu_list; > char *menu_default_entry; > unsigned menu_entries; > unsigned menu_entry_len; > char *args_list; > unsigned args_entry_len; > unsigned timeout; > unsigned mem_file; > unsigned mem_align; >} __attribute__ ((packed)) gfx_data_t; > >extern gfx_data_t *graphics_data; > > >extern char graphics_file[64]; > >int gfx_init(gfx_data_t *gfx_data); >int gfx_done(gfx_data_t *gfx_data); >int gfx_input(gfx_data_t *gfx_data, int *menu_entry); >int gfx_setup_menu(gfx_data_t *gfx_data); > > >typedef enum >{ > PASSWORD_PLAIN, > PASSWORD_MD5, > PASSWORD_UNSUPPORTED >} >password_t; > >extern char *password; >extern password_t password_type; >extern int auth; >extern char commands[]; > > >extern int max_lines; >extern int count_lines; >extern int use_pager; > > > >extern int no_decompression; >extern int compressed_file; > > > >extern void (*disk_read_hook) (int, int, int); >extern void (*disk_read_func) (int, int, int); > > > >extern int debug; > > >extern unsigned long current_drive; >extern unsigned long current_partition; > >extern int fsys_type; > > > > >struct geometry >{ > > unsigned long cylinders; > > unsigned long heads; > > unsigned long sectors; > > unsigned long total_sectors; > > unsigned long sector_size; > > unsigned long flags; >}; > >extern unsigned long part_start; >extern unsigned long part_length; > >extern int current_slice; > >extern int buf_drive; >extern int buf_track; >extern struct geometry buf_geom; > > >extern int filepos; >extern int filemax; > > > > > >extern struct multiboot_info mbi; >extern unsigned long saved_drive; >extern unsigned long saved_partition; >extern unsigned long cdrom_drive; > >extern unsigned long saved_mem_upper; >extern unsigned long extended_memory; > > > > > > >extern grub_error_t errnum; >extern char *err_list[]; > > >typedef void (*entry_func) (int, int, int, int, int, int) > __attribute__ ((noreturn)); > >extern entry_func entry_addr; > > >void cmain (void); > > >void stop (void) __attribute__ ((noreturn)); > > >void grub_reboot (void) __attribute__ ((noreturn)); > > > >void grub_halt (int no_apm) __attribute__ ((noreturn)); > > >void set_int13_handler (unsigned short *map); > > >void set_int15_handler (void); > > >void unset_int15_handler (void); > > >void track_int13 (int drive); > > >extern unsigned short bios_key_map[]; >extern unsigned short ascii_key_map[]; >extern unsigned short io_map[]; > > >void chain_stage1 (unsigned long segment, unsigned long offset, > unsigned long part_table_addr) > __attribute__ ((noreturn)); >void chain_stage2 (unsigned long segment, unsigned long offset, > int second_sector) > __attribute__ ((noreturn)); > > >void linux_boot (void) __attribute__ ((noreturn)); > > >void big_linux_boot (void) __attribute__ ((noreturn)); > > >void multi_boot (int start, int mb_info) __attribute__ ((noreturn)); > > > > > >void gateA20 (int linear); > > >int get_memsize (int type); >int get_eisamemsize (void); > > > > > >int get_mmap_entry (struct mmar_desc *desc, int cont); > > > >unsigned long get_rom_config_table (void); > > >void get_apm_info (void); > > >int get_vbe_controller_info (struct vbe_controller *controller); > > >int get_vbe_mode_info (int mode_number, struct vbe_mode *mode); > > >int set_vbe_mode (int mode_number); > > >int get_code_end (void); > > >int getrtsecs (void); >int currticks (void); > > >void cls (void); > > >int setcursor (int on); > > > > >int getxy (void); > > >void gotoxy (int x, int y); > > > >void grub_putchar (int c); > > > >int getkey (void); > > > >int checkkey (void); > > >int get_diskinfo (int drive, struct geometry *geometry); >int biosdisk (int subfunc, int drive, struct geometry *geometry, > int sector, int nsec, int segment); >void stop_floppy (void); ># 881 "shared.h" >struct builtin >{ > > char *name; > > int (*func) (char *, int); > > int flags; > > char *short_doc; > > char *long_doc; >}; > > >extern struct builtin *builtin_table[]; > > >typedef enum >{ > KERNEL_TYPE_NONE, > KERNEL_TYPE_MULTIBOOT, > KERNEL_TYPE_LINUX, > KERNEL_TYPE_BIG_LINUX, > KERNEL_TYPE_FREEBSD, > KERNEL_TYPE_NETBSD, > KERNEL_TYPE_CHAINLOADER >} >kernel_t; > >extern kernel_t kernel_type; >extern int show_menu; >extern int grub_timeout; > >void init_builtins (void); >void init_config (void); >char *skip_to (int after_equal, char *cmdline); >struct builtin *find_command (char *command); >void print_cmdline_message (int forever); >void enter_cmdline (char *heap, int forever); >int run_script (char *script, char *heap); > > > >void grub_printf (const char *format,...); >int grub_sprintf (char *buffer, const char *format, ...); >int grub_tolower (int c); >int grub_isspace (int c); >int grub_strncat (char *s1, const char *s2, int n); >void *grub_memmove (void *to, const void *from, int len); >void *grub_memset (void *start, int c, int len); >int grub_strncat (char *s1, const char *s2, int n); >char *grub_strstr (const char *s1, const char *s2); >int grub_memcmp (const char *s1, const char *s2, int n); >int grub_strcmp (const char *s1, const char *s2); >int grub_strlen (const char *str); >char *grub_strcpy (char *dest, const char *src); > > >typedef unsigned long grub_jmp_buf[6]; ># 951 "shared.h" >int grub_setjmp (grub_jmp_buf env); >void grub_longjmp (grub_jmp_buf env, int val); > > > >extern grub_jmp_buf restart_env; > >extern grub_jmp_buf restart_cmdline_env; > > >void init_page (void); >void print_error (void); >char *convert_to_ascii (char *buf, int c, ...); >int get_cmdline (char *prompt, char *cmdline, int maxlen, > int echo_char, int history); >int substring (const char *s1, const char *s2); >int nul_terminate (char *str); >int get_based_digit (int c, int base); >int safe_parse_maxint (char **str_ptr, int *myint_ptr); >int memcheck (int start, int len); >void grub_putstr (const char *str); > > > >int gunzip_test_header (void); >int gunzip_read (char *buf, int len); > > >int rawread (int drive, int sector, int byte_offset, int byte_len, char *buf); >int devread (int sector, int byte_offset, int byte_len, char *buf); >int rawwrite (int drive, int sector, char *buf); >int devwrite (int sector, int sector_len, char *buf); > > >char *set_device (char *device); >int open_device (void); >int real_open_partition (int flags); >int open_partition (void); >int next_partition (unsigned long drive, unsigned long dest, > unsigned long *partition, int *type, > unsigned long *start, unsigned long *len, > unsigned long *offset, int *entry, > unsigned long *ext_offset, char *buf); > > >int make_saved_active (void); > > >int set_partition_hidden_flag (int hidden); > > > >int grub_open (char *filename); > > > >int grub_read (char *buf, int len); > > >int grub_seek (int offset); > > >void grub_close (void); > > > >int dir (char *dirname); > >int set_bootdev (int hdbias); > > >void print_fsys_type (void); > > >void print_a_completion (char *filename); >int print_completions (int is_filename, int is_completion); > > >void copy_current_part_entry (char *buf); > > >void bsd_boot (kernel_t type, int bootdev, char *arg) > __attribute__ ((noreturn)); > > > > > >kernel_t load_image (char *kernel, char *arg, kernel_t suggested_type, > unsigned long load_flags); > >int load_module (char *module, char *arg); >int load_initrd (char *initrd); > >int check_password(char *entered, char* expected, password_t type); > > >void init_bios_info (void); ># 23 "fsys_reiserfs.c" 2 ># 1 "filesys.h" 1 ># 21 "filesys.h" ># 1 "pc_slice.h" 1 ># 22 "filesys.h" 2 > > > >int ffs_mount (void); >int ffs_read (char *buf, int len); >int ffs_dir (char *dirname); >int ffs_embed (int *start_sector, int needed_sectors); > > > > > > >int ufs2_mount (void); >int ufs2_read (char *buf, int len); >int ufs2_dir (char *dirname); >int ufs2_embed (int *start_sector, int needed_sectors); > > > > > > >int fat_mount (void); >int fat_read (char *buf, int len); >int fat_dir (char *dirname); > > > > > > >int ext2fs_mount (void); >int ext2fs_read (char *buf, int len); >int ext2fs_dir (char *dirname); > > > > > > >int minix_mount (void); >int minix_read (char *buf, int len); >int minix_dir (char *dirname); > > > > > > >int reiserfs_mount (void); >int reiserfs_read (char *buf, int len); >int reiserfs_dir (char *dirname); >int reiserfs_embed (int *start_sector, int needed_sectors); ># 92 "filesys.h" >int vstafs_mount (void); >int vstafs_read (char *buf, int len); >int vstafs_dir (char *dirname); > > > > > > >int jfs_mount (void); >int jfs_read (char *buf, int len); >int jfs_dir (char *dirname); >int jfs_embed (int *start_sector, int needed_sectors); > > > > > > >int xfs_mount (void); >int xfs_read (char *buf, int len); >int xfs_dir (char *dirname); ># 130 "filesys.h" >int iso9660_mount (void); >int iso9660_read (char *buf, int len); >int iso9660_dir (char *dirname); ># 158 "filesys.h" >struct fsys_entry >{ > char *name; > int (*mount_func) (void); > int (*read_func) (char *buf, int len); > int (*dir_func) (char *dirname); > void (*close_func) (void); > int (*embed_func) (int *start_sector, int needed_sectors); >}; > > > > >extern int print_possibilities; > > >extern int fsmax; >extern struct fsys_entry fsys_table[(1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1) + 1]; ># 24 "fsys_reiserfs.c" 2 ># 32 "fsys_reiserfs.c" >typedef __signed__ char __s8; >typedef unsigned char __u8; >typedef __signed__ short __s16; >typedef unsigned short __u16; >typedef __signed__ int __s32; >typedef unsigned int __u32; >typedef unsigned long long __u64; > > >typedef long linux_off_t; ># 53 "fsys_reiserfs.c" >struct reiserfs_super_block >{ > __u32 s_block_count; > __u32 s_free_blocks; > __u32 s_root_block; > __u32 s_journal_block; > __u32 s_journal_dev; > __u32 s_journal_size; > __u32 s_journal_trans_max; > __u32 s_journal_magic; > __u32 s_journal_max_batch; > __u32 s_journal_max_commit_age; > __u32 s_journal_max_trans_age; > __u16 s_blocksize; > __u16 s_oid_maxsize; > __u16 s_oid_cursize; > __u16 s_state; > char s_magic[16]; > __u16 s_tree_height; > __u16 s_bmap_nr; > __u16 s_version; > char s_unused[128]; >}; ># 88 "fsys_reiserfs.c" >struct reiserfs_journal_desc { > __u32 j_trans_id; > __u32 j_len; > __u32 j_mount_id; > __u32 j_realblock[1018]; > char j_magic[12]; >}; > > >struct reiserfs_journal_commit { > __u32 j_trans_id; > __u32 j_len; > __u32 j_realblock[1018]; > char j_digest[16]; >}; > > > > > > > >struct reiserfs_journal_header { > > __u32 j_last_flush_trans_id; > > __u32 j_first_unflushed_offset; > > __u32 j_mount_id; >}; ># 126 "fsys_reiserfs.c" >struct offset_v1 >{ ># 139 "fsys_reiserfs.c" > __u32 k_offset; > __u32 k_uniqueness; >}; > >struct offset_v2 >{ ># 156 "fsys_reiserfs.c" > __u64 k_offset:60; > __u64 k_type: 4; >}; > > >struct key >{ > > __u32 k_dir_id; > > __u32 k_objectid; > > union > { > struct offset_v1 v1; > struct offset_v2 v2; > } > u; >}; > > > > > >struct block_head >{ > __u16 blk_level; > __u16 blk_nr_item; > __u16 blk_free_space; > struct key blk_right_delim_key; > >}; > > > >struct item_head >{ > struct key ih_key; > > union > { > __u16 ih_free_space; > > > > __u16 ih_entry_count; > > } > u; > __u16 ih_item_len; > __u16 ih_item_location; > __u16 ih_version; > > > >}; ># 225 "fsys_reiserfs.c" >struct disk_child >{ > unsigned long dc_block_number; > unsigned short dc_size; >}; ># 238 "fsys_reiserfs.c" >struct stat_data >{ > __u16 sd_mode; > __u16 sd_notused1[3]; > __u32 sd_size; > __u32 sd_size_hi; >}; > >struct reiserfs_de_head >{ > __u32 deh_offset; > __u32 deh_dir_id; > > __u32 deh_objectid; > > __u16 deh_location; > __u16 deh_state; > > >}; ># 299 "fsys_reiserfs.c" >struct fsys_reiser_fileinfo >{ > __u32 k_dir_id; > __u32 k_objectid; >}; > > >struct fsys_reiser_info >{ > > struct item_head *current_ih; > > char *current_item; > > struct fsys_reiser_fileinfo fileinfo; > > __u32 journal_block; > > __u32 journal_block_count; > > > __u32 journal_first_desc; > > > __u16 version; > > __u16 tree_depth; > > __u8 blocksize_shift; > > __u8 fullblocksize_shift; > > __u16 blocksize; > > __u16 cached_slots; > > __u16 journal_transactions; > > unsigned int blocks[7]; > unsigned int next_key_nr[7]; >}; ># 369 "fsys_reiserfs.c" >static __inline__ unsigned long >log2 (unsigned long word) >{ > __asm__ ("bsfl %1,%0" > : "=r" (word) > : "r" (word)); > return word; >} > >static __inline__ int >is_power_of_two (unsigned long word) >{ > return (word & -word) == word; >} > >static int >journal_read (int block, int len, char *buffer) >{ > return devread ((((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_block + block) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize_shift, > 0, len, buffer); >} > > > > > >static int >block_read (int blockNr, int start, int len, char *buffer) >{ > int transactions = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_transactions; > int desc_block = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_first_desc; > int journal_mask = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_block_count - 1; > int translatedNr = blockNr; > __u32 *journal_table = ((__u32 *) (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024)) + 1)); > while (transactions-- > 0) > { > int i = 0; > int j_len; > if (*journal_table != 0xffffffff) > { > > j_len = *journal_table++; > while (i++ < j_len) > { > if (*journal_table++ == blockNr) > { > journal_table += j_len - i; > goto found; > } > } > } > else > { > > > > struct reiserfs_journal_desc desc; > struct reiserfs_journal_commit commit; > > if (! journal_read (desc_block, sizeof (desc), (char *) &desc)) > return 0; > > j_len = desc.j_len; > while (i < j_len && i < 1018) > if (desc.j_realblock[i++] == blockNr) > goto found; > > if (j_len >= 1018) > { > int commit_block = (desc_block + 1 + j_len) & journal_mask; > if (! journal_read (commit_block, > sizeof (commit), (char *) &commit)) > return 0; > while (i < j_len) > if (commit.j_realblock[i++ - 1018] == blockNr) > goto found; > } > } > goto not_found; > > found: > translatedNr = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_block + ((desc_block + i) & journal_mask); > > grub_printf ("block_read: block %d is mapped to journal block %d.\n", > blockNr, translatedNr - ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_block); > > > > > not_found: > desc_block = (desc_block + 2 + j_len) & journal_mask; > } > return devread (translatedNr << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize_shift, start, len, buffer); >} ># 472 "fsys_reiserfs.c" >static int >journal_init (void) >{ > unsigned int block_count = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_block_count; > unsigned int desc_block; > unsigned int commit_block; > unsigned int next_trans_id; > struct reiserfs_journal_header header; > struct reiserfs_journal_desc desc; > struct reiserfs_journal_commit commit; > __u32 *journal_table = ((__u32 *) (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024)) + 1)); > > journal_read (block_count, sizeof (header), (char *) &header); > desc_block = header.j_first_unflushed_offset; > if (desc_block >= block_count) > return 0; > > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_first_desc = desc_block; > next_trans_id = header.j_last_flush_trans_id + 1; > > > grub_printf ("journal_init: last flushed %d\n", > header.j_last_flush_trans_id); > > > while (1) > { > journal_read (desc_block, sizeof (desc), (char *) &desc); > if (substring ("ReIsErLB", desc.j_magic) > 0 > || desc.j_trans_id != next_trans_id > || desc.j_mount_id != header.j_mount_id) > > break; > > commit_block = (desc_block + desc.j_len + 1) & (block_count - 1); > journal_read (commit_block, sizeof (commit), (char *) &commit); > if (desc.j_trans_id != commit.j_trans_id > || desc.j_len != commit.j_len) > > break; > > > grub_printf ("Found valid transaction %d/%d at %d.\n", > desc.j_trans_id, desc.j_mount_id, desc_block); > > > next_trans_id++; > if (journal_table < ((__u32 *) ((0x68000) + 0x8000))) > { > if ((journal_table + 1 + desc.j_len) >= ((__u32 *) ((0x68000) + 0x8000))) > { > > > *journal_table = 0xffffffff; > journal_table = ((__u32 *) ((0x68000) + 0x8000)); > } > else > { > int i; > > > > > *journal_table++ = desc.j_len; > for (i = 0; i < desc.j_len && i < 1018; i++) > { > *journal_table++ = desc.j_realblock[i]; > > grub_printf ("block %d is in journal %d.\n", > desc.j_realblock[i], desc_block); > > } > for ( ; i < desc.j_len; i++) > { > *journal_table++ = commit.j_realblock[i-1018]; > > grub_printf ("block %d is in journal %d.\n", > commit.j_realblock[i-1018], > desc_block); > > } > } > } > desc_block = (commit_block + 1) & (block_count - 1); > } > > grub_printf ("Transaction %d/%d at %d isn't valid.\n", > desc.j_trans_id, desc.j_mount_id, desc_block); > > > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_transactions > = next_trans_id - header.j_last_flush_trans_id - 1; > return errnum == 0; >} > > >int >reiserfs_mount (void) >{ > struct reiserfs_super_block super; > int superblock = (64 * 1024) >> 9; > > if (part_length < superblock + (sizeof (super) >> 9) > || ! devread (superblock, 0, sizeof (struct reiserfs_super_block), > (char *) &super) > || (substring ("ReIsEr3Fs", super.s_magic) > 0 > && substring ("ReIsEr2Fs", super.s_magic) > 0 > && substring ("ReIsErFs", super.s_magic) > 0) > || ( > super.s_journal_block * super.s_blocksize > <= (64 * 1024))) > { > > superblock = (8 * 1024) >> 9; > if (part_length < superblock + (sizeof (super) >> 9) > || ! devread (superblock, 0, sizeof (struct reiserfs_super_block), > (char *) &super)) > return 0; > > if (substring ("ReIsEr3Fs", super.s_magic) > 0 > && substring ("ReIsEr2Fs", super.s_magic) > 0 > && substring ("ReIsErFs", super.s_magic) > 0) > { > > if (substring ("ReIsErFs", > (char*) ((int) &super + 20)) > 0) > return 0; > > super.s_blocksize = 4096; > super.s_journal_block = 0; > super.s_version = 0; > } > } > > > if (super.s_version > 2) > return 0; > > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->version = super.s_version; > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize = super.s_blocksize; > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift = log2 (super.s_blocksize); > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize_shift = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift - 9; > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->cached_slots = > (24*1024 >> ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift) - 1; > > > grub_printf ("reiserfs_mount: version=%d, blocksize=%d\n", > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->version, ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize); > > > > grub_memset (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocks, 0, sizeof (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocks)); > > if (super.s_blocksize < 0x200 > || super.s_blocksize > 24*1024 / 3 > || (0x200 << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize_shift) != super.s_blocksize) > return 0; > > > > > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_transactions = 0; > if (super.s_journal_block != 0 && super.s_journal_dev == 0) > { > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_block = super.s_journal_block; > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_block_count = super.s_journal_size; > if (is_power_of_two (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->journal_block_count)) > journal_init (); > > > block_read (superblock >> ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize_shift, > 0, sizeof (struct reiserfs_super_block), (char *) &super); > } > > if (! block_read (super.s_root_block, 0, ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize, (char*) ((char *) ((int) (0x68000))))) > return 0; > > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->tree_depth = ((struct block_head *) ((char *) ((int) (0x68000))))->blk_level; > > > grub_printf ("root read_in: block=%d, depth=%d\n", > super.s_root_block, ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->tree_depth); > > > if (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->tree_depth >= 7) > return 0; > if (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->tree_depth == 1) > { > > > grub_memmove ((((char *) ((int) (0x68000))) + ((1) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift)), ((char *) ((int) (0x68000))), ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize); > } > return 1; >} ># 691 "fsys_reiserfs.c" >static char * >read_tree_node (unsigned int blockNr, int depth) >{ > char* cache = (((char *) ((int) (0x68000))) + ((depth) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift)); > int num_cached = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->cached_slots; > grub_printf (" III i=%d\n", ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > if (depth < num_cached) > { > > > > if (blockNr == ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocks[depth]) { > grub_printf (" JJJ i=%d\n", ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > return cache; > } > } > else > cache = (((char *) ((int) (0x68000))) + ((num_cached) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift)); > > > grub_printf (" next read_in: block=%d (depth=%d)\n", > blockNr, depth); > > grub_printf (" KKK i=%d\n", ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > if (! block_read (blockNr, 0, ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize, cache)) > return 0; > grub_printf (" LLL i=%d\n", ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > > if (((struct block_head *) cache)->blk_level != depth) > { > errnum = ERR_FSYS_CORRUPT; > return 0; > } > > grub_printf (" MMM i=%d\n", ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocks[depth] = blockNr; > return cache; >} > > > > >static int >next_key (void) >{ > int depth; > struct item_head *ih = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih + 1; > char *cache; > > > grub_printf ("next_key:\n old ih: key %d:%d:%d:%d version:%d\n", > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.k_dir_id, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.k_objectid, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.u.v1.k_offset, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.u.v1.k_uniqueness, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_version); > > > grub_printf (" EEE i=%d\n", ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > if (ih == &((struct item_head *) ((int) (((char *) ((int) (0x68000))) + ((1) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift)) + (sizeof (struct block_head))))[((struct block_head *) (((char *) ((int) (0x68000))) + ((1) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift)))->blk_nr_item]) > { > grub_printf (" FFF i=%d\n", ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > depth = 1; > > > > do > { > if (depth == ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->tree_depth) > { > > > ih = (struct item_head *) &((struct block_head *) (((char *) ((int) (0x68000))) + ((1) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift)))->blk_right_delim_key; > goto found; > } > depth++; > > grub_printf (" depth=%d, i=%d\n", depth, ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[depth]); > > } > while (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[depth] == 0); > > if (depth == ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->tree_depth) > cache = ((char *) ((int) (0x68000))); > else if (depth <= ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->cached_slots) > cache = (((char *) ((int) (0x68000))) + ((depth) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift)); > else > { > cache = read_tree_node (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocks[depth], depth); > if (! cache) > return 0; > } > > do > { > int nr_item = ((struct block_head *) cache)->blk_nr_item; > int key_nr = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[depth]++; > > grub_printf (" depth=%d, i=%d/%d\n", depth, key_nr, nr_item); > > if (key_nr == nr_item) > > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[depth] = 0; > > grub_printf (" AAA depth=%d, i=%d\n", depth, ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[depth]); > > > cache = read_tree_node (((struct disk_child *) ((int) cache + (sizeof (struct block_head)) + (sizeof (struct key)) * nr_item))[key_nr].dc_block_number, --depth); > if (! cache) > return 0; > } > while (depth > 1); > > ih = ((struct item_head *) ((int) (((char *) ((int) (0x68000))) + ((1) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift)) + (sizeof (struct block_head)))); > } > found: > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih = ih; > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item = &(((char *) ((int) (0x68000))) + ((1) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift))[ih->ih_item_location]; > > grub_printf (" new ih: key %d:%d:%d:%d version:%d\n", > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.k_dir_id, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.k_objectid, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.u.v1.k_offset, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.u.v1.k_uniqueness, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_version); > > grub_printf (" GGG i=%d\n", ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > return 1; >} ># 831 "fsys_reiserfs.c" >static int >search_stat (__u32 dir_id, __u32 objectid) >{ > char *cache; > int depth; > int nr_item; > int i; > struct item_head *ih; > > grub_printf ("search_stat:\n key %d:%d:0:0\n", dir_id, objectid); > > > depth = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->tree_depth; > cache = ((char *) ((int) (0x68000))); > > grub_printf (" AAA i=%d\n", ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > while (depth > 1) > { > struct key *key; > nr_item = ((struct block_head *) cache)->blk_nr_item; > > key = ((struct key *) ((int) cache + (sizeof (struct block_head)))); > > for (i = 0; i < nr_item; i++) > { > if (key->k_dir_id > dir_id > || (key->k_dir_id == dir_id > && (key->k_objectid > objectid > || (key->k_objectid == objectid > && (key->u.v1.k_offset > | key->u.v1.k_uniqueness) > 0)))) > break; > key++; > } > > > grub_printf (" depth=%d, i=%d/%d\n", depth, i, nr_item); > > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[depth] = (i == nr_item) ? 0 : i+1; > > grub_printf (" CCC depth=%d nr=%d nr2=%d\n", depth, ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[depth], ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > > cache = read_tree_node (((struct disk_child *) ((int) cache + (sizeof (struct block_head)) + (sizeof (struct key)) * nr_item))[i].dc_block_number, --depth); > grub_printf (" HHH i=%d\n", ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > if (! cache) > return 0; > } > > > nr_item = ((struct block_head *) (((char *) ((int) (0x68000))) + ((1) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift)))->blk_nr_item; > ih = ((struct item_head *) ((int) (((char *) ((int) (0x68000))) + ((1) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift)) + (sizeof (struct block_head)))); > for (i = 0; i < nr_item; i++) > { > if (ih->ih_key.k_dir_id == dir_id > && ih->ih_key.k_objectid == objectid > && ih->ih_key.u.v1.k_offset == 0 > && ih->ih_key.u.v1.k_uniqueness == 0) > { > > grub_printf (" depth=%d, i=%d/%d\n", depth, i, nr_item); > > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih = ih; > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item = &(((char *) ((int) (0x68000))) + ((1) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift))[ih->ih_item_location]; > grub_printf (" DDD i=%d\n", ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->next_key_nr[2]); > return 1; > } > ih++; > } > errnum = ERR_FSYS_CORRUPT; > return 0; >} > >int >reiserfs_read (char *buf, int len) >{ > unsigned int blocksize; > unsigned int offset; > unsigned int to_read; > char *prev_buf = buf; > > > grub_printf ("reiserfs_read: filepos=%d len=%d, offset=%x:%x\n", > filepos, len, (__u64) ((((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_version == 0 ? (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_key.u.v1.k_offset : (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_key.u.v2.k_offset) - 1); > > > if (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.k_objectid != ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fileinfo.k_objectid > || ((((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_version == 0 ? (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_key.u.v1.k_offset : (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_key.u.v2.k_offset) > filepos + 1) > { > search_stat (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fileinfo.k_dir_id, ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fileinfo.k_objectid); > goto get_next_key; > } > > while (! errnum) > { > if (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.k_objectid != ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fileinfo.k_objectid) > break; > > offset = filepos - ((((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_version == 0 ? (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_key.u.v1.k_offset : (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_key.u.v2.k_offset) + 1; > blocksize = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_item_len; > > > grub_printf (" loop: filepos=%d len=%d, offset=%d blocksize=%d\n", > filepos, len, offset, blocksize); > > > if (((((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_version == 0 ? (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_key.u.v1.k_uniqueness == 0xffffffff : (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_key.u.v2.k_type == 2) > && offset < blocksize) > { > > grub_printf ("direct_read: offset=%d, blocksize=%d\n", > offset, blocksize); > > to_read = blocksize - offset; > if (to_read > len) > to_read = len; > > if (disk_read_hook != ((void *) 0)) > { > disk_read_func = disk_read_hook; > > block_read (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocks[1], > (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item - (((char *) ((int) (0x68000))) + ((1) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift)) + offset), to_read, buf); > > disk_read_func = ((void *) 0); > } > else > grub_memmove (buf, ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item + offset, to_read); > goto update_buf_len; > } > else if (((((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_version == 0 ? (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_key.u.v1.k_uniqueness == 0xfffffffe : (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih)->ih_key.u.v2.k_type == 1)) > { > blocksize = (blocksize >> 2) << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift; > > grub_printf ("indirect_read: offset=%d, blocksize=%d\n", > offset, blocksize); > > > while (offset < blocksize) > { > __u32 blocknr = ((__u32 *) ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item) > [offset >> ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fullblocksize_shift]; > int blk_offset = offset & (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize-1); > > to_read = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize - blk_offset; > if (to_read > len) > to_read = len; > > disk_read_func = disk_read_hook; > > > > > devread (blocknr << ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->blocksize_shift, > blk_offset, to_read, buf); > > disk_read_func = ((void *) 0); > update_buf_len: > len -= to_read; > buf += to_read; > offset += to_read; > filepos += to_read; > if (len == 0) > goto done; > } > } > get_next_key: > next_key (); > } > done: > return errnum ? 0 : buf - prev_buf; >} ># 1011 "fsys_reiserfs.c" >int >reiserfs_dir (char *dirname) >{ > struct reiserfs_de_head *de_head; > char *rest, ch; > __u32 dir_id, objectid, parent_dir_id = 0, parent_objectid = 0; > > int do_possibilities = 0; > > char linkbuf[1024]; > int link_count = 0; > int mode; > > dir_id = 1; > objectid = 2; > > while (1) > { > > grub_printf ("dirname=%s\n", dirname); > > > > if (! search_stat (dir_id, objectid)) > return 0; > > > grub_printf ("sd_mode=%x sd_size=%d\n", > ((struct stat_data *) ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item)->sd_mode, > ((struct stat_data *) ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item)->sd_size); > > > mode = ((struct stat_data *) ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item)->sd_mode; > > > if ((((mode) & 0170000) == 0120000)) > { > int len; > if (++link_count > 5) > { > errnum = ERR_SYMLINK_LOOP; > return 0; > } > > > filemax = ((struct stat_data *) ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item)->sd_size; > > > len = 0; > while (dirname[len] && !grub_isspace (dirname[len])) > len++; > > if (filemax + len > sizeof (linkbuf) - 1) > { > errnum = ERR_FILELENGTH; > return 0; > } > > > > grub_memmove (linkbuf + filemax, dirname, len+1); > > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fileinfo.k_dir_id = dir_id; > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fileinfo.k_objectid = objectid; > filepos = 0; > if (! next_key () > || reiserfs_read (linkbuf, filemax) != filemax) > { > if (! errnum) > errnum = ERR_FSYS_CORRUPT; > return 0; > } > > > grub_printf ("symlink=%s\n", linkbuf); > > > dirname = linkbuf; > if (*dirname == '/') > { > > dir_id = 1; > objectid = 2; > } > else > { > > dir_id = parent_dir_id; > objectid = parent_objectid; > } > > > continue; > } > > > > > if (! *dirname || grub_isspace (*dirname)) > { > if (! (((mode) & 0170000) == 0100000)) > { > errnum = ERR_BAD_FILETYPE; > return 0; > } > > filepos = 0; > filemax = ((struct stat_data *) ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item)->sd_size; > > > > > if (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_version == 1 > && ((struct stat_data *) ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item)->sd_size_hi > 0) > filemax = 0xffffffff; > > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fileinfo.k_dir_id = dir_id; > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->fileinfo.k_objectid = objectid; > return next_key (); > } > > > while (*dirname == '/') > dirname++; > if (! (((mode) & 0170000) == 0040000)) > { > errnum = ERR_BAD_FILETYPE; > return 0; > } > for (rest = dirname; (ch = *rest) && ! grub_isspace (ch) && ch != '/'; rest++); > *rest = 0; > > > if (print_possibilities && ch != '/') > do_possibilities = 1; > > > while (1) > { > char *name_end; > int num_entries; > > if (! next_key ()) > return 0; > > grub_printf ("ih: key %d:%d:%d:%d version:%d\n", > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.k_dir_id, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.k_objectid, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.u.v1.k_offset, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.u.v1.k_uniqueness, > ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_version); > > > if (((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_key.k_objectid != objectid) > break; > > name_end = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item + ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->ih_item_len; > de_head = (struct reiserfs_de_head *) ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item; > num_entries = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_ih->u.ih_entry_count; > while (num_entries > 0) > { > char *filename = ((struct fsys_reiser_info *) ((int) (0x68000) + 24*1024))->current_item + de_head->deh_location; > char tmp = *name_end; > if ((de_head->deh_state & (1 << 2))) > { > int cmp; > > > > > > > *name_end = 0; > cmp = substring (dirname, filename); > *name_end = tmp; > > if (do_possibilities) > { > if (cmp <= 0) > { > if (print_possibilities > 0) > print_possibilities = -print_possibilities; > *name_end = 0; > print_a_completion (filename); > *name_end = tmp; > } > } > else > > if (cmp == 0) > goto found; > } > > > name_end = filename; > de_head++; > num_entries--; > } > } > > > if (print_possibilities < 0) > return 1; > > > errnum = ERR_FILE_NOT_FOUND; > *rest = ch; > return 0; > > found: > > *rest = ch; > dirname = rest; > > parent_dir_id = dir_id; > parent_objectid = objectid; > dir_id = de_head->deh_dir_id; > objectid = de_head->deh_objectid; > } >} > >int >reiserfs_embed (int *start_sector, int needed_sectors) >{ > struct reiserfs_super_block super; > int num_sectors; > > if (! devread ((64 * 1024) >> 9, 0, > sizeof (struct reiserfs_super_block), (char *) &super)) > return 0; > > *start_sector = 1; > if ((substring ("ReIsErFs", super.s_magic) <= 0 > || substring ("ReIsEr2Fs", super.s_magic) <= 0 > || substring ("ReIsEr3Fs", super.s_magic) <= 0) > && ( > > super.s_journal_block * super.s_blocksize > > (64 * 1024))) > num_sectors = ((64 * 1024) >> 9) - 1; > else > num_sectors = ((8 * 1024) >> 9) - 1; > > return (needed_sectors <= num_sectors); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 84600
:
38248
|
38590
| 39001