Lines Matching refs:inode
39 /* inode operations for directories */
41 static struct dentry *coda_lookup(struct inode *dir, struct dentry *entry, unsigned int flags)
46 struct inode *inode;
55 /* control object, create inode on the fly */
57 inode = coda_cnode_makectl(sb);
63 inode = !error ? coda_cnode_make(&fid, sb) : ERR_PTR(error);
66 if (!IS_ERR(inode) && (type & CODA_NOCACHE))
67 coda_flag_inode(inode, C_VATTR | C_PURGE);
69 if (inode == ERR_PTR(-ENOENT))
70 inode = NULL;
72 return d_splice_alias(inode, entry);
76 int coda_permission(struct mnt_idmap *idmap, struct inode *inode,
89 if ((mask & MAY_EXEC) && !execute_ok(inode))
92 if (coda_cache_check(inode, mask))
95 error = venus_access(inode->i_sb, coda_i2f(inode), mask);
98 coda_cache_enter(inode, mask);
104 static inline void coda_dir_update_mtime(struct inode *dir)
108 * attributes from venus next time the inode is referenced */
123 static inline void coda_dir_inc_nlink(struct inode *dir)
129 static inline void coda_dir_drop_nlink(struct inode *dir)
136 static int coda_create(struct mnt_idmap *idmap, struct inode *dir,
142 struct inode *inode;
154 inode = coda_iget(dir->i_sb, &newfid, &attrs);
155 if (IS_ERR(inode)) {
156 error = PTR_ERR(inode);
162 d_instantiate(de, inode);
169 static int coda_mkdir(struct mnt_idmap *idmap, struct inode *dir,
172 struct inode *inode;
188 inode = coda_iget(dir->i_sb, &newfid, &attrs);
189 if (IS_ERR(inode)) {
190 error = PTR_ERR(inode);
197 d_instantiate(de, inode);
205 static int coda_link(struct dentry *source_de, struct inode *dir_inode,
208 struct inode *inode = d_inode(source_de);
216 error = venus_link(dir_inode->i_sb, coda_i2f(inode),
224 ihold(inode);
225 d_instantiate(de, inode);
226 inc_nlink(inode);
232 struct inode *dir_inode, struct dentry *de,
249 * an inode for the entry we have to drop it.
263 static int coda_unlink(struct inode *dir, struct dentry *de)
278 static int coda_rmdir(struct inode *dir, struct dentry *de)
298 static int coda_rename(struct mnt_idmap *idmap, struct inode *old_dir,
299 struct dentry *old_dentry, struct inode *new_dir,
433 struct inode *host_inode = file_inode(host_file);
450 struct inode *inode;
456 inode = d_inode(de);
457 if (!inode || is_root_inode(inode))
459 if (is_bad_inode(inode))
470 coda_flag_inode_children(inode, C_FLUSH);
492 struct inode *inode;
498 inode = d_inode(dentry);
499 if (!inode || is_bad_inode(inode))
502 cii = ITOC(inode);
512 * This is called when we want to check if the inode has
517 int coda_revalidate_inode(struct inode *inode)
523 struct coda_inode_info *cii = ITOC(inode);
529 error = venus_getattr(inode->i_sb, &(cii->c_fid), &attr);
533 /* this inode may be lost if:
538 old_mode = inode->i_mode;
539 old_ino = inode->i_ino;
540 coda_vattr_to_iattr(inode, &attr);
542 if ((old_mode & S_IFMT) != (inode->i_mode & S_IFMT)) {
543 pr_warn("inode %ld, fid %s changed type!\n",
544 inode->i_ino, coda_f2s(&(cii->c_fid)));
548 with a global one, here we lose and declare the inode bad */
549 if (inode->i_ino != old_ino)
552 coda_flag_inode_children(inode, C_FLUSH);