43 inode_dec_link_count(inode);
48 static struct dentry *exofs_lookup(
struct inode *dir,
struct dentry *dentry,
62 static int exofs_create(
struct inode *dir,
struct dentry *dentry,
umode_t mode,
66 int err = PTR_ERR(inode);
71 mark_inode_dirty(inode);
72 err = exofs_add_nondir(dentry, inode);
77 static int exofs_mknod(
struct inode *dir,
struct dentry *dentry,
umode_t mode,
83 if (!new_valid_dev(rdev))
90 mark_inode_dirty(inode);
91 err = exofs_add_nondir(dentry, inode);
96 static int exofs_symlink(
struct inode *dir,
struct dentry *dentry,
101 unsigned l =
strlen(symname)+1;
109 err = PTR_ERR(inode);
114 if (l >
sizeof(oi->
i_data)) {
129 mark_inode_dirty(inode);
131 err = exofs_add_nondir(dentry, inode);
136 inode_dec_link_count(inode);
141 static int exofs_link(
struct dentry *old_dentry,
struct inode *dir,
142 struct dentry *dentry)
144 struct inode *inode = old_dentry->
d_inode;
147 inode_inc_link_count(inode);
150 return exofs_add_nondir(dentry, inode);
153 static int exofs_mkdir(
struct inode *dir,
struct dentry *dentry,
umode_t mode)
158 inode_inc_link_count(dir);
161 err = PTR_ERR(inode);
169 inode_inc_link_count(inode);
184 inode_dec_link_count(inode);
185 inode_dec_link_count(inode);
188 inode_dec_link_count(dir);
192 static int exofs_unlink(
struct inode *dir,
struct dentry *dentry)
194 struct inode *inode = dentry->
d_inode;
208 inode_dec_link_count(inode);
214 static int exofs_rmdir(
struct inode *dir,
struct dentry *dentry)
216 struct inode *inode = dentry->
d_inode;
220 err = exofs_unlink(dir, dentry);
223 inode_dec_link_count(inode);
224 inode_dec_link_count(dir);
230 static int exofs_rename(
struct inode *old_dir,
struct dentry *old_dentry,
231 struct inode *new_dir,
struct dentry *new_dentry)
233 struct inode *old_inode = old_dentry->
d_inode;
235 struct page *dir_page =
NULL;
237 struct page *old_page;
253 struct page *new_page;
268 inode_dec_link_count(new_inode);
276 inode_inc_link_count(new_dir);
282 mark_inode_dirty(old_inode);
286 inode_dec_link_count(old_dir);
306 .create = exofs_create,
307 .lookup = exofs_lookup,
309 .unlink = exofs_unlink,
310 .symlink = exofs_symlink,
311 .mkdir = exofs_mkdir,
312 .rmdir = exofs_rmdir,
313 .mknod = exofs_mknod,
314 .rename = exofs_rename,