UNIX xv6 (rev8, 9/1/15)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Macros | Functions | Variables
fs.c File Reference
#include "types.h"
#include "defs.h"
#include "param.h"
#include "stat.h"
#include "mmu.h"
#include "proc.h"
#include "spinlock.h"
#include "fs.h"
#include "buf.h"
#include "file.h"

Go to the source code of this file.

Macros

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

Functions

void readsb (int dev, struct superblock *sb)
 
void iinit (int dev)
 
struct inodeialloc (uint dev, short type)
 
void iupdate (struct inode *ip)
 
struct inodeidup (struct inode *ip)
 
void ilock (struct inode *ip)
 
void iunlock (struct inode *ip)
 
void iput (struct inode *ip)
 
void iunlockput (struct inode *ip)
 
void stati (struct inode *ip, struct stat *st)
 
int readi (struct inode *ip, char *dst, uint off, uint n)
 
int writei (struct inode *ip, char *src, uint off, uint n)
 
int namecmp (const char *s, const char *t)
 
struct inodedirlookup (struct inode *dp, char *name, uint *poff)
 
int dirlink (struct inode *dp, char *name, uint inum)
 
struct inodenamei (char *path)
 
struct inodenameiparent (char *path, char *name)
 

Variables

struct superblock sb
 
struct {
   struct spinlock   lock
 
   struct inode   inode [NINODE]
 
icache
 

Macro Definition Documentation

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

Definition at line 23 of file fs.c.

Function Documentation

int dirlink ( struct inode dp,
char *  name,
uint  inum 
)

Definition at line 533 of file fs.c.

struct inode* dirlookup ( struct inode dp,
char *  name,
uint poff 
)

Definition at line 506 of file fs.c.

struct inode* ialloc ( uint  dev,
short  type 
)

Definition at line 177 of file fs.c.

struct inode* idup ( struct inode ip)

Definition at line 256 of file fs.c.

void iinit ( int  dev)

Definition at line 163 of file fs.c.

void ilock ( struct inode ip)

Definition at line 267 of file fs.c.

void iput ( struct inode ip)

Definition at line 318 of file fs.c.

void iunlock ( struct inode ip)

Definition at line 299 of file fs.c.

void iunlockput ( struct inode ip)

Definition at line 340 of file fs.c.

void iupdate ( struct inode ip)

Definition at line 200 of file fs.c.

int namecmp ( const char *  s,
const char *  t 
)

Definition at line 498 of file fs.c.

struct inode* namei ( char *  path)

Definition at line 641 of file fs.c.

struct inode* nameiparent ( char *  path,
char *  name 
)

Definition at line 648 of file fs.c.

int readi ( struct inode ip,
char *  dst,
uint  off,
uint  n 
)

Definition at line 435 of file fs.c.

void readsb ( int  dev,
struct superblock sb 
)

Definition at line 29 of file fs.c.

void stati ( struct inode ip,
struct stat st 
)

Definition at line 423 of file fs.c.

int writei ( struct inode ip,
char *  src,
uint  off,
uint  n 
)

Definition at line 463 of file fs.c.

Variable Documentation

struct { ... } icache
struct inode inode[NINODE]

Definition at line 159 of file fs.c.

struct spinlock lock

Definition at line 158 of file fs.c.

struct superblock sb

Definition at line 25 of file fs.c.