• Home
  • Raw
  • Download

Lines Matching refs:inode

39 static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode)  in ext2_add_nondir()  argument
41 int err = ext2_add_link(dentry, inode); in ext2_add_nondir()
43 d_instantiate(dentry, inode); in ext2_add_nondir()
44 unlock_new_inode(inode); in ext2_add_nondir()
47 inode_dec_link_count(inode); in ext2_add_nondir()
48 unlock_new_inode(inode); in ext2_add_nondir()
49 iput(inode); in ext2_add_nondir()
57 static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) in ext2_lookup()
59 struct inode * inode; in ext2_lookup() local
66 inode = NULL; in ext2_lookup()
68 inode = ext2_iget(dir->i_sb, ino); in ext2_lookup()
69 if (IS_ERR(inode)) in ext2_lookup()
70 return ERR_CAST(inode); in ext2_lookup()
72 return d_splice_alias(inode, dentry); in ext2_lookup()
92 static int ext2_create (struct inode * dir, struct dentry * dentry, int mode, struct nameidata *nd) in ext2_create()
94 struct inode * inode = ext2_new_inode (dir, mode); in ext2_create() local
95 int err = PTR_ERR(inode); in ext2_create()
96 if (!IS_ERR(inode)) { in ext2_create()
97 inode->i_op = &ext2_file_inode_operations; in ext2_create()
98 if (ext2_use_xip(inode->i_sb)) { in ext2_create()
99 inode->i_mapping->a_ops = &ext2_aops_xip; in ext2_create()
100 inode->i_fop = &ext2_xip_file_operations; in ext2_create()
101 } else if (test_opt(inode->i_sb, NOBH)) { in ext2_create()
102 inode->i_mapping->a_ops = &ext2_nobh_aops; in ext2_create()
103 inode->i_fop = &ext2_file_operations; in ext2_create()
105 inode->i_mapping->a_ops = &ext2_aops; in ext2_create()
106 inode->i_fop = &ext2_file_operations; in ext2_create()
108 mark_inode_dirty(inode); in ext2_create()
109 err = ext2_add_nondir(dentry, inode); in ext2_create()
114 static int ext2_mknod (struct inode * dir, struct dentry *dentry, int mode, dev_t rdev) in ext2_mknod()
116 struct inode * inode; in ext2_mknod() local
122 inode = ext2_new_inode (dir, mode); in ext2_mknod()
123 err = PTR_ERR(inode); in ext2_mknod()
124 if (!IS_ERR(inode)) { in ext2_mknod()
125 init_special_inode(inode, inode->i_mode, rdev); in ext2_mknod()
127 inode->i_op = &ext2_special_inode_operations; in ext2_mknod()
129 mark_inode_dirty(inode); in ext2_mknod()
130 err = ext2_add_nondir(dentry, inode); in ext2_mknod()
135 static int ext2_symlink (struct inode * dir, struct dentry * dentry, in ext2_symlink()
141 struct inode * inode; in ext2_symlink() local
146 inode = ext2_new_inode (dir, S_IFLNK | S_IRWXUGO); in ext2_symlink()
147 err = PTR_ERR(inode); in ext2_symlink()
148 if (IS_ERR(inode)) in ext2_symlink()
151 if (l > sizeof (EXT2_I(inode)->i_data)) { in ext2_symlink()
153 inode->i_op = &ext2_symlink_inode_operations; in ext2_symlink()
154 if (test_opt(inode->i_sb, NOBH)) in ext2_symlink()
155 inode->i_mapping->a_ops = &ext2_nobh_aops; in ext2_symlink()
157 inode->i_mapping->a_ops = &ext2_aops; in ext2_symlink()
158 err = page_symlink(inode, symname, l); in ext2_symlink()
163 inode->i_op = &ext2_fast_symlink_inode_operations; in ext2_symlink()
164 memcpy((char*)(EXT2_I(inode)->i_data),symname,l); in ext2_symlink()
165 inode->i_size = l-1; in ext2_symlink()
167 mark_inode_dirty(inode); in ext2_symlink()
169 err = ext2_add_nondir(dentry, inode); in ext2_symlink()
174 inode_dec_link_count(inode); in ext2_symlink()
175 unlock_new_inode(inode); in ext2_symlink()
176 iput (inode); in ext2_symlink()
180 static int ext2_link (struct dentry * old_dentry, struct inode * dir, in ext2_link()
183 struct inode *inode = old_dentry->d_inode; in ext2_link() local
186 if (inode->i_nlink >= EXT2_LINK_MAX) in ext2_link()
189 inode->i_ctime = CURRENT_TIME_SEC; in ext2_link()
190 inode_inc_link_count(inode); in ext2_link()
191 atomic_inc(&inode->i_count); in ext2_link()
193 err = ext2_add_link(dentry, inode); in ext2_link()
195 d_instantiate(dentry, inode); in ext2_link()
198 inode_dec_link_count(inode); in ext2_link()
199 iput(inode); in ext2_link()
203 static int ext2_mkdir(struct inode * dir, struct dentry * dentry, int mode) in ext2_mkdir()
205 struct inode * inode; in ext2_mkdir() local
213 inode = ext2_new_inode (dir, S_IFDIR | mode); in ext2_mkdir()
214 err = PTR_ERR(inode); in ext2_mkdir()
215 if (IS_ERR(inode)) in ext2_mkdir()
218 inode->i_op = &ext2_dir_inode_operations; in ext2_mkdir()
219 inode->i_fop = &ext2_dir_operations; in ext2_mkdir()
220 if (test_opt(inode->i_sb, NOBH)) in ext2_mkdir()
221 inode->i_mapping->a_ops = &ext2_nobh_aops; in ext2_mkdir()
223 inode->i_mapping->a_ops = &ext2_aops; in ext2_mkdir()
225 inode_inc_link_count(inode); in ext2_mkdir()
227 err = ext2_make_empty(inode, dir); in ext2_mkdir()
231 err = ext2_add_link(dentry, inode); in ext2_mkdir()
235 d_instantiate(dentry, inode); in ext2_mkdir()
236 unlock_new_inode(inode); in ext2_mkdir()
241 inode_dec_link_count(inode); in ext2_mkdir()
242 inode_dec_link_count(inode); in ext2_mkdir()
243 unlock_new_inode(inode); in ext2_mkdir()
244 iput(inode); in ext2_mkdir()
250 static int ext2_unlink(struct inode * dir, struct dentry *dentry) in ext2_unlink()
252 struct inode * inode = dentry->d_inode; in ext2_unlink() local
265 inode->i_ctime = dir->i_ctime; in ext2_unlink()
266 inode_dec_link_count(inode); in ext2_unlink()
272 static int ext2_rmdir (struct inode * dir, struct dentry *dentry) in ext2_rmdir()
274 struct inode * inode = dentry->d_inode; in ext2_rmdir() local
277 if (ext2_empty_dir(inode)) { in ext2_rmdir()
280 inode->i_size = 0; in ext2_rmdir()
281 inode_dec_link_count(inode); in ext2_rmdir()
288 static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry, in ext2_rename()
289 struct inode * new_dir, struct dentry * new_dentry ) in ext2_rename()
291 struct inode * old_inode = old_dentry->d_inode; in ext2_rename()
292 struct inode * new_inode = new_dentry->d_inode; in ext2_rename()