FreeNOS
LinnInode.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009 Niek Linnenbank
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __FILESYSTEM_LINN_INODE_H
19 #define __FILESYSTEM_LINN_INODE_H
20 
21 #include <Types.h>
22 
37 #define LINN_INODE_ROOT 0
38 
49 #define LINN_INODE_DIR_BLOCKS 4
50 
52 #define LINN_INODE_IND_BLOCKS (LINN_INODE_DIR_BLOCKS + 1)
53 
55 #define LINN_INODE_DIND_BLOCKS (LINN_INODE_IND_BLOCKS + 1)
56 
58 #define LINN_INODE_TIND_BLOCKS (LINN_INODE_DIND_BLOCKS + 1)
59 
61 #define LINN_INODE_BLOCKS (LINN_INODE_TIND_BLOCKS + 1)
62 
80 #define LINN_INODE_NUM_BLOCKS(super,inode) \
81  ((inode)->size % (super)->blockSize ? \
82  (inode)->size / (super)->blockSize + 1 : \
83  (inode)->size / (super)->blockSize)
84 
92 typedef struct LinnInode
93 {
94  le16 type:3;
95  le16 mode:13;
105 }
106 LinnInode;
107 
113 #endif /* __FILESYSTEM_LINN_INODE_H */
LinnInode::modifyTime
le32 modifyTime
Modification time.
Definition: LinnInode.h:101
LinnInode::changeTime
le32 changeTime
Status change timestamp.
Definition: LinnInode.h:102
Types.h
LinnInode::accessTime
le32 accessTime
Access time.
Definition: LinnInode.h:99
LinnInode::block
le32 block[LINN_INODE_BLOCKS]
Pointers to blocks.
Definition: LinnInode.h:104
le16
u16 BITWISE le16
Unsigned 16-bit little endian number.
Definition: Types.h:112
LinnInode::links
le16 links
Links count.
Definition: LinnInode.h:103
LINN_INODE_BLOCKS
#define LINN_INODE_BLOCKS
Total number of block pointers in an LinnInode.
Definition: LinnInode.h:61
LinnInode
Structure of an inode on the disk in the LinnFS filesystem.
Definition: LinnInode.h:92
LinnInode::uid
le16 uid
User Identity.
Definition: LinnInode.h:96
LinnInode::gid
le16 gid
Group Identity.
Definition: LinnInode.h:97
le32
u32 BITWISE le32
Unsigned 32-bit little endian number.
Definition: Types.h:106
LinnInode::mode
le16 mode
Access permissions, as an FileMode.
Definition: LinnInode.h:95
LinnInode::type
le16 type
Type of file, as an FileType.
Definition: LinnInode.h:94
LinnInode::createTime
le32 createTime
Creation time.
Definition: LinnInode.h:100
LinnInode
struct LinnInode LinnInode
Structure of an inode on the disk in the LinnFS filesystem.
LinnInode::size
le32 size
Size in bytes.
Definition: LinnInode.h:98