Lines Matching refs:inode

10 static int add_nondir(struct dentry *dentry, struct inode *inode)
12 int err = minix_add_link(dentry, inode);
14 d_instantiate(dentry, inode);
17 inode_dec_link_count(inode);
18 iput(inode);
22 static struct dentry *minix_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags)
24 struct inode * inode = NULL;
32 inode = minix_iget(dir->i_sb, ino);
33 return d_splice_alias(inode, dentry);
36 static int minix_mknod(struct mnt_idmap *idmap, struct inode *dir,
39 struct inode *inode;
44 inode = minix_new_inode(dir, mode);
45 if (IS_ERR(inode))
46 return PTR_ERR(inode);
48 minix_set_inode(inode, rdev);
49 mark_inode_dirty(inode);
50 return add_nondir(dentry, inode);
53 static int minix_tmpfile(struct mnt_idmap *idmap, struct inode *dir,
56 struct inode *inode = minix_new_inode(dir, mode);
58 if (IS_ERR(inode))
59 return finish_open_simple(file, PTR_ERR(inode));
60 minix_set_inode(inode, 0);
61 mark_inode_dirty(inode);
62 d_tmpfile(file, inode);
66 static int minix_create(struct mnt_idmap *idmap, struct inode *dir,
72 static int minix_symlink(struct mnt_idmap *idmap, struct inode *dir,
76 struct inode * inode;
82 inode = minix_new_inode(dir, S_IFLNK | 0777);
83 if (IS_ERR(inode))
84 return PTR_ERR(inode);
86 minix_set_inode(inode, 0);
87 err = page_symlink(inode, symname, i);
89 inode_dec_link_count(inode);
90 iput(inode);
93 return add_nondir(dentry, inode);
96 static int minix_link(struct dentry * old_dentry, struct inode * dir,
99 struct inode *inode = d_inode(old_dentry);
101 inode_set_ctime_current(inode);
102 inode_inc_link_count(inode);
103 ihold(inode);
104 return add_nondir(dentry, inode);
107 static int minix_mkdir(struct mnt_idmap *idmap, struct inode *dir,
110 struct inode * inode;
113 inode = minix_new_inode(dir, S_IFDIR | mode);
114 if (IS_ERR(inode))
115 return PTR_ERR(inode);
118 minix_set_inode(inode, 0);
119 inode_inc_link_count(inode);
121 err = minix_make_empty(inode, dir);
125 err = minix_add_link(dentry, inode);
129 d_instantiate(dentry, inode);
134 inode_dec_link_count(inode);
135 inode_dec_link_count(inode);
136 iput(inode);
141 static int minix_unlink(struct inode * dir, struct dentry *dentry)
143 struct inode * inode = d_inode(dentry);
156 inode_set_ctime_to_ts(inode, inode_get_ctime(dir));
157 inode_dec_link_count(inode);
161 static int minix_rmdir(struct inode * dir, struct dentry *dentry)
163 struct inode * inode = d_inode(dentry);
166 if (minix_empty_dir(inode)) {
170 inode_dec_link_count(inode);
177 struct inode *old_dir, struct dentry *old_dentry,
178 struct inode *new_dir, struct dentry *new_dentry,
181 struct inode * old_inode = d_inode(old_dentry);
182 struct inode * new_inode = d_inode(new_dentry);