16 inode_dec_link_count(inode);
21 static struct dentry *minix_lookup(
struct inode * dir,
struct dentry *dentry,
unsigned int flags)
23 struct inode * inode =
NULL;
26 if (dentry->
d_name.len > minix_sb(dir->
i_sb)->s_namelen)
33 return ERR_CAST(inode);
44 if (!old_valid_dev(rdev))
51 mark_inode_dirty(inode);
52 error = add_nondir(dentry, inode);
57 static int minix_create(
struct inode *dir,
struct dentry *dentry,
umode_t mode,
60 return minix_mknod(dir, dentry, mode, 0);
63 static int minix_symlink(
struct inode * dir,
struct dentry *dentry,
70 if (i > dir->
i_sb->s_blocksize)
82 err = add_nondir(dentry, inode);
87 inode_dec_link_count(inode);
92 static int minix_link(
struct dentry * old_dentry,
struct inode * dir,
93 struct dentry *dentry)
95 struct inode *inode = old_dentry->
d_inode;
98 inode_inc_link_count(inode);
100 return add_nondir(dentry, inode);
103 static int minix_mkdir(
struct inode * dir,
struct dentry *dentry,
umode_t mode)
105 struct inode *
inode;
108 inode_inc_link_count(dir);
116 inode_inc_link_count(inode);
131 inode_dec_link_count(inode);
132 inode_dec_link_count(inode);
135 inode_dec_link_count(dir);
139 static int minix_unlink(
struct inode * dir,
struct dentry *dentry)
142 struct inode * inode = dentry->
d_inode;
155 inode_dec_link_count(inode);
160 static int minix_rmdir(
struct inode * dir,
struct dentry *dentry)
162 struct inode * inode = dentry->
d_inode;
166 err = minix_unlink(dir, dentry);
168 inode_dec_link_count(dir);
169 inode_dec_link_count(inode);
175 static int minix_rename(
struct inode * old_dir,
struct dentry *old_dentry,
176 struct inode * new_dir,
struct dentry *new_dentry)
178 struct inode * old_inode = old_dentry->
d_inode;
180 struct page * dir_page =
NULL;
182 struct page * old_page;
198 struct page * new_page;
213 inode_dec_link_count(new_inode);
219 inode_inc_link_count(new_dir);
223 mark_inode_dirty(old_inode);
227 inode_dec_link_count(old_dir);
247 .create = minix_create,
248 .lookup = minix_lookup,
250 .unlink = minix_unlink,
251 .symlink = minix_symlink,
252 .mkdir = minix_mkdir,
253 .rmdir = minix_rmdir,
254 .mknod = minix_mknod,
255 .rename = minix_rename,