xv6-simplified 0.1
简化版xv6
Loading...
Searching...
No Matches
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 "src/kernel/types.h"
#include "src/kernel/fs.h"
#include "src/kernel/stat.h"
#include "src/kernel/param.h"
Include dependency graph for mkfs.c:

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)
 
void die (const char *)
 
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

◆ min

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

◆ NINODES

#define NINODES   200

◆ stat

#define stat   xv6_stat

◆ static_assert

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

Function Documentation

◆ balloc()

void balloc ( int  used)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ die()

void die ( const char *  s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ialloc()

uint ialloc ( ushort  type)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ iappend()

void iappend ( uint  inum,
void *  p,
int  n 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)
Here is the call graph for this function:

◆ rinode()

void rinode ( uint  inum,
struct dinode *  ip 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rsect()

void rsect ( uint  sec,
void *  buf 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winode()

void winode ( uint  inum,
struct dinode *  ip 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsect()

void wsect ( uint  sec,
void *  buf 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xint()

uint xint ( uint  x)
Here is the caller graph for this function:

◆ xshort()

ushort xshort ( ushort  x)
Here is the caller graph for this function:

Variable Documentation

◆ freeblock

uint freeblock

◆ freeinode

uint freeinode = 1

◆ fsfd

int fsfd

◆ nbitmap

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

◆ nblocks

int nblocks

◆ ninodeblocks

int ninodeblocks = NINODES / IPB + 1

◆ nlog

int nlog = LOGSIZE

◆ nmeta

int nmeta

◆ sb

struct superblock sb

◆ zeroes

char zeroes[BSIZE]