#include <sys/types.h>#include <sys/stat.h>#include <minix/config.h>#include <minix/type.h>#include <fcntl.h>#include <unistd.h>#include <dirent.h>#include <stdlib.h>#include "../../servers/fs/const.h"#include "../../servers/fs/type.h"#include <string.h>#include <stdio.h>#include "../../servers/fs/super.h"Include dependency graph for badblocks.c:

Go to the source code of this file.
Defines | |
| #define | EXTERN extern |
| #define | OK 0 |
| #define | NOT_OK 1 |
| #define | QUIT 2 |
| #define | READ 0 |
| #define | WRITE 1 |
| #define | HARMLESS 0 |
| #define | DIR_CREATED 1 |
| #define | DEV_MOUNTED 2 |
| #define | FILE_EXISTS 3 |
| #define | SUCCESS 4 |
| #define | BYTE 0377 |
| #define | BLOCK_SIZE 1024 |
| #define | SIZE_OF_INT (sizeof (int) ) |
| #define | V_NR_DZONES V2_NR_DZONES |
| #define | V_SMALLER V1_NR_DZONES |
| #define | BIT_MAP_SHIFT 13 |
| #define | INT_BITS (SIZE_OF_INT << 3) |
Functions | |
| _PROTOTYPE (int main,(int argc, char **argv)) | |
| _PROTOTYPE (void rw_super,(int flag)) | |
| _PROTOTYPE (void get_super,(void)) | |
| _PROTOTYPE (void rw_inode,(struct stat *stat_ptr, int rw_mode)) | |
| _PROTOTYPE (void get_inode,(struct stat *stat_ptr)) | |
| _PROTOTYPE (long rd_cmdline,(int argc, char *argv[])) | |
| _PROTOTYPE (void modify,(int nr_blocks)) | |
| _PROTOTYPE (void save_blk,(block_t blk_num)) | |
| _PROTOTYPE (int blk_is_used,(block_t blk_num)) | |
| _PROTOTYPE (int blk_ok,(block_t num)) | |
| _PROTOTYPE (void set_bit,(zone_t num)) | |
| _PROTOTYPE (long rd_num,(void)) | |
| _PROTOTYPE (int ok,(char *str)) | |
| _PROTOTYPE (void done,(int nr)) | |
| void | rw_super (int flag) |
| void | get_super () |
| void | put_super () |
| void | rw_inode (struct stat *stat_ptr, int rw_mode) |
| void | get_inode (struct stat *stat_ptr) |
| void | put_inode (struct stat *stat_ptr) |
| int | main (int argc, argv) |
| long | rd_cmdline (int argc, argv) |
| void | modify (int nr_blocks) |
| void | save_blk (block_t blk_num) |
| void | reset_blks () |
| void | show_blks () |
| int | blk_is_used (block_t blk_num) |
| int | blk_ok (block_t num) |
| void | set_bit (zone_t num) |
| long | rd_num () |
| int | ok (char *str) |
| void | done (int nr) |
Variables | |
| char * | dev_name |
| char | f_name [] = ".Bad_XXXXXX" |
| char | file_name [50] |
| char | dir_name [] = "/tmpXXXXXX" |
| block_t | block [V_NR_DZONES+1] |
| int | interactive |
| int | position = 2 |
| FILE * | f |
| int | fd |
| int | eofseen |
| stat | stat_buf |
| super_block * | sp |
| super_block | sbs |
| int | inodes_per_block |
| size_t | inode_size |
| int | v1fs = 0 |
| int | v2fs = 0 |
| d1_inode | d1inode |
| d1_inode * | ip1 |
| d2_inode | d2inode |
| d2_inode * | ip2 |
| static | blk_cnt = 0 |
|
|
Definition at line 492 of file badblocks.c. |
|
|
Definition at line 89 of file badblocks.c. |
|
|
Definition at line 88 of file badblocks.c. Referenced by ack_emit_instruction(), add_string(), alloc_inode(), alloc_zone(), bas_get_operand(), beep(), beep_x(), clone_opcl(), cons_write(), conv2(), ctty_io(), decode_ioctl(), dev_close(), dev_io(), dev_open(), dev_up(), do_exec(), do_ioctl(), do_svrctl(), do_transfer(), do_unpause(), fproc_dmp(), gen_opcl(), get_work(), gnu_put_expression(), in_process(), main(), out_char(), read_header(), rw_block(), search_str(), select_major_match(), select_unsuspend_by_endpt(), and set_6845(). |
|
|
Definition at line 84 of file badblocks.c. |
|
|
Definition at line 83 of file badblocks.c. Referenced by blk_ok(), done(), get_super(), main(), rw_inode(), rw_super(), and set_bit(). |
|
|
Definition at line 38 of file badblocks.c. |
|
|
Definition at line 85 of file badblocks.c. |
|
|
Definition at line 82 of file badblocks.c. |
|
|
Definition at line 493 of file badblocks.c. |
|
|
Definition at line 76 of file badblocks.c. |
|
|
Definition at line 75 of file badblocks.c. |
|
|
Definition at line 77 of file badblocks.c. |
|
|
Definition at line 79 of file badblocks.c. |
|
|
Definition at line 90 of file badblocks.c. |
|
|
Definition at line 86 of file badblocks.c. Referenced by announce(), done(), find_user(), main(), processrequest(), tail(), TalkChk(), and TalkInit(). |
|
|
Definition at line 97 of file badblocks.c. Referenced by reset_blks(). |
|
|
Definition at line 98 of file badblocks.c. Referenced by main(). |
|
|
Definition at line 80 of file badblocks.c. |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
Definition at line 480 of file badblocks.c. References i. Referenced by blk_ok(). |
|
|
Definition at line 495 of file badblocks.c. References BIT_MAP_SHIFT, blk, blk_is_used(), BLOCK_SIZE, DIR_CREATED, done, INT_BITS, lseek, NOT_OK, offset, OK, printf, read, SEEK_SET, SIZE_OF_INT, sp, and words. Referenced by main(). |
|
|
Definition at line 642 of file badblocks.c. References DEV_MOUNTED, dev_name, DIR_CREATED, dir_name, exit(), FILE_EXISTS, file_name, HARMLESS, rmdir, SUCCESS, sync, umount, and unlink. |
|
|
Definition at line 238 of file badblocks.c. References cnt, d1_inode::d1_zone, d2_inode::d2_zone, ip1, ip2, READ, rw_inode(), V1_NR_TZONES, and V2_NR_TZONES. Referenced by advance(), alloc_inode(), forbidden(), fs_init(), init_root(), main(), readfs(), and unlink_file(). |
|
|
Definition at line 164 of file badblocks.c. References DIR_CREATED, done, printf, READ, rw_super(), sp, SUPER_MAGIC, SUPER_V2, SUPER_V3, and v2fs. Referenced by alloc_inode(), alloc_zone(), free_inode(), free_zone(), main(), rd_indir(), rw_inode(), and wr_indir(). |
|
||||||||||||
|
Definition at line 263 of file badblocks.c. References blk_ok(), block_size, chmod, cnt, d1inode, d2inode, DEV_MOUNTED, DIR_CREATED, done, fclose(), FILE_EXISTS, finished(), fopen(), fp, fprintf(), fstat, get_inode(), get_super(), geteuid, HARMLESS, ip1, ip2, mkdir, mktemp(), mount, NOT_OK, NULL, O_RDWR, ok(), OK, open, printf, QUIT, rd_cmdline(), rd_num(), reset_blks(), S_IFBLK, S_IFMT, save_blk(), sbs, show_blks(), sp, stat::st_mode, stat, stat_buf, stderr, strcat(), umount, V1_INODE_SIZE, V1_INODES_PER_BLOCK, V2_INODE_SIZE, V2_INODES_PER_BLOCK, v2fs, and V_SMALLER. |
|
|
Definition at line 423 of file badblocks.c. References d1_inode::d1_zone, i, ip1, and set_bit(). |
|
|
Definition at line 618 of file badblocks.c. References c, EOF, getchar, NOT_OK, OK, printf, and QUIT. Referenced by affirmative(), chkdirectory(), chkfile(), chkzones(), cidr_aton(), doiobj(), get_name(), isokendpt_f(), lrstr(), main(), matchs(), pack_vector(), parse_cidr(), range_match(), and tab_parse(). |
|
|
Definition at line 255 of file badblocks.c. References rw_inode(), and WRITE. Referenced by advance(), change_into(), clone_opcl(), common_open(), do_access(), do_chdir(), do_chmod(), do_chown(), do_close(), do_link(), do_lstat(), do_mkdir(), do_mknod(), do_rdlink(), do_reboot(), do_rename(), do_slink(), do_stat(), do_truncate(), do_unlink(), do_utime(), ltraverse(), name_to_dev(), new_node(), parse_path(), and unlink_file(). |
|
|
Definition at line 186 of file badblocks.c. References rw_super(), and WRITE. |
|
||||||||||||
|
Definition at line 414 of file badblocks.c. References atol(). Referenced by main(). |
|
|
Definition at line 591 of file badblocks.c. References c, EOF, exit(), getchar, num(), and printf. Referenced by main(). |
|
|
Definition at line 463 of file badblocks.c. References blk_cnt, i, and V_NR_DZONES. Referenced by main(). |
|
||||||||||||
|
Definition at line 193 of file badblocks.c. References blk, BLOCK_SIZE, DIR_CREATED, done, ip1, ip2, lseek, offset, printf, read, READ, SEEK_SET, sp, and write. Referenced by common_open(), do_pipe(), do_sync(), get_inode(), new_node(), and put_inode(). |
|
|
Definition at line 144 of file badblocks.c. References BLOCK_SIZE, DIR_CREATED, done, L, lseek, printf, read, READ, SEEK_SET, sp, SUPER_SIZE, and write. Referenced by get_super(), and put_super(). |
|
|
Definition at line 457 of file badblocks.c. References blk_cnt. Referenced by main(). |
|
|
Definition at line 543 of file badblocks.c. References BIT_MAP_SHIFT, blk, BLOCK_SIZE, DEV_MOUNTED, DIR_CREATED, done, INT_BITS, L, long(), lseek, offset, printf, read, SEEK_SET, SIZE_OF_INT, sp, words, and write. Referenced by modify(). |
|
|
Definition at line 472 of file badblocks.c. References blk_cnt, i, and printf. Referenced by main(). |
|
|
Definition at line 455 of file badblocks.c. Referenced by reset_blks(), save_blk(), and show_blks(). |
|
|
Definition at line 123 of file badblocks.c. Referenced by andor(), c_list(), do_select(), list(), namelist(), nested(), and pipeline(). |
|
|
Definition at line 136 of file badblocks.c. Referenced by main(). |
|
|
Definition at line 138 of file badblocks.c. Referenced by main(). |
|
|
Definition at line 118 of file badblocks.c. Referenced by done(), and fill_iftab(). |
|
|
Definition at line 121 of file badblocks.c. Referenced by done(), Find_Deleted_Entry(), main(), and remove_dir(). |
|
|
Definition at line 129 of file badblocks.c. |
|
|
Definition at line 127 of file badblocks.c. Referenced by _cre(), _fprintPwd(), _ini(), _opn(), _wrb(), _wrc(), _wrf(), _wri(), _wrl(), _wrr(), _wrs(), _wrz(), _wsb(), _wsc(), _wsi(), _wsl(), _wsr(), _wss(), _wstrin(), _wsz(), basefind(), bread(), bwrite(), clear_func(), copy_action(), copy_ident(), copy_text(), countem(), cxsize(), die(), do_dup(), do_fcntl(), do_file(), do_ioctl(), do_unpause(), domark(), fill_buffer(), find_filp(), fprintPwd(), get_line(), getline(), getsym(), getzrxinit(), initfl(), library(), logmsg(), look(), main(), mark(), myfeof(), ne_probe(), netfinger(), openredirect(), permissions(), popfile(), print(), print1(), print_grammar(), printit(), procentry(), procexit(), raw_install(), read_write(), readword(), release(), select_match_pipe(), select_request_general(), select_request_pipe(), set_profile(), setstat(), skipit(), Still_Logged_On(), timestamp(), wcs(), wctxpn(), work(), and write_section(). |
|
|
Definition at line 119 of file badblocks.c. |
|
|
Definition at line 128 of file badblocks.c. |
|
|
Definition at line 120 of file badblocks.c. |
|
|
Definition at line 133 of file badblocks.c. Referenced by init_super(). |
|
|
Definition at line 132 of file badblocks.c. |
|
|
Definition at line 124 of file badblocks.c. |
|
|
Definition at line 137 of file badblocks.c. Referenced by get_inode(), main(), modify(), and rw_inode(). |
|
|
Definition at line 139 of file badblocks.c. Referenced by get_inode(), main(), and rw_inode(). |
|
|
Definition at line 125 of file badblocks.c. Referenced by get_part_table(), read_write(), and test_read(). |
|
|
Definition at line 131 of file badblocks.c. Referenced by main(). |
|
|
|
Definition at line 130 of file badblocks.c. Referenced by main(), and parse_arguments(). |
|
|
Definition at line 134 of file badblocks.c. |
|
|
Definition at line 134 of file badblocks.c. Referenced by get_super(), and main(). |
1.4.6