Lines Matching refs:inode
12 static int erofs_read_inode(struct inode *inode, void *data) in erofs_read_inode() argument
14 struct erofs_inode *vi = EROFS_I(inode); in erofs_read_inode()
19 struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb); in erofs_read_inode()
25 erofs_err(inode->i_sb, "unsupported datalayout %u of nid %llu", in erofs_read_inode()
38 inode->i_mode = le16_to_cpu(die->i_mode); in erofs_read_inode()
39 switch (inode->i_mode & S_IFMT) { in erofs_read_inode()
47 inode->i_rdev = in erofs_read_inode()
52 inode->i_rdev = 0; in erofs_read_inode()
57 i_uid_write(inode, le32_to_cpu(die->i_uid)); in erofs_read_inode()
58 i_gid_write(inode, le32_to_cpu(die->i_gid)); in erofs_read_inode()
59 set_nlink(inode, le32_to_cpu(die->i_nlink)); in erofs_read_inode()
62 inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = in erofs_read_inode()
64 inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = in erofs_read_inode()
67 inode->i_size = le64_to_cpu(die->i_size); in erofs_read_inode()
77 inode->i_mode = le16_to_cpu(dic->i_mode); in erofs_read_inode()
78 switch (inode->i_mode & S_IFMT) { in erofs_read_inode()
86 inode->i_rdev = in erofs_read_inode()
91 inode->i_rdev = 0; in erofs_read_inode()
96 i_uid_write(inode, le16_to_cpu(dic->i_uid)); in erofs_read_inode()
97 i_gid_write(inode, le16_to_cpu(dic->i_gid)); in erofs_read_inode()
98 set_nlink(inode, le16_to_cpu(dic->i_nlink)); in erofs_read_inode()
101 inode->i_mtime.tv_sec = inode->i_ctime.tv_sec = in erofs_read_inode()
103 inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = in erofs_read_inode()
106 inode->i_size = le32_to_cpu(dic->i_size); in erofs_read_inode()
111 erofs_err(inode->i_sb, in erofs_read_inode()
120 inode->i_blocks = roundup(inode->i_size, EROFS_BLKSIZ) >> 9; in erofs_read_inode()
122 inode->i_blocks = nblks << LOG_SECTORS_PER_BLOCK; in erofs_read_inode()
126 erofs_err(inode->i_sb, "bogus i_mode (%o) @ nid %llu", in erofs_read_inode()
127 inode->i_mode, vi->nid); in erofs_read_inode()
132 static int erofs_fill_symlink(struct inode *inode, void *data, in erofs_fill_symlink() argument
135 struct erofs_inode *vi = EROFS_I(inode); in erofs_fill_symlink()
140 inode->i_size >= PAGE_SIZE) { in erofs_fill_symlink()
141 inode->i_op = &erofs_symlink_iops; in erofs_fill_symlink()
145 lnk = kmalloc(inode->i_size + 1, GFP_KERNEL); in erofs_fill_symlink()
151 if (m_pofs + inode->i_size > PAGE_SIZE) { in erofs_fill_symlink()
153 erofs_err(inode->i_sb, in erofs_fill_symlink()
160 memcpy(lnk, data + m_pofs, inode->i_size); in erofs_fill_symlink()
161 lnk[inode->i_size] = '\0'; in erofs_fill_symlink()
163 inode->i_link = lnk; in erofs_fill_symlink()
164 inode->i_op = &erofs_fast_symlink_iops; in erofs_fill_symlink()
168 static int erofs_fill_inode(struct inode *inode, int isdir) in erofs_fill_inode() argument
170 struct super_block *sb = inode->i_sb; in erofs_fill_inode()
171 struct erofs_inode *vi = EROFS_I(inode); in erofs_fill_inode()
179 trace_erofs_fill_inode(inode, isdir); in erofs_fill_inode()
198 err = erofs_read_inode(inode, data + ofs); in erofs_fill_inode()
203 switch (inode->i_mode & S_IFMT) { in erofs_fill_inode()
205 inode->i_op = &erofs_generic_iops; in erofs_fill_inode()
206 inode->i_fop = &generic_ro_fops; in erofs_fill_inode()
209 inode->i_op = &erofs_dir_iops; in erofs_fill_inode()
210 inode->i_fop = &erofs_dir_fops; in erofs_fill_inode()
213 err = erofs_fill_symlink(inode, data, ofs); in erofs_fill_inode()
216 inode_nohighmem(inode); in erofs_fill_inode()
222 inode->i_op = &erofs_generic_iops; in erofs_fill_inode()
223 init_special_inode(inode, inode->i_mode, inode->i_rdev); in erofs_fill_inode()
231 err = z_erofs_fill_inode(inode); in erofs_fill_inode()
234 inode->i_mapping->a_ops = &erofs_raw_access_aops; in erofs_fill_inode()
246 static int erofs_ilookup_test_actor(struct inode *inode, void *opaque) in erofs_ilookup_test_actor() argument
250 return EROFS_I(inode)->nid == nid; in erofs_ilookup_test_actor()
253 static int erofs_iget_set_actor(struct inode *inode, void *opaque) in erofs_iget_set_actor() argument
257 inode->i_ino = erofs_inode_hash(nid); in erofs_iget_set_actor()
261 static inline struct inode *erofs_iget_locked(struct super_block *sb, in erofs_iget_locked()
270 struct inode *erofs_iget(struct super_block *sb, in erofs_iget()
274 struct inode *inode = erofs_iget_locked(sb, nid); in erofs_iget() local
276 if (!inode) in erofs_iget()
279 if (inode->i_state & I_NEW) { in erofs_iget()
281 struct erofs_inode *vi = EROFS_I(inode); in erofs_iget()
285 err = erofs_fill_inode(inode, isdir); in erofs_iget()
287 unlock_new_inode(inode); in erofs_iget()
289 iget_failed(inode); in erofs_iget()
290 inode = ERR_PTR(err); in erofs_iget()
293 return inode; in erofs_iget()
299 struct inode *const inode = d_inode(path->dentry); in erofs_getattr() local
301 if (erofs_inode_is_data_compressed(EROFS_I(inode)->datalayout)) in erofs_getattr()
308 generic_fillattr(inode, stat); in erofs_getattr()