30 #include <linux/time.h>
44 inode_dec_link_count(inode);
49 static struct dentry *ufs_lookup(
struct inode * dir,
struct dentry *dentry,
unsigned int flags)
51 struct inode * inode =
NULL;
73 static int ufs_create (
struct inode * dir,
struct dentry * dentry,
umode_t mode,
88 mark_inode_dirty(inode);
90 err = ufs_add_nondir(dentry, inode);
93 UFSD(
"END: err=%d\n", err);
97 static int ufs_mknod(
struct inode *dir,
struct dentry *dentry,
umode_t mode,
dev_t rdev)
102 if (!old_valid_dev(rdev))
106 err = PTR_ERR(inode);
107 if (!IS_ERR(inode)) {
110 mark_inode_dirty(inode);
112 err = ufs_add_nondir(dentry, inode);
118 static int ufs_symlink (
struct inode * dir,
struct dentry * dentry,
119 const char * symname)
123 unsigned l =
strlen(symname)+1;
124 struct inode *
inode;
131 err = PTR_ERR(inode);
135 if (l > UFS_SB(sb)->s_uspi->s_maxsymlinklen) {
145 memcpy(UFS_I(inode)->i_u1.i_symlink, symname, l);
148 mark_inode_dirty(inode);
150 err = ufs_add_nondir(dentry, inode);
157 inode_dec_link_count(inode);
162 static int ufs_link (
struct dentry * old_dentry,
struct inode * dir,
163 struct dentry *dentry)
165 struct inode *inode = old_dentry->
d_inode;
171 inode_inc_link_count(inode);
174 error = ufs_add_nondir(dentry, inode);
179 static int ufs_mkdir(
struct inode * dir,
struct dentry * dentry,
umode_t mode)
181 struct inode *
inode;
185 inode_inc_link_count(dir);
188 err = PTR_ERR(inode);
196 inode_inc_link_count(inode);
212 inode_dec_link_count(inode);
213 inode_dec_link_count(inode);
216 inode_dec_link_count(dir);
221 static int ufs_unlink(
struct inode *dir,
struct dentry *dentry)
223 struct inode * inode = dentry->
d_inode;
237 inode_dec_link_count(inode);
243 static int ufs_rmdir (
struct inode * dir,
struct dentry *dentry)
245 struct inode * inode = dentry->
d_inode;
250 err = ufs_unlink(dir, dentry);
253 inode_dec_link_count(inode);
254 inode_dec_link_count(dir);
261 static int ufs_rename(
struct inode *old_dir,
struct dentry *old_dentry,
262 struct inode *new_dir,
struct dentry *new_dentry)
264 struct inode *old_inode = old_dentry->
d_inode;
266 struct page *dir_page =
NULL;
268 struct page *old_page;
284 struct page *new_page;
299 inode_dec_link_count(new_inode);
305 inode_inc_link_count(new_dir);
315 mark_inode_dirty(old_inode);
319 inode_dec_link_count(old_dir);
337 .create = ufs_create,
338 .lookup = ufs_lookup,
340 .unlink = ufs_unlink,
341 .symlink = ufs_symlink,
345 .rename = ufs_rename,