swapfs.c File Reference

#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <assert.h>

Include dependency graph for swapfs.c:

Go to the source code of this file.

Data Structures

struct  super_t
struct  inode_t

Defines

#define _POSIX_SOURCE   1
#define _PROTOTYPE(function, params)   function()
#define BLOCK_SIZE   1024
#define BOOT_BLOCK_OFF   (blockn_t) 0
#define SUPER_BLOCK_OFF   (blockn_t) 1
#define V1_MAGIC   0x137F
#define V2_MAGIC   0x2468
#define NINODES_OFFSET   0
#define V1_ZONES_OFFSET   2
#define IMAP_BLOCKS_OFFSET   4
#define ZMAP_BLOCKS_OFFSET   6
#define FIRSTDATAZONE_OFFSET   8
#define LOG_ZONE_SIZE_OFFSET   10
#define MAGIC_OFFSET   16
#define V2_ZONES_OFFSET   20
#define NR_DIRECT_ZONES   7
#define V1_NR_TZONES   9
#define V2_NR_TZONES   10
#define V1_INODE_SIZE   32
#define V2_INODE_SIZE   64
#define INODE1_MODE_OFF   0
#define INODE1_SIZE_OFF   4
#define INODE1_DIRECT_OFF   14
#define INODE1_IND1_OFF   28
#define INODE1_IND2_OFF   30
#define INODE2_MODE_OFF   0
#define INODE2_SIZE_OFF   8
#define INODE2_DIRECT_OFF   24
#define INODE2_IND1_OFF   52
#define INODE2_IND2_OFF   56
#define INODE2_IND3_OFF   60
#define INODE_MODE_MASK   0xf000
#define INODE_DIR_MODE   0x4000
#define INODE_BLK_SPECIAL_MODE   0x6000
#define INODE_CHR_SPECIAL_MODE   0x2000
#define T_MASK   0x1c
#define T_UNKNOWN   0x00
#define T_MAYBE_OLD_DIR   0x04
#define T_OLD_NON_DIR   0x08
#define T_DIR   0x0c
#define T_NON_DIR   0x10
#define INDIRECT_MASK   0x03
#define IND_PROCESSED_BIT   0x20
#define IND_CONFLICT_BIT   0x40
#define TYPE_CONFLICT_BIT   0x80
#define DIR_ENTRY_SIZE   16

Typedefs

typedef unsigned long blockn_t
typedef unsigned int inodesn_t
typedef unsigned char * dzmap_t

Enumerations

enum  class_t { Unused_zone, Old_zone, In_use_zone }

Functions

int _PROTOTYPE (main,(int argc, char *argv[]))
static void _PROTOTYPE (parse_args_init_io,(int argc, char *argv[]))
static void _PROTOTYPE (rw_boot,(void))
static void _PROTOTYPE (rw_init_super,(super_t *sp))
static void _PROTOTYPE (init_dzmap,(dzmap_t *dzmap_ptr, size_t dzmap_size))
static void _PROTOTYPE (rw_ibmap,(super_t super))
static void _PROTOTYPE (rw_zbmap,(super_t super))
static void _PROTOTYPE (print_stat,(dzmap_t dzmap, super_t super))
static void _PROTOTYPE (p1_rw_inodes,(dzmap_t dzmap, super_t super))
static void _PROTOTYPE (rd_indirects,(dzmap_t dzmap, super_t super, int ind, class_t required_class))
static void _PROTOTYPE (rw_data_zones,(dzmap_t dzmap, super_t super))
static int _PROTOTYPE (read_block,(char *buf, blockn_t offset))
static void _PROTOTYPE (write_block,(char *buf))
static int _PROTOTYPE (convcpy,(char *dst, char *src, int *format))
static void _PROTOTYPE (conv2_blkcpy,(char *dst, char *src))
static void _PROTOTYPE (conv4_blkcpy,(char *dst, char *src))
static void _PROTOTYPE (conv2cpy,(char *dst, char *src))
static int _PROTOTYPE (inode_size,(int version))
static void _PROTOTYPE (init_super,(super_t *sp, char *buf))
static void _PROTOTYPE (get_inode,(inode_t *ip, char *buf, int version))
static int _PROTOTYPE (check_inode,(inode_t inode, super_t super))
static int _PROTOTYPE (was_blk_special,(inode_t inode))
static int _PROTOTYPE (check_blk_number,(blockn_t num, super_t super))
static void _PROTOTYPE (cw_inode_block,(char *buf, inodesn_t ninodes, int version))
static void _PROTOTYPE (proc_ind,(dzmap_t dzmap, size_t curr_ind, char *buf, super_t super))
static void _PROTOTYPE (cw_dir_block,(char *buf))
static void _PROTOTYPE (dzmap_add_inode,(dzmap_t dzmap, inode_t inode, super_t super))
static void _PROTOTYPE (dz_update,(dzmap_t dzmap, blockn_t blknum, int new_indnum, int new_ztype, super_t super))
static class_t _PROTOTYPE (ztype_class,(int ztype))
static unsigned int _PROTOTYPE (two_bytes,(char buf[2]))
static long _PROTOTYPE (four_bytes,(char buf[4]))
static void _PROTOTYPE (fail,(char *string))
static void _PROTOTYPE (usage,(char *arg0))
int main (int argc, argv)
static void parse_args_init_io (int argc, argv)
static void rw_boot ()
static void rw_init_super (super_t *sp)
static void init_dzmap (dzmap_t *dzmap_ptr, size_t dzmap_size)
static void rw_ibmap (super_t super)
static void rw_zbmap (super_t super)
static void p1_rw_inodes (dzmap_t dzmap, super_t super)
static void print_stat (dzmap_t dzmap, super_t super)
static void rd_indirects (dzmap_t dzmap, super_t super, int ind, class_t required_class)
static void rw_data_zones (dzmap_t dzmap, super_t super)
static int read_block (char *buf, blockn_t offset)
static void write_block (char *buf)
static int convcpy (char *dst, char *src, int *format)
static void conv2_blkcpy (char *dst, char *src)
static void conv4_blkcpy (char *dst, char *src)
static void conv2cpy (char *dst, char *src)
static int inode_size (int version)
static void init_super (super_t *sp, char *buf)
static void get_inode (inode_t *ip, char *buf, int version)
static int check_inode (inode_t inode, super_t super)
static int check_blk_number (blockn_t num, super_t super)
static int was_blk_special (inode_t inode)
static void cw_inode_block (char *buf, inodesn_t ninodes, int version)
static void proc_ind (dzmap_t dzmap, size_t curr_ind, char *buf, super_t super)
static void cw_dir_block (char *buf)
static void dzmap_add_inode (dzmap_t dzmap, inode_t inode, super_t super)
static void dz_update (dzmap_t dzmap, blockn_t blknum, int new_indnum, int new_ztype, super_t super)
static class_t ztype_class (int ztype)
static void fail (char *str)
static unsigned int two_bytes (buf)
static long four_bytes (buf)
static void usage (char *arg0)

Variables

static char rcsid [] = "$Id: swapfs.c,v 1.1.1.1 2005/04/21 14:55:33 beng Exp $"
static int super_format [] = {2, 2, 2, 2, 2, 2, 4, 2, 2, 4, 0}
static int inode1_format [] = {2, 2, 4, 4, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0}
static int inode2_format []
static char * ind_str [4]
static int big_endian_fs
static int verbose_flag
static int debug_flag
static int test_flag


Define Documentation

#define _POSIX_SOURCE   1
 

Definition at line 38 of file swapfs.c.

#define _PROTOTYPE function,
params   )     function()
 

Definition at line 53 of file swapfs.c.

#define BLOCK_SIZE   1024
 

Definition at line 56 of file swapfs.c.

#define BOOT_BLOCK_OFF   (blockn_t) 0
 

Definition at line 58 of file swapfs.c.

Referenced by rw_boot().

#define DIR_ENTRY_SIZE   16
 

Definition at line 111 of file swapfs.c.

Referenced by chkdirzone(), chkdots(), cw_dir_block(), get_inode(), r_readdir(), and search_dir().

#define FIRSTDATAZONE_OFFSET   8
 

Definition at line 67 of file swapfs.c.

Referenced by init_super().

#define IMAP_BLOCKS_OFFSET   4
 

Definition at line 65 of file swapfs.c.

Referenced by init_super().

#define IND_CONFLICT_BIT   0x40
 

Definition at line 108 of file swapfs.c.

Referenced by dz_update(), and print_stat().

#define IND_PROCESSED_BIT   0x20
 

Definition at line 106 of file swapfs.c.

Referenced by rd_indirects().

#define INDIRECT_MASK   0x03
 

Definition at line 104 of file swapfs.c.

Referenced by dz_update(), proc_ind(), rd_indirects(), and rw_data_zones().

#define INODE1_DIRECT_OFF   14
 

Definition at line 81 of file swapfs.c.

Referenced by get_inode().

#define INODE1_IND1_OFF   28
 

Definition at line 82 of file swapfs.c.

Referenced by get_inode().

#define INODE1_IND2_OFF   30
 

Definition at line 83 of file swapfs.c.

Referenced by get_inode().

#define INODE1_MODE_OFF   0
 

Definition at line 79 of file swapfs.c.

Referenced by get_inode().

#define INODE1_SIZE_OFF   4
 

Definition at line 80 of file swapfs.c.

Referenced by get_inode().

#define INODE2_DIRECT_OFF   24
 

Definition at line 87 of file swapfs.c.

Referenced by get_inode().

#define INODE2_IND1_OFF   52
 

Definition at line 88 of file swapfs.c.

Referenced by get_inode().

#define INODE2_IND2_OFF   56
 

Definition at line 89 of file swapfs.c.

Referenced by get_inode().

#define INODE2_IND3_OFF   60
 

Definition at line 90 of file swapfs.c.

Referenced by get_inode().

#define INODE2_MODE_OFF   0
 

Definition at line 85 of file swapfs.c.

Referenced by get_inode().

#define INODE2_SIZE_OFF   8
 

Definition at line 86 of file swapfs.c.

Referenced by get_inode().

#define INODE_BLK_SPECIAL_MODE   0x6000
 

Definition at line 94 of file swapfs.c.

#define INODE_CHR_SPECIAL_MODE   0x2000
 

Definition at line 95 of file swapfs.c.

#define INODE_DIR_MODE   0x4000
 

Definition at line 93 of file swapfs.c.

#define INODE_MODE_MASK   0xf000
 

Definition at line 92 of file swapfs.c.

#define LOG_ZONE_SIZE_OFFSET   10
 

Definition at line 68 of file swapfs.c.

Referenced by init_super().

#define MAGIC_OFFSET   16
 

Definition at line 69 of file swapfs.c.

Referenced by init_super().

#define NINODES_OFFSET   0
 

Definition at line 63 of file swapfs.c.

Referenced by init_super().

#define NR_DIRECT_ZONES   7
 

Definition at line 73 of file swapfs.c.

Referenced by check_inode(), dzmap_add_inode(), get_inode(), and was_blk_special().

#define SUPER_BLOCK_OFF   (blockn_t) 1
 

Definition at line 59 of file swapfs.c.

Referenced by init_super(), and rw_init_super().

#define T_DIR   0x0c
 

Definition at line 101 of file swapfs.c.

Referenced by rw_data_zones(), and ztype_class().

#define T_MASK   0x1c
 

Definition at line 97 of file swapfs.c.

Referenced by print_stat(), proc_ind(), rd_indirects(), and rw_data_zones().

#define T_MAYBE_OLD_DIR   0x04
 

Definition at line 99 of file swapfs.c.

Referenced by dz_update(), get_inode(), and ztype_class().

#define T_NON_DIR   0x10
 

Definition at line 102 of file swapfs.c.

Referenced by ztype_class().

#define T_OLD_NON_DIR   0x08
 

Definition at line 100 of file swapfs.c.

Referenced by get_inode(), and ztype_class().

#define T_UNKNOWN   0x00
 

Definition at line 98 of file swapfs.c.

#define TYPE_CONFLICT_BIT   0x80
 

Definition at line 109 of file swapfs.c.

Referenced by dz_update(), and print_stat().

#define V1_INODE_SIZE   32
 

Definition at line 76 of file swapfs.c.

Referenced by fs_init(), inode_size(), main(), read_super(), and Read_Super_Block().

#define V1_MAGIC   0x137F
 

Definition at line 61 of file swapfs.c.

Referenced by init_super().

#define V1_NR_TZONES   9
 

Definition at line 74 of file swapfs.c.

Referenced by get_inode(), old_icopy(), and r_stat().

#define V1_ZONES_OFFSET   2
 

Definition at line 64 of file swapfs.c.

Referenced by init_super().

#define V2_INODE_SIZE   64
 

Definition at line 77 of file swapfs.c.

Referenced by fs_init(), inode_size(), main(), read_super(), Read_Super_Block(), and Recover_Blocks().

#define V2_MAGIC   0x2468
 

Definition at line 62 of file swapfs.c.

Referenced by init_super().

#define V2_NR_TZONES   10
 

Definition at line 75 of file swapfs.c.

Referenced by get_inode(), new_icopy(), r_stat(), and wipe_inode().

#define V2_ZONES_OFFSET   20
 

Definition at line 70 of file swapfs.c.

Referenced by init_super().

#define ZMAP_BLOCKS_OFFSET   6
 

Definition at line 66 of file swapfs.c.

Referenced by init_super().


Typedef Documentation

typedef unsigned long blockn_t
 

Definition at line 117 of file swapfs.c.

typedef unsigned char* dzmap_t
 

Definition at line 163 of file swapfs.c.

typedef unsigned int inodesn_t
 

Definition at line 118 of file swapfs.c.


Enumeration Type Documentation

enum class_t
 

Enumerator:
Unused_zone 
Old_zone 
In_use_zone 

Definition at line 113 of file swapfs.c.


Function Documentation

static void _PROTOTYPE usage  ,
(char *arg0
[static]
 

static void _PROTOTYPE fail  ,
(char *string
[static]
 

static long _PROTOTYPE four_bytes  ,
(char buf[4]) 
[static]
 

static unsigned int _PROTOTYPE two_bytes  ,
(char buf[2]) 
[static]
 

static class_t _PROTOTYPE ztype_class  ,
(int ztype
[static]
 

static void _PROTOTYPE dz_update  ,
(dzmap_t dzmap, blockn_t blknum, int new_indnum, int new_ztype, super_t super) 
[static]
 

static void _PROTOTYPE dzmap_add_inode  ,
(dzmap_t dzmap, inode_t inode, super_t super) 
[static]
 

static void _PROTOTYPE cw_dir_block  ,
(char *buf
[static]
 

static void _PROTOTYPE proc_ind  ,
(dzmap_t dzmap, size_t curr_ind, char *buf, super_t super) 
[static]
 

static void _PROTOTYPE cw_inode_block  ,
(char *buf, inodesn_t ninodes, int version) 
[static]
 

static int _PROTOTYPE check_blk_number  ,
(blockn_t num, super_t super) 
[static]
 

static int _PROTOTYPE was_blk_special  ,
(inode_t inode
[static]
 

static int _PROTOTYPE check_inode  ,
(inode_t inode, super_t super) 
[static]
 

static void _PROTOTYPE get_inode  ,
(inode_t *ip, char *buf, int version) 
[static]
 

static void _PROTOTYPE init_super  ,
(super_t *sp, char *buf
[static]
 

static int _PROTOTYPE inode_size  ,
(int version) 
[static]
 

static void _PROTOTYPE conv2cpy  ,
(char *dst, char *src) 
[static]
 

static void _PROTOTYPE conv4_blkcpy  ,
(char *dst, char *src) 
[static]
 

static void _PROTOTYPE conv2_blkcpy  ,
(char *dst, char *src) 
[static]
 

static int _PROTOTYPE convcpy  ,
(char *dst, char *src, int *format) 
[static]
 

static void _PROTOTYPE write_block  ,
(char *buf
[static]
 

static int _PROTOTYPE read_block  ,
(char *buf, blockn_t offset) 
[static]
 

static void _PROTOTYPE rw_data_zones  ,
(dzmap_t dzmap, super_t super) 
[static]
 

static void _PROTOTYPE rd_indirects  ,
(dzmap_t dzmap, super_t super, int ind, class_t required_class) 
[static]
 

static void _PROTOTYPE p1_rw_inodes  ,
(dzmap_t dzmap, super_t super) 
[static]
 

static void _PROTOTYPE print_stat  ,
(dzmap_t dzmap, super_t super) 
[static]
 

static void _PROTOTYPE rw_zbmap  ,
(super_t super) 
[static]
 

static void _PROTOTYPE rw_ibmap  ,
(super_t super) 
[static]
 

static void _PROTOTYPE init_dzmap  ,
(dzmap_t *dzmap_ptr, size_t dzmap_size) 
[static]
 

static void _PROTOTYPE rw_init_super  ,
(super_t *sp
[static]
 

static void _PROTOTYPE rw_boot  ,
(void) 
[static]
 

static void _PROTOTYPE parse_args_init_io  ,
(int argc, char *argv[]) 
[static]
 

int _PROTOTYPE main  ,
(int argc, char *argv[]) 
 

static int check_blk_number blockn_t  num,
super_t  super
[static]
 

Definition at line 736 of file swapfs.c.

References fprintf(), stderr, and super.

Referenced by check_inode().

static int check_inode inode_t  inode,
super_t  super
[static]
 

Definition at line 721 of file swapfs.c.

References check_blk_number(), i, NR_DIRECT_ZONES, and super.

Referenced by dzmap_add_inode().

static void conv2_blkcpy char *  dst,
char *  src
[static]
 

Definition at line 567 of file swapfs.c.

References BLOCK_SIZE, i, and tmp.

Referenced by rw_ibmap(), and rw_zbmap().

static void conv2cpy char *  dst,
char *  src
[static]
 

Definition at line 604 of file swapfs.c.

References tmp.

Referenced by cw_dir_block().

static void conv4_blkcpy char *  dst,
char *  src
[static]
 

Definition at line 582 of file swapfs.c.

References BLOCK_SIZE, i, and tmp.

static int convcpy char *  dst,
char *  src,
int *  format
[static]
 

Definition at line 532 of file swapfs.c.

References fail, i, and tmp.

Referenced by cw_inode_block(), and rw_init_super().

static void cw_dir_block char *  buf  )  [static]
 

Definition at line 892 of file swapfs.c.

References conv2cpy(), DIR_ENTRY_SIZE, i, memcpy(), and two_bytes().

Referenced by rw_data_zones().

static void cw_inode_block char *  buf,
inodesn_t  ninodes,
int  version
[static]
 

Definition at line 769 of file swapfs.c.

References BLOCK_SIZE, cnt, convcpy(), format, i, inode1_format, and inode2_format.

Referenced by p1_rw_inodes().

static void dz_update dzmap_t  dzmap,
blockn_t  blknum,
int  new_indnum,
int  new_ztype,
super_t  super
[static]
 

Definition at line 930 of file swapfs.c.

References assert, fail, fprintf(), In_use_zone, IND_CONFLICT_BIT, INDIRECT_MASK, Old_zone, stderr, super, T_MAYBE_OLD_DIR, TYPE_CONFLICT_BIT, and ztype_class().

Referenced by dzmap_add_inode().

static void dzmap_add_inode dzmap_t  dzmap,
inode_t  inode,
super_t  super
[static]
 

Definition at line 912 of file swapfs.c.

References check_inode(), inode_t::direct, dz_update(), i, inode_t::ind1, inode_t::ind2, inode_t::ind3, NR_DIRECT_ZONES, inode_t::size, super, and inode_t::ztype.

static void fail char *  str  )  [static]
 

Definition at line 1006 of file swapfs.c.

References exit(), fprintf(), and stderr.

static long four_bytes buf   )  [static]
 

Definition at line 1026 of file swapfs.c.

References big_endian_fs.

Referenced by get_inode(), init_super(), and proc_ind().

static void get_inode inode_t ip,
char *  buf,
int  version
[static]
 

Definition at line 680 of file swapfs.c.

References DIR_ENTRY_SIZE, four_bytes(), i, if(), INODE1_DIRECT_OFF, INODE1_IND1_OFF, INODE1_IND2_OFF, INODE1_MODE_OFF, INODE1_SIZE_OFF, INODE2_DIRECT_OFF, INODE2_IND1_OFF, INODE2_IND2_OFF, INODE2_IND3_OFF, INODE2_MODE_OFF, INODE2_SIZE_OFF, NR_DIRECT_ZONES, T_MAYBE_OLD_DIR, T_OLD_NON_DIR, two_bytes(), and was_blk_special().

static void init_dzmap dzmap_t dzmap_ptr,
size_t  dzmap_size
[static]
 

Definition at line 321 of file swapfs.c.

References fail, malloc(), memset(), and NULL.

Referenced by main().

static void init_super super_t sp,
char *  buf
[static]
 

Definition at line 622 of file swapfs.c.

References big_endian_fs, BLOCK_SIZE, fail, FIRSTDATAZONE_OFFSET, four_bytes(), fprintf(), IMAP_BLOCKS_OFFSET, inode_size, LOG_ZONE_SIZE_OFFSET, magic, MAGIC_OFFSET, NINODES_OFFSET, stderr, SUPER_BLOCK_OFF, two_bytes(), V1_MAGIC, V1_ZONES_OFFSET, V2_MAGIC, V2_ZONES_OFFSET, verbose_flag, and ZMAP_BLOCKS_OFFSET.

Referenced by rw_init_super().

static int inode_size int  version  )  [static]
 

Definition at line 615 of file swapfs.c.

References V1_INODE_SIZE, and V2_INODE_SIZE.

int main int  argc,
argv 
 

Definition at line 210 of file swapfs.c.

References In_use_zone, init_dzmap(), p1_rw_inodes(), parse_args_init_io(), print_stat(), putc, rd_indirects(), rw_boot(), rw_data_zones(), rw_ibmap(), rw_init_super(), rw_zbmap(), stderr, super, and verbose_flag.

static void p1_rw_inodes dzmap_t  dzmap,
super_t  super
[static]
 

Definition at line 361 of file swapfs.c.

References BLOCK_SIZE, buf_ptr, cw_inode_block(), fail, i, if(), read_block(), and super.

Referenced by main().

static void parse_args_init_io int  argc,
argv 
[static]
 

Definition at line 236 of file swapfs.c.

References buf, debug_flag, i, test_flag, usage, and verbose_flag.

Referenced by main().

static void print_stat dzmap_t  dzmap,
super_t  super
[static]
 

Definition at line 391 of file swapfs.c.

References i, In_use_zone, IND_CONFLICT_BIT, super, T_MASK, TYPE_CONFLICT_BIT, verbose_flag, and ztype_class().

Referenced by main().

static void proc_ind dzmap_t  dzmap,
size_t  curr_ind,
char *  buf,
super_t  super
[static]
 

Definition at line 806 of file swapfs.c.

References assert, blk, BLOCK_SIZE, expired(), four_bytes(), i, In_use_zone, INDIRECT_MASK, super, T_MASK, two_bytes(), ztype, and ztype_class().

static void rd_indirects dzmap_t  dzmap,
super_t  super,
int  ind,
class_t  required_class
[static]
 

Definition at line 429 of file swapfs.c.

References BLOCK_SIZE, fail, fprintf(), i, IND_PROCESSED_BIT, ind_str, INDIRECT_MASK, read_block(), stderr, super, T_MASK, and ztype_class().

Referenced by main().

static int read_block char *  buf,
blockn_t  offset
[static]
 

Definition at line 501 of file swapfs.c.

References BLOCK_SIZE, bytes, fail, lseek, and read.

Referenced by p1_rw_inodes(), rd_indirects(), rw_boot(), rw_data_zones(), rw_ibmap(), rw_init_super(), and rw_zbmap().

static void rw_boot  )  [static]
 

Definition at line 294 of file swapfs.c.

References BLOCK_SIZE, BOOT_BLOCK_OFF, fail, read_block(), and write_block().

Referenced by main().

static void rw_data_zones dzmap_t  dzmap,
super_t  super
[static]
 

Definition at line 460 of file swapfs.c.

References BLOCK_SIZE, cw_dir_block(), i, ibuf, INDIRECT_MASK, obuf, read_block(), super, T_DIR, T_MASK, write_block(), and ztype.

Referenced by main().

static void rw_ibmap super_t  super  )  [static]
 

Definition at line 331 of file swapfs.c.

References BLOCK_SIZE, conv2_blkcpy(), fail, ibuf, obuf, read_block(), and write_block().

Referenced by main().

static void rw_init_super super_t sp  )  [static]
 

Definition at line 304 of file swapfs.c.

References BLOCK_SIZE, convcpy(), fail, ibuf, init_super(), memcpy(), obuf, read_block(), SUPER_BLOCK_OFF, super_format, and write_block().

Referenced by main().

static void rw_zbmap super_t  super  )  [static]
 

Definition at line 346 of file swapfs.c.

References BLOCK_SIZE, conv2_blkcpy(), fail, ibuf, obuf, read_block(), and write_block().

Referenced by main().

static unsigned int two_bytes buf   )  [static]
 

Definition at line 1014 of file swapfs.c.

References big_endian_fs.

Referenced by cw_dir_block(), dp_pio16_nic2user(), dp_pio16_user2nic(), get_inode(), init_super(), and proc_ind().

static void usage char *  arg0  )  [static]
 

Definition at line 1043 of file swapfs.c.

References exit(), fprintf(), and stderr.

static int was_blk_special inode_t  inode  )  [static]
 

Definition at line 748 of file swapfs.c.

References BLOCK_SIZE, block_size, debug_flag, fprintf(), i, if(), NR_DIRECT_ZONES, result, and stderr.

Referenced by get_inode().

static void write_block char *  buf  )  [static]
 

Definition at line 522 of file swapfs.c.

References BLOCK_SIZE, fail, test_flag, and write.

Referenced by rw_boot(), rw_data_zones(), rw_ibmap(), rw_init_super(), and rw_zbmap().

static class_t ztype_class int  ztype  )  [static]
 

Definition at line 990 of file swapfs.c.

References In_use_zone, Old_zone, T_DIR, T_MAYBE_OLD_DIR, T_NON_DIR, T_OLD_NON_DIR, and Unused_zone.

Referenced by dz_update(), print_stat(), proc_ind(), and rd_indirects().


Variable Documentation

int big_endian_fs [static]
 

Definition at line 157 of file swapfs.c.

Referenced by four_bytes(), init_super(), and two_bytes().

int debug_flag [static]
 

Definition at line 160 of file swapfs.c.

Referenced by parse_args_init_io(), and was_blk_special().

char* ind_str[4] [static]
 

Initial value:

 {"direct", "single indirect",
                   "double indirect", "triple indirect"}

Definition at line 154 of file swapfs.c.

Referenced by rd_indirects().

int inode1_format[] = {2, 2, 4, 4, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0} [static]
 

Definition at line 150 of file swapfs.c.

Referenced by cw_inode_block().

int inode2_format[] [static]
 

Initial value:

 {2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
                      4, 4, 0}

Definition at line 151 of file swapfs.c.

Referenced by cw_inode_block().

char rcsid[] = "$Id: swapfs.c,v 1.1.1.1 2005/04/21 14:55:33 beng Exp $" [static]
 

Definition at line 147 of file swapfs.c.

int super_format[] = {2, 2, 2, 2, 2, 2, 4, 2, 2, 4, 0} [static]
 

Definition at line 149 of file swapfs.c.

Referenced by rw_init_super().

int test_flag [static]
 

Definition at line 161 of file swapfs.c.

Referenced by parse_args_init_io(), and write_block().

int verbose_flag [static]
 

Definition at line 159 of file swapfs.c.

Referenced by add_file(), copy(), extract(), init_super(), main(), parse_args_init_io(), print_stat(), tarfile(), and verb_print().


Generated on Fri Apr 14 23:07:32 2006 for minix by  doxygen 1.4.6