Lines Matching refs:inode

26 static void coda_fill_inode(struct inode *inode, struct coda_vattr *attr)
28 coda_vattr_to_iattr(inode, attr);
30 if (S_ISREG(inode->i_mode)) {
31 inode->i_op = &coda_file_inode_operations;
32 inode->i_fop = &coda_file_operations;
33 } else if (S_ISDIR(inode->i_mode)) {
34 inode->i_op = &coda_dir_inode_operations;
35 inode->i_fop = &coda_dir_operations;
36 } else if (S_ISLNK(inode->i_mode)) {
37 inode->i_op = &coda_symlink_inode_operations;
38 inode_nohighmem(inode);
39 inode->i_data.a_ops = &coda_symlink_aops;
40 inode->i_mapping = &inode->i_data;
42 init_special_inode(inode, inode->i_mode, huge_decode_dev(attr->va_rdev));
45 static int coda_test_inode(struct inode *inode, void *data)
48 struct coda_inode_info *cii = ITOC(inode);
52 static int coda_set_inode(struct inode *inode, void *data)
55 struct coda_inode_info *cii = ITOC(inode);
60 struct inode * coda_iget(struct super_block * sb, struct CodaFid * fid,
63 struct inode *inode;
69 inode = iget5_locked(sb, hash, coda_test_inode, coda_set_inode, fid);
70 if (!inode)
73 if (inode->i_state & I_NEW) {
74 cii = ITOC(inode);
76 inode->i_ino = hash;
77 /* inode is locked and unique, no need to grab cii->c_lock */
79 coda_fill_inode(inode, attr);
80 unlock_new_inode(inode);
81 } else if ((inode->i_mode & S_IFMT) != inode_type) {
83 remove_inode_hash(inode);
84 coda_flag_inode(inode, C_PURGE);
85 iput(inode);
88 return inode;
93 - get the inode for the fid using vfs iget
97 struct inode *coda_cnode_make(struct CodaFid *fid, struct super_block *sb)
100 struct inode *inode;
103 /* We get inode numbers from Venus -- see venus source */
108 inode = coda_iget(sb, fid, &attr);
109 if (IS_ERR(inode))
111 return inode;
118 * first try to flush the cached inode from the kernel and finally
123 void coda_replace_fid(struct inode *inode, struct CodaFid *oldfid,
126 struct coda_inode_info *cii = ITOC(inode);
131 /* replace fid and rehash inode */
133 remove_inode_hash(inode);
135 inode->i_ino = hash;
136 __insert_inode_hash(inode, hash);
139 /* convert a fid to an inode. */
140 struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb)
142 struct inode *inode;
145 inode = ilookup5(sb, hash, coda_test_inode, fid);
146 if ( !inode )
151 BUG_ON(inode->i_state & I_NEW);
153 return inode;
166 /* the CONTROL inode is made without asking attributes from Venus */
167 struct inode *coda_cnode_makectl(struct super_block *sb)
169 struct inode *inode = new_inode(sb);
170 if (inode) {
171 inode->i_ino = CTL_INO;
172 inode->i_op = &coda_ioctl_inode_operations;
173 inode->i_fop = &coda_ioctl_operations;
174 inode->i_mode = 0444;
175 return inode;