Lines Matching refs:inode
9 static int add_nondir(struct dentry *dentry, struct inode *inode) in add_nondir() argument
11 int err = minix_add_link(dentry, inode); in add_nondir()
13 d_instantiate(dentry, inode); in add_nondir()
16 inode_dec_link_count(inode); in add_nondir()
17 iput(inode); in add_nondir()
21 static struct dentry *minix_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) in minix_lookup()
23 struct inode * inode = NULL; in minix_lookup() local
33 inode = minix_iget(dir->i_sb, ino); in minix_lookup()
34 if (IS_ERR(inode)) in minix_lookup()
35 return ERR_CAST(inode); in minix_lookup()
37 d_add(dentry, inode); in minix_lookup()
41 static int minix_mknod(struct inode * dir, struct dentry *dentry, int mode, dev_t rdev) in minix_mknod()
44 struct inode *inode; in minix_mknod() local
49 inode = minix_new_inode(dir, &error); in minix_mknod()
51 if (inode) { in minix_mknod()
52 inode->i_mode = mode; in minix_mknod()
53 minix_set_inode(inode, rdev); in minix_mknod()
54 mark_inode_dirty(inode); in minix_mknod()
55 error = add_nondir(dentry, inode); in minix_mknod()
60 static int minix_create(struct inode * dir, struct dentry *dentry, int mode, in minix_create()
66 static int minix_symlink(struct inode * dir, struct dentry *dentry, in minix_symlink()
71 struct inode * inode; in minix_symlink() local
76 inode = minix_new_inode(dir, &err); in minix_symlink()
77 if (!inode) in minix_symlink()
80 inode->i_mode = S_IFLNK | 0777; in minix_symlink()
81 minix_set_inode(inode, 0); in minix_symlink()
82 err = page_symlink(inode, symname, i); in minix_symlink()
86 err = add_nondir(dentry, inode); in minix_symlink()
91 inode_dec_link_count(inode); in minix_symlink()
92 iput(inode); in minix_symlink()
96 static int minix_link(struct dentry * old_dentry, struct inode * dir, in minix_link()
99 struct inode *inode = old_dentry->d_inode; in minix_link() local
101 if (inode->i_nlink >= minix_sb(inode->i_sb)->s_link_max) in minix_link()
104 inode->i_ctime = CURRENT_TIME_SEC; in minix_link()
105 inode_inc_link_count(inode); in minix_link()
106 atomic_inc(&inode->i_count); in minix_link()
107 return add_nondir(dentry, inode); in minix_link()
110 static int minix_mkdir(struct inode * dir, struct dentry *dentry, int mode) in minix_mkdir()
112 struct inode * inode; in minix_mkdir() local
120 inode = minix_new_inode(dir, &err); in minix_mkdir()
121 if (!inode) in minix_mkdir()
124 inode->i_mode = S_IFDIR | mode; in minix_mkdir()
126 inode->i_mode |= S_ISGID; in minix_mkdir()
127 minix_set_inode(inode, 0); in minix_mkdir()
129 inode_inc_link_count(inode); in minix_mkdir()
131 err = minix_make_empty(inode, dir); in minix_mkdir()
135 err = minix_add_link(dentry, inode); in minix_mkdir()
139 d_instantiate(dentry, inode); in minix_mkdir()
144 inode_dec_link_count(inode); in minix_mkdir()
145 inode_dec_link_count(inode); in minix_mkdir()
146 iput(inode); in minix_mkdir()
152 static int minix_unlink(struct inode * dir, struct dentry *dentry) in minix_unlink()
155 struct inode * inode = dentry->d_inode; in minix_unlink() local
167 inode->i_ctime = dir->i_ctime; in minix_unlink()
168 inode_dec_link_count(inode); in minix_unlink()
173 static int minix_rmdir(struct inode * dir, struct dentry *dentry) in minix_rmdir()
175 struct inode * inode = dentry->d_inode; in minix_rmdir() local
178 if (minix_empty_dir(inode)) { in minix_rmdir()
182 inode_dec_link_count(inode); in minix_rmdir()
188 static int minix_rename(struct inode * old_dir, struct dentry *old_dentry, in minix_rename()
189 struct inode * new_dir, struct dentry *new_dentry) in minix_rename()
192 struct inode * old_inode = old_dentry->d_inode; in minix_rename()
193 struct inode * new_inode = new_dentry->d_inode; in minix_rename()