Lines Matching refs:inode
18 struct inode *affs_iget(struct super_block *sb, unsigned long ino) in affs_iget()
23 struct inode *inode; in affs_iget() local
29 inode = iget_locked(sb, ino); in affs_iget()
30 if (!inode) in affs_iget()
32 if (!(inode->i_state & I_NEW)) in affs_iget()
33 return inode; in affs_iget()
35 pr_debug("affs_iget(%lu)\n", inode->i_ino); in affs_iget()
37 block = inode->i_ino; in affs_iget()
53 inode->i_size = 0; in affs_iget()
54 set_nlink(inode, 1); in affs_iget()
55 inode->i_mode = 0; in affs_iget()
56 AFFS_I(inode)->i_extcnt = 1; in affs_iget()
57 AFFS_I(inode)->i_ext_last = ~1; in affs_iget()
58 AFFS_I(inode)->i_protect = prot; in affs_iget()
59 atomic_set(&AFFS_I(inode)->i_opencnt, 0); in affs_iget()
60 AFFS_I(inode)->i_blkcnt = 0; in affs_iget()
61 AFFS_I(inode)->i_lc = NULL; in affs_iget()
62 AFFS_I(inode)->i_lc_size = 0; in affs_iget()
63 AFFS_I(inode)->i_lc_shift = 0; in affs_iget()
64 AFFS_I(inode)->i_lc_mask = 0; in affs_iget()
65 AFFS_I(inode)->i_ac = NULL; in affs_iget()
66 AFFS_I(inode)->i_ext_bh = NULL; in affs_iget()
67 AFFS_I(inode)->mmu_private = 0; in affs_iget()
68 AFFS_I(inode)->i_lastalloc = 0; in affs_iget()
69 AFFS_I(inode)->i_pa_cnt = 0; in affs_iget()
72 inode->i_mode = sbi->s_mode; in affs_iget()
74 inode->i_mode = affs_prot_to_mode(prot); in affs_iget()
78 inode->i_uid = sbi->s_uid; in affs_iget()
80 i_uid_write(inode, 0); in affs_iget()
82 i_uid_write(inode, id); in affs_iget()
86 inode->i_gid = sbi->s_gid; in affs_iget()
88 i_gid_write(inode, 0); in affs_iget()
90 i_gid_write(inode, id); in affs_iget()
94 inode->i_uid = sbi->s_uid; in affs_iget()
95 inode->i_gid = sbi->s_gid; in affs_iget()
100 if (inode->i_mode & S_IRUSR) in affs_iget()
101 inode->i_mode |= S_IXUSR; in affs_iget()
102 if (inode->i_mode & S_IRGRP) in affs_iget()
103 inode->i_mode |= S_IXGRP; in affs_iget()
104 if (inode->i_mode & S_IROTH) in affs_iget()
105 inode->i_mode |= S_IXOTH; in affs_iget()
106 inode->i_mode |= S_IFDIR; in affs_iget()
108 inode->i_mode = S_IRUGO | S_IXUGO | S_IWUSR | S_IFDIR; in affs_iget()
111 inode->i_op = &affs_dir_inode_operations; in affs_iget()
112 inode->i_fop = &affs_dir_operations; in affs_iget()
119 inode->i_mode |= S_IFDIR; in affs_iget()
128 inode->i_mode |= S_IFREG; in affs_iget()
129 AFFS_I(inode)->mmu_private = inode->i_size = size; in affs_iget()
130 if (inode->i_size) { in affs_iget()
131 AFFS_I(inode)->i_blkcnt = (size - 1) / in affs_iget()
133 AFFS_I(inode)->i_extcnt = (AFFS_I(inode)->i_blkcnt - 1) / in affs_iget()
137 set_nlink(inode, 2); in affs_iget()
138 inode->i_mapping->a_ops = affs_test_opt(sbi->s_flags, SF_OFS) ? in affs_iget()
140 inode->i_op = &affs_file_inode_operations; in affs_iget()
141 inode->i_fop = &affs_file_operations; in affs_iget()
144 inode->i_size = strlen((char *)AFFS_HEAD(bh)->table); in affs_iget()
145 inode->i_mode |= S_IFLNK; in affs_iget()
146 inode_nohighmem(inode); in affs_iget()
147 inode->i_op = &affs_symlink_inode_operations; in affs_iget()
148 inode->i_data.a_ops = &affs_symlink_aops; in affs_iget()
152 inode->i_mtime.tv_sec = inode->i_atime.tv_sec = in affs_iget()
153 inode_set_ctime(inode, in affs_iget()
158 inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = 0; in affs_iget()
160 unlock_new_inode(inode); in affs_iget()
161 return inode; in affs_iget()
165 iget_failed(inode); in affs_iget()
170 affs_write_inode(struct inode *inode, struct writeback_control *wbc) in affs_write_inode() argument
172 struct super_block *sb = inode->i_sb; in affs_write_inode()
178 pr_debug("write_inode(%lu)\n", inode->i_ino); in affs_write_inode()
180 if (!inode->i_nlink) in affs_write_inode()
183 bh = affs_bread(sb, inode->i_ino); in affs_write_inode()
185 affs_error(sb,"write_inode","Cannot read block %lu",inode->i_ino); in affs_write_inode()
190 affs_secs_to_datestamp(inode->i_mtime.tv_sec, in affs_write_inode()
193 tail->protect = cpu_to_be32(AFFS_I(inode)->i_protect); in affs_write_inode()
194 tail->size = cpu_to_be32(inode->i_size); in affs_write_inode()
195 affs_secs_to_datestamp(inode->i_mtime.tv_sec, &tail->change); in affs_write_inode()
196 if (!(inode->i_ino == AFFS_SB(sb)->s_root_block)) { in affs_write_inode()
197 uid = i_uid_read(inode); in affs_write_inode()
198 gid = i_gid_read(inode); in affs_write_inode()
212 mark_buffer_dirty_inode(bh, inode); in affs_write_inode()
214 affs_free_prealloc(inode); in affs_write_inode()
222 struct inode *inode = d_inode(dentry); in affs_notify_change() local
225 pr_debug("notify_change(%lu,0x%x)\n", inode->i_ino, attr->ia_valid); in affs_notify_change()
232 affs_test_opt(AFFS_SB(inode->i_sb)->s_flags, SF_SETUID)) || in affs_notify_change()
234 affs_test_opt(AFFS_SB(inode->i_sb)->s_flags, SF_SETGID)) || in affs_notify_change()
236 (AFFS_SB(inode->i_sb)->s_flags & in affs_notify_change()
238 if (!affs_test_opt(AFFS_SB(inode->i_sb)->s_flags, SF_QUIET)) in affs_notify_change()
244 attr->ia_size != i_size_read(inode)) { in affs_notify_change()
245 error = inode_newsize_ok(inode, attr->ia_size); in affs_notify_change()
249 truncate_setsize(inode, attr->ia_size); in affs_notify_change()
250 affs_truncate(inode); in affs_notify_change()
253 setattr_copy(&nop_mnt_idmap, inode, attr); in affs_notify_change()
254 mark_inode_dirty(inode); in affs_notify_change()
257 affs_mode_to_prot(inode); in affs_notify_change()
263 affs_evict_inode(struct inode *inode) in affs_evict_inode() argument
267 inode->i_ino, inode->i_nlink); in affs_evict_inode()
268 truncate_inode_pages_final(&inode->i_data); in affs_evict_inode()
270 if (!inode->i_nlink) { in affs_evict_inode()
271 inode->i_size = 0; in affs_evict_inode()
272 affs_truncate(inode); in affs_evict_inode()
275 invalidate_inode_buffers(inode); in affs_evict_inode()
276 clear_inode(inode); in affs_evict_inode()
277 affs_free_prealloc(inode); in affs_evict_inode()
278 cache_page = (unsigned long)AFFS_I(inode)->i_lc; in affs_evict_inode()
281 AFFS_I(inode)->i_lc = NULL; in affs_evict_inode()
282 AFFS_I(inode)->i_ac = NULL; in affs_evict_inode()
285 affs_brelse(AFFS_I(inode)->i_ext_bh); in affs_evict_inode()
286 AFFS_I(inode)->i_ext_last = ~1; in affs_evict_inode()
287 AFFS_I(inode)->i_ext_bh = NULL; in affs_evict_inode()
289 if (!inode->i_nlink) in affs_evict_inode()
290 affs_free_block(inode->i_sb, inode->i_ino); in affs_evict_inode()
293 struct inode *
294 affs_new_inode(struct inode *dir) in affs_new_inode()
297 struct inode *inode; in affs_new_inode() local
301 if (!(inode = new_inode(sb))) in affs_new_inode()
310 mark_buffer_dirty_inode(bh, inode); in affs_new_inode()
313 inode->i_uid = current_fsuid(); in affs_new_inode()
314 inode->i_gid = current_fsgid(); in affs_new_inode()
315 inode->i_ino = block; in affs_new_inode()
316 set_nlink(inode, 1); in affs_new_inode()
317 inode->i_mtime = inode->i_atime = inode_set_ctime_current(inode); in affs_new_inode()
318 atomic_set(&AFFS_I(inode)->i_opencnt, 0); in affs_new_inode()
319 AFFS_I(inode)->i_blkcnt = 0; in affs_new_inode()
320 AFFS_I(inode)->i_lc = NULL; in affs_new_inode()
321 AFFS_I(inode)->i_lc_size = 0; in affs_new_inode()
322 AFFS_I(inode)->i_lc_shift = 0; in affs_new_inode()
323 AFFS_I(inode)->i_lc_mask = 0; in affs_new_inode()
324 AFFS_I(inode)->i_ac = NULL; in affs_new_inode()
325 AFFS_I(inode)->i_ext_bh = NULL; in affs_new_inode()
326 AFFS_I(inode)->mmu_private = 0; in affs_new_inode()
327 AFFS_I(inode)->i_protect = 0; in affs_new_inode()
328 AFFS_I(inode)->i_lastalloc = 0; in affs_new_inode()
329 AFFS_I(inode)->i_pa_cnt = 0; in affs_new_inode()
330 AFFS_I(inode)->i_extcnt = 1; in affs_new_inode()
331 AFFS_I(inode)->i_ext_last = ~1; in affs_new_inode()
333 insert_inode_hash(inode); in affs_new_inode()
335 return inode; in affs_new_inode()
340 iput(inode); in affs_new_inode()
351 affs_add_entry(struct inode *dir, struct inode *inode, struct dentry *dentry, s32 type) in affs_add_entry() argument
360 dir->i_ino, inode->i_ino, dentry, type); in affs_add_entry()
363 bh = affs_bread(sb, inode->i_ino); in affs_add_entry()
367 affs_lock_link(inode); in affs_add_entry()
394 AFFS_TAIL(sb, bh)->original = cpu_to_be32(inode->i_ino); in affs_add_entry()
398 mark_buffer_dirty_inode(inode_bh, inode); in affs_add_entry()
399 set_nlink(inode, 2); in affs_add_entry()
400 ihold(inode); in affs_add_entry()
403 mark_buffer_dirty_inode(bh, inode); in affs_add_entry()
408 mark_buffer_dirty_inode(bh, inode); in affs_add_entry()
410 affs_unlock_link(inode); in affs_add_entry()
412 d_instantiate(dentry, inode); in affs_add_entry()
420 affs_unlock_link(inode); in affs_add_entry()