• Home
  • Raw
  • Download

Lines Matching refs:inode

37 	struct inode *inode = mapping->host;  in hfsplus_write_failed()  local
39 if (to > inode->i_size) { in hfsplus_write_failed()
40 truncate_pagecache(inode, inode->i_size); in hfsplus_write_failed()
41 hfsplus_file_truncate(inode); in hfsplus_write_failed()
68 struct inode *inode = page->mapping->host; in hfsplus_releasepage() local
69 struct super_block *sb = inode->i_sb; in hfsplus_releasepage()
75 switch (inode->i_ino) { in hfsplus_releasepage()
130 struct inode *inode = mapping->host; in hfsplus_direct_IO() local
134 ret = blockdev_direct_IO(iocb, inode, iter, hfsplus_get_block); in hfsplus_direct_IO()
141 loff_t isize = i_size_read(inode); in hfsplus_direct_IO()
181 static void hfsplus_get_perms(struct inode *inode, in hfsplus_get_perms() argument
184 struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb); in hfsplus_get_perms()
189 i_uid_write(inode, be32_to_cpu(perms->owner)); in hfsplus_get_perms()
190 if (!i_uid_read(inode) && !mode) in hfsplus_get_perms()
191 inode->i_uid = sbi->uid; in hfsplus_get_perms()
193 i_gid_write(inode, be32_to_cpu(perms->group)); in hfsplus_get_perms()
194 if (!i_gid_read(inode) && !mode) in hfsplus_get_perms()
195 inode->i_gid = sbi->gid; in hfsplus_get_perms()
202 inode->i_mode = mode; in hfsplus_get_perms()
204 HFSPLUS_I(inode)->userflags = perms->userflags; in hfsplus_get_perms()
206 inode->i_flags |= S_IMMUTABLE; in hfsplus_get_perms()
208 inode->i_flags &= ~S_IMMUTABLE; in hfsplus_get_perms()
210 inode->i_flags |= S_APPEND; in hfsplus_get_perms()
212 inode->i_flags &= ~S_APPEND; in hfsplus_get_perms()
215 static int hfsplus_file_open(struct inode *inode, struct file *file) in hfsplus_file_open() argument
217 if (HFSPLUS_IS_RSRC(inode)) in hfsplus_file_open()
218 inode = HFSPLUS_I(inode)->rsrc_inode; in hfsplus_file_open()
219 if (!(file->f_flags & O_LARGEFILE) && i_size_read(inode) > MAX_NON_LFS) in hfsplus_file_open()
221 atomic_inc(&HFSPLUS_I(inode)->opencnt); in hfsplus_file_open()
225 static int hfsplus_file_release(struct inode *inode, struct file *file) in hfsplus_file_release() argument
227 struct super_block *sb = inode->i_sb; in hfsplus_file_release()
229 if (HFSPLUS_IS_RSRC(inode)) in hfsplus_file_release()
230 inode = HFSPLUS_I(inode)->rsrc_inode; in hfsplus_file_release()
231 if (atomic_dec_and_test(&HFSPLUS_I(inode)->opencnt)) { in hfsplus_file_release()
232 inode_lock(inode); in hfsplus_file_release()
233 hfsplus_file_truncate(inode); in hfsplus_file_release()
234 if (inode->i_flags & S_DEAD) { in hfsplus_file_release()
235 hfsplus_delete_cat(inode->i_ino, in hfsplus_file_release()
237 hfsplus_delete_inode(inode); in hfsplus_file_release()
239 inode_unlock(inode); in hfsplus_file_release()
246 struct inode *inode = d_inode(dentry); in hfsplus_setattr() local
254 attr->ia_size != i_size_read(inode)) { in hfsplus_setattr()
255 inode_dio_wait(inode); in hfsplus_setattr()
256 if (attr->ia_size > inode->i_size) { in hfsplus_setattr()
257 error = generic_cont_expand_simple(inode, in hfsplus_setattr()
262 truncate_setsize(inode, attr->ia_size); in hfsplus_setattr()
263 hfsplus_file_truncate(inode); in hfsplus_setattr()
264 inode->i_mtime = inode->i_ctime = current_time(inode); in hfsplus_setattr()
267 setattr_copy(inode, attr); in hfsplus_setattr()
268 mark_inode_dirty(inode); in hfsplus_setattr()
276 struct inode *inode = d_inode(path->dentry); in hfsplus_getattr() local
277 struct hfsplus_inode_info *hip = HFSPLUS_I(inode); in hfsplus_getattr()
279 if (inode->i_flags & S_APPEND) in hfsplus_getattr()
281 if (inode->i_flags & S_IMMUTABLE) in hfsplus_getattr()
289 generic_fillattr(inode, stat); in hfsplus_getattr()
296 struct inode *inode = file->f_mapping->host; in hfsplus_file_fsync() local
297 struct hfsplus_inode_info *hip = HFSPLUS_I(inode); in hfsplus_file_fsync()
298 struct hfsplus_sb_info *sbi = HFSPLUS_SB(inode->i_sb); in hfsplus_file_fsync()
304 inode_lock(inode); in hfsplus_file_fsync()
309 sync_inode_metadata(inode, 1); in hfsplus_file_fsync()
315 error = filemap_write_and_wait(sbi->cat_tree->inode->i_mapping); in hfsplus_file_fsync()
319 filemap_write_and_wait(sbi->ext_tree->inode->i_mapping); in hfsplus_file_fsync()
328 sbi->attr_tree->inode->i_mapping); in hfsplus_file_fsync()
343 blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL); in hfsplus_file_fsync()
345 inode_unlock(inode); in hfsplus_file_fsync()
368 struct inode *hfsplus_new_inode(struct super_block *sb, struct inode *dir, in hfsplus_new_inode()
372 struct inode *inode = new_inode(sb); in hfsplus_new_inode() local
375 if (!inode) in hfsplus_new_inode()
378 inode->i_ino = sbi->next_cnid++; in hfsplus_new_inode()
379 inode_init_owner(inode, dir, mode); in hfsplus_new_inode()
380 set_nlink(inode, 1); in hfsplus_new_inode()
381 inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); in hfsplus_new_inode()
383 hip = HFSPLUS_I(inode); in hfsplus_new_inode()
401 if (S_ISDIR(inode->i_mode)) { in hfsplus_new_inode()
402 inode->i_size = 2; in hfsplus_new_inode()
404 inode->i_op = &hfsplus_dir_inode_operations; in hfsplus_new_inode()
405 inode->i_fop = &hfsplus_dir_operations; in hfsplus_new_inode()
406 } else if (S_ISREG(inode->i_mode)) { in hfsplus_new_inode()
408 inode->i_op = &hfsplus_file_inode_operations; in hfsplus_new_inode()
409 inode->i_fop = &hfsplus_file_operations; in hfsplus_new_inode()
410 inode->i_mapping->a_ops = &hfsplus_aops; in hfsplus_new_inode()
412 } else if (S_ISLNK(inode->i_mode)) { in hfsplus_new_inode()
414 inode->i_op = &page_symlink_inode_operations; in hfsplus_new_inode()
415 inode_nohighmem(inode); in hfsplus_new_inode()
416 inode->i_mapping->a_ops = &hfsplus_aops; in hfsplus_new_inode()
420 insert_inode_hash(inode); in hfsplus_new_inode()
421 mark_inode_dirty(inode); in hfsplus_new_inode()
424 return inode; in hfsplus_new_inode()
427 void hfsplus_delete_inode(struct inode *inode) in hfsplus_delete_inode() argument
429 struct super_block *sb = inode->i_sb; in hfsplus_delete_inode()
431 if (S_ISDIR(inode->i_mode)) { in hfsplus_delete_inode()
437 if (S_ISREG(inode->i_mode)) { in hfsplus_delete_inode()
438 if (!inode->i_nlink) { in hfsplus_delete_inode()
439 inode->i_size = 0; in hfsplus_delete_inode()
440 hfsplus_file_truncate(inode); in hfsplus_delete_inode()
442 } else if (S_ISLNK(inode->i_mode)) { in hfsplus_delete_inode()
443 inode->i_size = 0; in hfsplus_delete_inode()
444 hfsplus_file_truncate(inode); in hfsplus_delete_inode()
449 void hfsplus_inode_read_fork(struct inode *inode, struct hfsplus_fork_raw *fork) in hfsplus_inode_read_fork() argument
451 struct super_block *sb = inode->i_sb; in hfsplus_inode_read_fork()
453 struct hfsplus_inode_info *hip = HFSPLUS_I(inode); in hfsplus_inode_read_fork()
466 hip->phys_size = inode->i_size = be64_to_cpu(fork->total_size); in hfsplus_inode_read_fork()
468 (inode->i_size + sb->s_blocksize - 1) >> sb->s_blocksize_bits; in hfsplus_inode_read_fork()
469 inode_set_bytes(inode, hip->fs_blocks << sb->s_blocksize_bits); in hfsplus_inode_read_fork()
473 hip->clump_blocks = HFSPLUS_IS_RSRC(inode) ? in hfsplus_inode_read_fork()
479 void hfsplus_inode_write_fork(struct inode *inode, in hfsplus_inode_write_fork() argument
482 memcpy(&fork->extents, &HFSPLUS_I(inode)->first_extents, in hfsplus_inode_write_fork()
484 fork->total_size = cpu_to_be64(inode->i_size); in hfsplus_inode_write_fork()
485 fork->total_blocks = cpu_to_be32(HFSPLUS_I(inode)->alloc_blocks); in hfsplus_inode_write_fork()
488 int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) in hfsplus_cat_read_inode() argument
496 HFSPLUS_I(inode)->linkid = 0; in hfsplus_cat_read_inode()
504 hfsplus_get_perms(inode, &folder->permissions, 1); in hfsplus_cat_read_inode()
505 set_nlink(inode, 1); in hfsplus_cat_read_inode()
506 inode->i_size = 2 + be32_to_cpu(folder->valence); in hfsplus_cat_read_inode()
507 inode->i_atime = timespec_to_timespec64(hfsp_mt2ut(folder->access_date)); in hfsplus_cat_read_inode()
508 inode->i_mtime = timespec_to_timespec64(hfsp_mt2ut(folder->content_mod_date)); in hfsplus_cat_read_inode()
509 inode->i_ctime = timespec_to_timespec64(hfsp_mt2ut(folder->attribute_mod_date)); in hfsplus_cat_read_inode()
510 HFSPLUS_I(inode)->create_date = folder->create_date; in hfsplus_cat_read_inode()
511 HFSPLUS_I(inode)->fs_blocks = 0; in hfsplus_cat_read_inode()
513 HFSPLUS_I(inode)->subfolders = in hfsplus_cat_read_inode()
516 inode->i_op = &hfsplus_dir_inode_operations; in hfsplus_cat_read_inode()
517 inode->i_fop = &hfsplus_dir_operations; in hfsplus_cat_read_inode()
526 hfsplus_inode_read_fork(inode, HFSPLUS_IS_RSRC(inode) ? in hfsplus_cat_read_inode()
528 hfsplus_get_perms(inode, &file->permissions, 0); in hfsplus_cat_read_inode()
529 set_nlink(inode, 1); in hfsplus_cat_read_inode()
530 if (S_ISREG(inode->i_mode)) { in hfsplus_cat_read_inode()
532 set_nlink(inode, in hfsplus_cat_read_inode()
534 inode->i_op = &hfsplus_file_inode_operations; in hfsplus_cat_read_inode()
535 inode->i_fop = &hfsplus_file_operations; in hfsplus_cat_read_inode()
536 inode->i_mapping->a_ops = &hfsplus_aops; in hfsplus_cat_read_inode()
537 } else if (S_ISLNK(inode->i_mode)) { in hfsplus_cat_read_inode()
538 inode->i_op = &page_symlink_inode_operations; in hfsplus_cat_read_inode()
539 inode_nohighmem(inode); in hfsplus_cat_read_inode()
540 inode->i_mapping->a_ops = &hfsplus_aops; in hfsplus_cat_read_inode()
542 init_special_inode(inode, inode->i_mode, in hfsplus_cat_read_inode()
545 inode->i_atime = timespec_to_timespec64(hfsp_mt2ut(file->access_date)); in hfsplus_cat_read_inode()
546 inode->i_mtime = timespec_to_timespec64(hfsp_mt2ut(file->content_mod_date)); in hfsplus_cat_read_inode()
547 inode->i_ctime = timespec_to_timespec64(hfsp_mt2ut(file->attribute_mod_date)); in hfsplus_cat_read_inode()
548 HFSPLUS_I(inode)->create_date = file->create_date; in hfsplus_cat_read_inode()
556 int hfsplus_cat_write_inode(struct inode *inode) in hfsplus_cat_write_inode() argument
558 struct inode *main_inode = inode; in hfsplus_cat_write_inode()
562 if (HFSPLUS_IS_RSRC(inode)) in hfsplus_cat_write_inode()
563 main_inode = HFSPLUS_I(inode)->rsrc_inode; in hfsplus_cat_write_inode()
584 hfsplus_cat_set_perms(inode, &folder->permissions); in hfsplus_cat_write_inode()
585 folder->access_date = hfsp_ut2mt(inode->i_atime); in hfsplus_cat_write_inode()
586 folder->content_mod_date = hfsp_ut2mt(inode->i_mtime); in hfsplus_cat_write_inode()
587 folder->attribute_mod_date = hfsp_ut2mt(inode->i_ctime); in hfsplus_cat_write_inode()
588 folder->valence = cpu_to_be32(inode->i_size - 2); in hfsplus_cat_write_inode()
591 cpu_to_be32(HFSPLUS_I(inode)->subfolders); in hfsplus_cat_write_inode()
595 } else if (HFSPLUS_IS_RSRC(inode)) { in hfsplus_cat_write_inode()
599 hfsplus_inode_write_fork(inode, &file->rsrc_fork); in hfsplus_cat_write_inode()
609 hfsplus_inode_write_fork(inode, &file->data_fork); in hfsplus_cat_write_inode()
610 hfsplus_cat_set_perms(inode, &file->permissions); in hfsplus_cat_write_inode()
617 file->access_date = hfsp_ut2mt(inode->i_atime); in hfsplus_cat_write_inode()
618 file->content_mod_date = hfsp_ut2mt(inode->i_mtime); in hfsplus_cat_write_inode()
619 file->attribute_mod_date = hfsp_ut2mt(inode->i_ctime); in hfsplus_cat_write_inode()
624 set_bit(HFSPLUS_I_CAT_DIRTY, &HFSPLUS_I(inode)->flags); in hfsplus_cat_write_inode()