sofs19  0.1
FUSE based file system
inode.h
Go to the documentation of this file.
1 
10 #ifndef __SOFS19_INODE__
11 #define __SOFS19_INODE__
12 
13 #include <inttypes.h>
14 
15 namespace sofs19
16 {
17 
26 #define INODE_FREE 0001000
27 
29 #define N_DIRECT 8
30 
32 #define N_INDIRECT 8
33 
35 #define N_DOUBLE_INDIRECT 8
36 
38  struct SOInode
39  {
40 
44  uint16_t mode;
45 
47  uint16_t lnkcnt;
48 
50  uint32_t owner;
51 
53  uint32_t group;
54 
56  uint32_t size;
57 
59  uint32_t blkcnt;
60 
62  union
63  {
65  uint32_t atime;
67  uint32_t next;
68  };
69 
71  uint32_t mtime;
72 
74  uint32_t ctime;
75 
77  uint32_t d[N_DIRECT];
78 
80  uint32_t i1[N_INDIRECT];
81 
83  uint32_t i2[N_DOUBLE_INDIRECT];
84  };
85 
88 };
89 
90 #endif /* __SOFS19_INODE__ */
N_INDIRECT
#define N_INDIRECT
number of indirect block references in the inode
Definition: inode.h:32
N_DIRECT
#define N_DIRECT
number of direct block references in the inode
Definition: inode.h:29
sofs19::SOInode::i1
uint32_t i1[N_INDIRECT]
references to blocks that extend the d array
Definition: inode.h:80
sofs19::SOInode::next
uint32_t next
next free inode
Definition: inode.h:67
sofs19::SOInode::mode
uint16_t mode
inode mode: it stores the file type and permissions. (see man 2 stat).
Definition: inode.h:44
sofs19::SOInode
Definition of the inode data type.
Definition: inode.h:38
sofs19::SOInode::d
uint32_t d[N_DIRECT]
direct references to the first data blocks with file's data
Definition: inode.h:77
sofs19::SOInode::mtime
uint32_t mtime
time of last change to file information
Definition: inode.h:71
sofs19::SOInode::owner
uint32_t owner
user ID of the file owner
Definition: inode.h:50
sofs19::SOInode::lnkcnt
uint16_t lnkcnt
link count: number of hard links (directory entries) pointing to the inode
Definition: inode.h:47
sofs19::SOInode::i2
uint32_t i2[N_DOUBLE_INDIRECT]
references to a block that extends the i1 array
Definition: inode.h:83
sofs19::SOInode::ctime
uint32_t ctime
time of last change to inode information
Definition: inode.h:74
N_DOUBLE_INDIRECT
#define N_DOUBLE_INDIRECT
number of double indirect block references in the inode
Definition: inode.h:35
sofs19::SOInode::atime
uint32_t atime
time of last access to file information
Definition: inode.h:65
sofs19::SOInode::size
uint32_t size
file size in bytes:
Definition: inode.h:56
sofs19::SOInode::blkcnt
uint32_t blkcnt
block count: total number of blocks used by the file
Definition: inode.h:59
sofs19::SOInode::group
uint32_t group
group ID of the file owner
Definition: inode.h:53