#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"Go to the source code of this file.
Defines | |
| #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[]) |
| uint | i2b (uint inum) |
Variables | |
| int | nblocks = 995 |
| int | ninodes = 200 |
| int | size = 1024 |
| int | fsfd |
| struct superblock | sb |
| char | zeroes [512] |
| uint | freeblock |
| uint | usedblocks |
| uint | bitblocks |
| uint | freeinode = 1 |
| void balloc | ( | int | used | ) |
Definition at line 208 of file mkfs.c.
References bzero(), freeinode, dinode::nlink, dinode::size, dinode::type, winode(), xint(), and xshort().
| void iappend | ( | uint | inum, | |
| void * | p, | |||
| int | n | |||
| ) |
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Definition at line 55 of file mkfs.c.
References balloc(), bitblocks, BSIZE, bzero(), close(), DIRSIZ, exit(), freeblock, fsfd, ialloc(), iappend(), dirent::inum, IPB, dirent::name, nblocks, superblock::nblocks, ninodes, superblock::ninodes, O_RDWR, open(), printf(), read(), rinode(), ROOTINO, sb, dinode::size, size, superblock::size, strcpy(), strncpy(), T_DIR, T_FILE, usedblocks, winode(), wsect(), xint(), xshort(), and zeroes.
| void rsect | ( | uint | sec, | |
| void * | buf | |||
| ) |
| void wsect | ( | uint | sec, | |
| void * | buf | |||
| ) |
| struct superblock sb |
1.5.6