9415774cb01ef771db8634c4e3b5a0bc2cc5ba88
[lwext4.git] / lwext4 / ext4_inode.h
1 /*\r
2  * Copyright (c) 2013 Grzegorz Kostka (kostka.grzegorz@gmail.com)\r
3  *\r
4  *\r
5  * HelenOS:\r
6  * Copyright (c) 2012 Martin Sucha\r
7  * Copyright (c) 2012 Frantisek Princ\r
8  * All rights reserved.\r
9  *\r
10  * Redistribution and use in source and binary forms, with or without\r
11  * modification, are permitted provided that the following conditions\r
12  * are met:\r
13  *\r
14  * - Redistributions of source code must retain the above copyright\r
15  *   notice, this list of conditions and the following disclaimer.\r
16  * - Redistributions in binary form must reproduce the above copyright\r
17  *   notice, this list of conditions and the following disclaimer in the\r
18  *   documentation and/or other materials provided with the distribution.\r
19  * - The name of the author may not be used to endorse or promote products\r
20  *   derived from this software without specific prior written permission.\r
21  *\r
22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\r
23  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\r
24  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r
25  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\r
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\r
27  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
31  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
32  */\r
33 \r
34 /** @addtogroup lwext4\r
35  * @{\r
36  */\r
37 /**\r
38  * @file  ext4_inode.h\r
39  * @brief Inode handle functions\r
40  */\r
41 \r
42 #ifndef EXT4_INODE_H_\r
43 #define EXT4_INODE_H_\r
44 \r
45 #include <ext4_config.h>\r
46 #include <stdint.h>\r
47 \r
48 /**@brief   TODO: ...*/\r
49 uint32_t ext4_inode_get_mode(struct ext4_sblock *sb, struct ext4_inode *inode);\r
50 \r
51 \r
52 /**@brief   TODO: ...*/\r
53 void ext4_inode_set_mode(struct ext4_sblock *sb, struct ext4_inode *inode,\r
54     uint32_t mode);\r
55 \r
56 /**@brief   TODO: ...*/\r
57 uint32_t ext4_inode_get_uid(struct ext4_inode *inode);\r
58 \r
59 /**@brief   TODO: ...*/\r
60 void ext4_inode_set_uid(struct ext4_inode *inode, uint32_t uid);\r
61 \r
62 /**@brief   TODO: ...*/\r
63 uint64_t ext4_inode_get_size(struct ext4_sblock *sb, struct ext4_inode *inode);\r
64 \r
65 /**@brief   TODO: ...*/\r
66 void ext4_inode_set_size(struct ext4_inode *inode, uint64_t size);\r
67 \r
68 /**@brief   TODO: ...*/\r
69 uint32_t ext4_inode_get_access_time(struct ext4_inode *inode);\r
70 \r
71 /**@brief   TODO: ...*/\r
72 void ext4_inode_set_access_time(struct ext4_inode *inode, uint32_t time);\r
73 \r
74 /**@brief   TODO: ...*/\r
75 uint32_t ext4_inode_get_change_inode_time(struct ext4_inode *inode);\r
76 \r
77 /**@brief   TODO: ...*/\r
78 void ext4_inode_set_change_inode_time(struct ext4_inode *inode,\r
79     uint32_t time);\r
80 \r
81 /**@brief   TODO: ...*/\r
82 uint32_t ext4_inode_get_modification_time(struct ext4_inode *inode);\r
83 \r
84 /**@brief   TODO: ...*/\r
85 void ext4_inode_set_modification_time(struct ext4_inode *inode, uint32_t time);\r
86 \r
87 /**@brief   TODO: ...*/\r
88 uint32_t ext4_inode_get_deletion_time(struct ext4_inode *inode);\r
89 \r
90 /**@brief   TODO: ...*/\r
91 void ext4_inode_set_deletion_time(struct ext4_inode *inode, uint32_t time);\r
92 \r
93 /**@brief   TODO: ...*/\r
94 uint32_t ext4_inode_get_gid(struct ext4_inode *inode);\r
95 \r
96 /**@brief   TODO: ...*/\r
97 void ext4_inode_set_gid(struct ext4_inode *inode, uint32_t gid);\r
98 \r
99 /**@brief   TODO: ...*/\r
100 uint16_t ext4_inode_get_links_count(struct ext4_inode *inode);\r
101 \r
102 /**@brief   TODO: ...*/\r
103 void ext4_inode_set_links_count(struct ext4_inode *inode, uint16_t cnt);\r
104 \r
105 /**@brief   TODO: ...*/\r
106 uint64_t ext4_inode_get_blocks_count(struct ext4_sblock *sb,\r
107     struct ext4_inode *inode);\r
108 \r
109 /**@brief   TODO: ...*/\r
110 int ext4_inode_set_blocks_count(struct ext4_sblock *sb,\r
111     struct ext4_inode *inode, uint64_t cnt);\r
112 \r
113 /**@brief   TODO: ...*/\r
114 uint32_t ext4_inode_get_flags(struct ext4_inode *inode);\r
115 \r
116 /**@brief   TODO: ...*/\r
117 void ext4_inode_set_flags(struct ext4_inode *inode, uint32_t flags);\r
118 \r
119 /**@brief   TODO: ...*/\r
120 uint32_t ext4_inode_get_generation(struct ext4_inode *inode);\r
121 \r
122 /**@brief   TODO: ...*/\r
123 void ext4_inode_set_generation(struct ext4_inode *inode, uint32_t gen);\r
124 \r
125 /**@brief   TODO: ...*/\r
126 uint64_t ext4_inode_get_file_acl(struct ext4_inode *inode,\r
127     struct ext4_sblock *sb);\r
128 \r
129 /**@brief   TODO: ...*/\r
130 void ext4_inode_set_file_acl(struct ext4_inode *inode,\r
131     struct ext4_sblock *sb, uint64_t acl);\r
132 \r
133 /**@brief   TODO: ...*/\r
134 uint32_t ext4_inode_get_direct_block(struct ext4_inode *inode, uint32_t idx);\r
135 \r
136 /**@brief   TODO: ...*/\r
137 void ext4_inode_set_direct_block(struct ext4_inode *inode, uint32_t idx,\r
138     uint32_t block);\r
139 \r
140 /**@brief   TODO: ...*/\r
141 uint32_t ext4_inode_get_indirect_block(struct ext4_inode *inode, uint32_t idx);\r
142 \r
143 /**@brief   TODO: ...*/\r
144 void ext4_inode_set_indirect_block(struct ext4_inode *inode, uint32_t idx,\r
145     uint32_t block);\r
146 \r
147 /**@brief   TODO: ...*/\r
148 bool ext4_inode_is_type(struct ext4_sblock *sb, struct ext4_inode *inode,\r
149     uint32_t type);\r
150 \r
151 /**@brief   TODO: ...*/\r
152 bool ext4_inode_has_flag(struct ext4_inode *inode, uint32_t f);\r
153 \r
154 /**@brief   TODO: ...*/\r
155 void ext4_inode_clear_flag(struct ext4_inode *inode, uint32_t f);\r
156 \r
157 /**@brief   TODO: ...*/\r
158 void ext4_inode_set_flag(struct ext4_inode *inode, uint32_t f);\r
159 \r
160 /**@brief   TODO: ...*/\r
161 bool ext4_inode_can_truncate(struct ext4_sblock *sb, struct ext4_inode *inode);\r
162 \r
163 \r
164 struct ext4_extent_header * ext4_inode_get_extent_header(struct ext4_inode *inode);\r
165 \r
166 #endif /* EXT4_INODE_H_ */\r
167 \r
168 /**\r
169  * @}\r
170  */\r
171 \r