Subversion Repositories HelenOS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2372 konopa 1
/* Inode table.  This table holds inodes that are currently in use.  In some
2
* cases they have been opened by an open() or creat() system call, in other
3
* cases the file system itself needs the inode for one reason or another,
4
* such as to search a directory for a path name.
5
* The first part of the struct holds fields that are present on the
6
* disk; the second part holds fields not present on the disk.
7
*/
8
 
9
#ifndef _INODE_H
10
#define _INODE_H
11
 
12
#include "super.h"
13
 
14
#define NIL_INODE (inode_t *) 0    /* indicates absence of inode slot */
15
 
16
#define NO_SEEK            0    /* i_seek = NO_SEEK if last op was not SEEK */
17
#define ISEEK              1    /* i_seek = ISEEK if last op was SEEK */
18
 
19
typedef struct {
20
    mode_t i_mode;                /* file type, protection, etc. */
21
    nlink_t i_nlinks;             /* how many links to this file */
22
    offset_t i_size;              /* current file size in bytes */
23
    zone_t i_zone[V2_NR_TZONES];  /* zone numbers for direct, ind, and dbl ind */
24
 
25
/* The following items are not present on the disk. */
26
    dev_t i_dev;                  /* which device is the inode on */
27
    ino_t i_num;                  /* inode number on its (minor) device */
28
    int i_count;                  /* # times inode used; 0 means slot is free */
29
    int i_ndzones;                /* # direct zones (NR_DZONES) */
30
    int i_nindirs;                /* # indirect zones per indirect block */
31
    super_block_t *i_sp;          /* pointer to super block for inode's device */
32
    char i_seek;                  /* set on LSEEK, cleared on READ */
33
} inode_t;
34
 
35
extern inode_t inode[NR_INODES];
36
 
37
#endif /* _INODE_H */