Lines Matching refs:inode

40 static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode)
42 int err = ext2_add_link(dentry, inode);
44 d_instantiate_new(dentry, inode);
47 inode_dec_link_count(inode);
48 discard_new_inode(inode);
56 static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags)
58 struct inode * inode;
69 inode = NULL;
71 inode = ext2_iget(dir->i_sb, ino);
72 if (inode == ERR_PTR(-ESTALE)) {
74 "deleted inode referenced: %lu",
79 return d_splice_alias(inode, dentry);
97 * is so far negative - it has no inode.
99 * If the create succeeds, we fill in the inode information
103 struct inode * dir, struct dentry * dentry,
106 struct inode *inode;
113 inode = ext2_new_inode(dir, mode, &dentry->d_name);
114 if (IS_ERR(inode))
115 return PTR_ERR(inode);
117 ext2_set_file_ops(inode);
118 mark_inode_dirty(inode);
119 return ext2_add_nondir(dentry, inode);
122 static int ext2_tmpfile(struct mnt_idmap *idmap, struct inode *dir,
125 struct inode *inode = ext2_new_inode(dir, mode, NULL);
126 if (IS_ERR(inode))
127 return PTR_ERR(inode);
129 ext2_set_file_ops(inode);
130 mark_inode_dirty(inode);
131 d_tmpfile(file, inode);
132 unlock_new_inode(inode);
136 static int ext2_mknod (struct mnt_idmap * idmap, struct inode * dir,
139 struct inode * inode;
146 inode = ext2_new_inode (dir, mode, &dentry->d_name);
147 err = PTR_ERR(inode);
148 if (!IS_ERR(inode)) {
149 init_special_inode(inode, inode->i_mode, rdev);
150 inode->i_op = &ext2_special_inode_operations;
151 mark_inode_dirty(inode);
152 err = ext2_add_nondir(dentry, inode);
157 static int ext2_symlink (struct mnt_idmap * idmap, struct inode * dir,
163 struct inode * inode;
172 inode = ext2_new_inode (dir, S_IFLNK | S_IRWXUGO, &dentry->d_name);
173 err = PTR_ERR(inode);
174 if (IS_ERR(inode))
177 if (l > sizeof (EXT2_I(inode)->i_data)) {
179 inode->i_op = &ext2_symlink_inode_operations;
180 inode_nohighmem(inode);
181 inode->i_mapping->a_ops = &ext2_aops;
182 err = page_symlink(inode, symname, l);
187 inode->i_op = &ext2_fast_symlink_inode_operations;
188 inode->i_link = (char*)EXT2_I(inode)->i_data;
189 memcpy(inode->i_link, symname, l);
190 inode->i_size = l-1;
192 mark_inode_dirty(inode);
194 err = ext2_add_nondir(dentry, inode);
199 inode_dec_link_count(inode);
200 discard_new_inode(inode);
204 static int ext2_link (struct dentry * old_dentry, struct inode * dir,
207 struct inode *inode = d_inode(old_dentry);
214 inode_set_ctime_current(inode);
215 inode_inc_link_count(inode);
216 ihold(inode);
218 err = ext2_add_link(dentry, inode);
220 d_instantiate(dentry, inode);
223 inode_dec_link_count(inode);
224 iput(inode);
229 struct inode * dir, struct dentry * dentry, umode_t mode)
231 struct inode * inode;
240 inode = ext2_new_inode(dir, S_IFDIR | mode, &dentry->d_name);
241 err = PTR_ERR(inode);
242 if (IS_ERR(inode))
245 inode->i_op = &ext2_dir_inode_operations;
246 inode->i_fop = &ext2_dir_operations;
247 inode->i_mapping->a_ops = &ext2_aops;
249 inode_inc_link_count(inode);
251 err = ext2_make_empty(inode, dir);
255 err = ext2_add_link(dentry, inode);
259 d_instantiate_new(dentry, inode);
264 inode_dec_link_count(inode);
265 inode_dec_link_count(inode);
266 discard_new_inode(inode);
272 static int ext2_unlink(struct inode *dir, struct dentry *dentry)
274 struct inode *inode = d_inode(dentry);
294 inode_set_ctime_to_ts(inode, inode_get_ctime(dir));
295 inode_dec_link_count(inode);
301 static int ext2_rmdir (struct inode * dir, struct dentry *dentry)
303 struct inode * inode = d_inode(dentry);
306 if (ext2_empty_dir(inode)) {
309 inode->i_size = 0;
310 inode_dec_link_count(inode);
318 struct inode * old_dir, struct dentry * old_dentry,
319 struct inode * new_dir, struct dentry * new_dentry,
322 struct inode * old_inode = d_inode(old_dentry);
323 struct inode * new_inode = d_inode(new_dentry);