Lines Matching full:inode
60 struct ext4_dir_entry_2 *prev, u32 inode, const char *name,
79 dentry->inode = inode;
90 and stores the location of the structure in an inode. The new inode's
91 .. link is set to dir_inode_num. Stores the location of the inode number
92 of each directory entry into dentries[i].inode, to be filled in later
93 when the inode for the entry is allocated. Returns the inode number of the
98 struct ext4_inode *inode;
118 error("failed to allocate inode\n");
124 inode = get_inode(inode_num);
125 if (inode == NULL) {
126 error("failed to get inode %u", inode_num);
130 data = inode_allocate_data_extents(inode, len, len);
136 inode->i_mode = S_IFDIR;
137 inode->i_links_count = dirs + 2;
138 inode->i_flags |= aux_info.default_i_flags;
160 dentries[i].inode = &dentry->inode;
173 /* Creates a file on disk. Returns the inode number of the new file */
176 struct ext4_inode *inode;
181 error("failed to allocate inode\n");
185 inode = get_inode(inode_num);
186 if (inode == NULL) {
187 error("failed to get inode %u", inode_num);
192 inode_allocate_file_extents(inode, len, filename);
194 inode->i_mode = S_IFREG;
195 inode->i_links_count = 1;
196 inode->i_flags |= aux_info.default_i_flags;
201 /* Creates a file on disk. Returns the inode number of the new file */
204 struct ext4_inode *inode;
210 error("failed to allocate inode\n");
214 inode = get_inode(inode_num);
215 if (inode == NULL) {
216 error("failed to get inode %u", inode_num);
220 inode->i_mode = S_IFLNK;
221 inode->i_links_count = 1;
222 inode->i_flags |= aux_info.default_i_flags;
223 inode->i_size_lo = len;
225 if (len + 1 <= sizeof(inode->i_block)) {
227 memcpy((char*)inode->i_block, link, len);
229 u8 *data = inode_allocate_data_indirect(inode, info.block_size, info.block_size);
231 inode->i_blocks_lo = info.block_size / 512;
239 struct ext4_inode *inode = get_inode(inode_num);
241 if (!inode)
244 inode->i_mode |= mode;
245 inode->i_uid = uid;
246 inode->i_gid = gid;
247 inode->i_mtime = mtime;
248 inode->i_atime = mtime;
249 inode->i_ctime = mtime;
289 * they're not stored in the inode. The kernel ext4 code uses the following
398 static int xattr_addto_inode(struct ext4_inode *inode, int name_index,
401 struct ext4_xattr_ibody_header *hdr = (struct ext4_xattr_ibody_header *) (inode + 1);
403 char *block_end = ((char *) inode) + info.inode_size;
412 inode->i_extra_isize = cpu_to_le16(sizeof(struct ext4_inode) - EXT4_GOOD_OLD_INODE_SIZE);
417 static int xattr_addto_block(struct ext4_inode *inode, int name_index,
420 struct ext4_xattr_header *header = get_xattr_block_for_inode(inode);
444 struct ext4_inode *inode = get_inode(inode_num);
446 if (!inode)
449 int result = xattr_addto_inode(inode, name_index, name, value, value_len);
451 result = xattr_addto_block(inode, name_index, name, value, value_len);