Lines Matching refs:inode
38 static inline int ufs_add_nondir(struct dentry *dentry, struct inode *inode) in ufs_add_nondir() argument
40 int err = ufs_add_link(dentry, inode); in ufs_add_nondir()
42 d_instantiate(dentry, inode); in ufs_add_nondir()
45 inode_dec_link_count(inode); in ufs_add_nondir()
46 iput(inode); in ufs_add_nondir()
50 static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) in ufs_lookup()
52 struct inode * inode = NULL; in ufs_lookup() local
61 inode = ufs_iget(dir->i_sb, ino); in ufs_lookup()
62 if (IS_ERR(inode)) { in ufs_lookup()
64 return ERR_CAST(inode); in ufs_lookup()
68 d_add(dentry, inode); in ufs_lookup()
80 static int ufs_create (struct inode * dir, struct dentry * dentry, int mode, in ufs_create()
83 struct inode *inode; in ufs_create() local
87 inode = ufs_new_inode(dir, mode); in ufs_create()
88 err = PTR_ERR(inode); in ufs_create()
90 if (!IS_ERR(inode)) { in ufs_create()
91 inode->i_op = &ufs_file_inode_operations; in ufs_create()
92 inode->i_fop = &ufs_file_operations; in ufs_create()
93 inode->i_mapping->a_ops = &ufs_aops; in ufs_create()
94 mark_inode_dirty(inode); in ufs_create()
96 err = ufs_add_nondir(dentry, inode); in ufs_create()
103 static int ufs_mknod (struct inode * dir, struct dentry *dentry, int mode, dev_t rdev) in ufs_mknod()
105 struct inode *inode; in ufs_mknod() local
110 inode = ufs_new_inode(dir, mode); in ufs_mknod()
111 err = PTR_ERR(inode); in ufs_mknod()
112 if (!IS_ERR(inode)) { in ufs_mknod()
113 init_special_inode(inode, mode, rdev); in ufs_mknod()
114 ufs_set_inode_dev(inode->i_sb, UFS_I(inode), rdev); in ufs_mknod()
115 mark_inode_dirty(inode); in ufs_mknod()
117 err = ufs_add_nondir(dentry, inode); in ufs_mknod()
123 static int ufs_symlink (struct inode * dir, struct dentry * dentry, in ufs_symlink()
129 struct inode * inode; in ufs_symlink() local
135 inode = ufs_new_inode(dir, S_IFLNK | S_IRWXUGO); in ufs_symlink()
136 err = PTR_ERR(inode); in ufs_symlink()
137 if (IS_ERR(inode)) in ufs_symlink()
142 inode->i_op = &page_symlink_inode_operations; in ufs_symlink()
143 inode->i_mapping->a_ops = &ufs_aops; in ufs_symlink()
144 err = page_symlink(inode, symname, l); in ufs_symlink()
149 inode->i_op = &ufs_fast_symlink_inode_operations; in ufs_symlink()
150 memcpy((char*)&UFS_I(inode)->i_u1.i_data,symname,l); in ufs_symlink()
151 inode->i_size = l-1; in ufs_symlink()
153 mark_inode_dirty(inode); in ufs_symlink()
155 err = ufs_add_nondir(dentry, inode); in ufs_symlink()
162 inode_dec_link_count(inode); in ufs_symlink()
163 iput(inode); in ufs_symlink()
167 static int ufs_link (struct dentry * old_dentry, struct inode * dir, in ufs_link()
170 struct inode *inode = old_dentry->d_inode; in ufs_link() local
174 if (inode->i_nlink >= UFS_LINK_MAX) { in ufs_link()
179 inode->i_ctime = CURRENT_TIME_SEC; in ufs_link()
180 inode_inc_link_count(inode); in ufs_link()
181 atomic_inc(&inode->i_count); in ufs_link()
183 error = ufs_add_nondir(dentry, inode); in ufs_link()
188 static int ufs_mkdir(struct inode * dir, struct dentry * dentry, int mode) in ufs_mkdir()
190 struct inode * inode; in ufs_mkdir() local
199 inode = ufs_new_inode(dir, S_IFDIR|mode); in ufs_mkdir()
200 err = PTR_ERR(inode); in ufs_mkdir()
201 if (IS_ERR(inode)) in ufs_mkdir()
204 inode->i_op = &ufs_dir_inode_operations; in ufs_mkdir()
205 inode->i_fop = &ufs_dir_operations; in ufs_mkdir()
206 inode->i_mapping->a_ops = &ufs_aops; in ufs_mkdir()
208 inode_inc_link_count(inode); in ufs_mkdir()
210 err = ufs_make_empty(inode, dir); in ufs_mkdir()
214 err = ufs_add_link(dentry, inode); in ufs_mkdir()
219 d_instantiate(dentry, inode); in ufs_mkdir()
224 inode_dec_link_count(inode); in ufs_mkdir()
225 inode_dec_link_count(inode); in ufs_mkdir()
226 iput (inode); in ufs_mkdir()
233 static int ufs_unlink(struct inode *dir, struct dentry *dentry) in ufs_unlink()
235 struct inode * inode = dentry->d_inode; in ufs_unlink() local
248 inode->i_ctime = dir->i_ctime; in ufs_unlink()
249 inode_dec_link_count(inode); in ufs_unlink()
255 static int ufs_rmdir (struct inode * dir, struct dentry *dentry) in ufs_rmdir()
257 struct inode * inode = dentry->d_inode; in ufs_rmdir() local
261 if (ufs_empty_dir (inode)) { in ufs_rmdir()
264 inode->i_size = 0; in ufs_rmdir()
265 inode_dec_link_count(inode); in ufs_rmdir()
273 static int ufs_rename(struct inode *old_dir, struct dentry *old_dentry, in ufs_rename()
274 struct inode *new_dir, struct dentry *new_dentry) in ufs_rename()
276 struct inode *old_inode = old_dentry->d_inode; in ufs_rename()
277 struct inode *new_inode = new_dentry->d_inode; in ufs_rename()