Subversion Repositories HelenOS

Rev

Rev 2404 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2404 Rev 2435
Line 30... Line 30...
30
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
31
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
32
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
32
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
 */
34
 */
35
 
35
 
-
 
36
/** @addtogroup FileSystemImpl
-
 
37
* @{
-
 
38
*/
36
 
39
 
37
/* Inode table.  This table holds inodes that are currently in use.  In some
-
 
38
* cases they have been opened by an open() or creat() system call, in other
-
 
39
* cases the file system itself needs the inode for one reason or another,
-
 
-
 
40
/**
40
* such as to search a directory for a path name.
41
 * @file    inode.h
41
* The first part of the struct holds fields that are present on the
-
 
42
* disk; the second part holds fields not present on the disk.
42
 * @brief   Inode table definition.  
43
*/
43
 */
44
 
44
 
45
#ifndef _INODE_H
45
#ifndef _INODE_H
46
#define _INODE_H
46
#define _INODE_H
47
 
47
 
48
#include "super.h"
48
#include "super.h"
49
 
49
 
50
#define NIL_INODE (inode_t *) 0    /* indicates absence of inode slot */
50
#define NIL_INODE (inode_t *) 0    /**< indicates absence of inode slot */
51
 
51
 
52
#define NO_SEEK            0    /* i_seek = NO_SEEK if last op was not SEEK */
52
#define NO_SEEK            0    /**< i_seek = NO_SEEK if last op was not SEEK */
53
#define ISEEK              1    /* i_seek = ISEEK if last op was SEEK */
53
#define ISEEK              1    /**< i_seek = ISEEK if last op was SEEK */
54
 
54
 
-
 
55
/*
-
 
56
* This table holds inodes that are currently in use.  In some
-
 
57
* cases they have been opened by an open() or creat() system call, in other
-
 
58
* cases the file system itself needs the inode for one reason or another,
-
 
59
* such as to search a directory for a path name.
-
 
60
* The first part of the struct holds fields that are present on the
-
 
61
* disk; the second part holds fields not present on the disk.
-
 
62
*/
55
typedef struct {
63
typedef struct {
56
    mode_t i_mode;                /* file type, protection, etc. */
64
    mode_t i_mode;                /**< file type, protection, etc. */
57
    nlink_t i_nlinks;             /* how many links to this file */
65
    nlink_t i_nlinks;             /**< how many links to this file */
58
    offset_t i_size;              /* current file size in bytes */
66
    offset_t i_size;              /**< current file size in bytes */
59
    zone_t i_zone[V2_NR_TZONES];  /* zone numbers for direct, ind, and dbl ind */
67
    zone_t i_zone[V2_NR_TZONES];  /**< zone numbers for direct, ind, and dbl ind */
60
 
68
 
61
/* The following items are not present on the disk. */
69
/* The following items are not present on the disk. */
62
    dev_t i_dev;                  /* which device is the inode on */
70
    dev_t i_dev;                  /**< which device is the inode on */
63
    ino_t i_num;                  /* inode number on its (minor) device */
71
    ino_t i_num;                  /**< inode number on its (minor) device */
64
    int i_count;                  /* # times inode used; 0 means slot is free */
72
    int i_count;                  /**< # times inode used; 0 means slot is free */
65
    int i_ndzones;                /* # direct zones (NR_DZONES) */
73
    int i_ndzones;                /**< # direct zones (NR_DZONES) */
66
    int i_nindirs;                /* # indirect zones per indirect block */
74
    int i_nindirs;                /**< # indirect zones per indirect block */
67
    super_block_t *i_sp;          /* pointer to super block for inode's device */
75
    super_block_t *i_sp;          /**< pointer to super block for inode's device */
68
    char i_seek;                  /* set on LSEEK, cleared on READ */
76
    char i_seek;                  /**< set on LSEEK, cleared on READ */
69
} inode_t;
77
} inode_t;
70
 
78
 
71
extern inode_t inode[NR_INODES];
79
extern inode_t inode[NR_INODES];
72
 
80
 
73
#endif /* _INODE_H */
81
#endif /* _INODE_H */
-
 
82
 
-
 
83
/**
-
 
84
 * }
-
 
85
 */
-
 
86