UNIX xv6 (rev8, 9/1/15)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions | Variables
mkfs.c File Reference
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <assert.h>
#include "types.h"
#include "fs.h"
#include "stat.h"
#include "param.h"

Go to the source code of this file.

Macros

#define stat   xv6_stat
 
#define static_assert(a, b)   do { switch (0) case 0: case (a): ; } while (0)
 
#define NINODES   200
 
#define min(a, b)   ((a) < (b) ? (a) : (b))
 

Functions

void balloc (int)
 
void wsect (uint, void *)
 
void winode (uint, struct dinode *)
 
void rinode (uint inum, struct dinode *ip)
 
void rsect (uint sec, void *buf)
 
uint ialloc (ushort type)
 
void iappend (uint inum, void *p, int n)
 
ushort xshort (ushort x)
 
uint xint (uint x)
 
int main (int argc, char *argv[])
 

Variables

int nbitmap = FSSIZE/(BSIZE*8) + 1
 
int ninodeblocks = NINODES / IPB + 1
 
int nlog = LOGSIZE
 
int nmeta
 
int nblocks
 
int fsfd
 
struct superblock sb
 
char zeroes [BSIZE]
 
uint freeinode = 1
 
uint freeblock
 

Macro Definition Documentation

#define min (   a,
 
)    ((a) < (b) ? (a) : (b))

Definition at line 253 of file mkfs.c.

#define NINODES   200

Definition at line 18 of file mkfs.c.

#define stat   xv6_stat

Definition at line 8 of file mkfs.c.

#define static_assert (   a,
 
)    do { switch (0) case 0: case (a): ; } while (0)

Definition at line 15 of file mkfs.c.

Function Documentation

void balloc ( int  used)

Definition at line 238 of file mkfs.c.

uint ialloc ( ushort  type)

Definition at line 224 of file mkfs.c.

void iappend ( uint  inum,
void *  p,
int  n 
)

Definition at line 256 of file mkfs.c.

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

Definition at line 68 of file mkfs.c.

void rinode ( uint  inum,
struct dinode ip 
)

Definition at line 198 of file mkfs.c.

void rsect ( uint  sec,
void *  buf 
)

Definition at line 211 of file mkfs.c.

void winode ( uint  inum,
struct dinode ip 
)

Definition at line 184 of file mkfs.c.

void wsect ( uint  sec,
void *  buf 
)

Definition at line 171 of file mkfs.c.

uint xint ( uint  x)

Definition at line 56 of file mkfs.c.

ushort xshort ( ushort  x)

Definition at line 46 of file mkfs.c.

Variable Documentation

uint freeblock

Definition at line 33 of file mkfs.c.

uint freeinode = 1

Definition at line 32 of file mkfs.c.

int fsfd

Definition at line 29 of file mkfs.c.

int nbitmap = FSSIZE/(BSIZE*8) + 1

Definition at line 23 of file mkfs.c.

int nblocks

Definition at line 27 of file mkfs.c.

int ninodeblocks = NINODES / IPB + 1

Definition at line 24 of file mkfs.c.

int nlog = LOGSIZE

Definition at line 25 of file mkfs.c.

int nmeta

Definition at line 26 of file mkfs.c.

struct superblock sb

Definition at line 30 of file mkfs.c.

char zeroes[BSIZE]

Definition at line 31 of file mkfs.c.