/linux/fs/xfs/ |
H A D | xfs_inode.c | 149 down_write_nested(&VFS_I(ip)->i_rwsem, in xfs_ilock() 152 down_read_nested(&VFS_I(ip)->i_rwsem, in xfs_ilock() 157 down_write_nested(&VFS_I(ip)->i_mapping->invalidate_lock, in xfs_ilock() 160 down_read_nested(&VFS_I(ip)->i_mapping->invalidate_lock, in xfs_ilock() 192 if (!down_write_trylock(&VFS_I(ip)->i_rwsem)) in xfs_ilock_nowait() 195 if (!down_read_trylock(&VFS_I(ip)->i_rwsem)) in xfs_ilock_nowait() 200 if (!down_write_trylock(&VFS_I(ip)->i_mapping->invalidate_lock)) in xfs_ilock_nowait() 203 if (!down_read_trylock(&VFS_I(ip)->i_mapping->invalidate_lock)) in xfs_ilock_nowait() 218 up_write(&VFS_I(ip)->i_mapping->invalidate_lock); in xfs_ilock_nowait() 220 up_read(&VFS_I(ip)->i_mapping->invalidate_lock); in xfs_ilock_nowait() [all …]
|
H A D | xfs_bmap_util.c | 312 error = filemap_write_and_wait(VFS_I(ip)->i_mapping); in xfs_getbmap() 517 if (!(VFS_I(ip)->i_state & I_FREEING)) in xfs_can_free_eofblocks() 521 if (!S_ISREG(VFS_I(ip)->i_mode)) in xfs_can_free_eofblocks() 528 if (VFS_I(ip)->i_size == 0 && in xfs_can_free_eofblocks() 529 VFS_I(ip)->i_mapping->nrpages == 0 && in xfs_can_free_eofblocks() 589 inode_dio_wait(VFS_I(ip)); in xfs_free_eofblocks() 820 struct inode *inode = VFS_I(ip); in xfs_flush_unmap_range() 911 error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, in xfs_free_file_space() 1152 (!uid_eq(VFS_I(ip)->i_uid, VFS_I(tip)->i_uid) || in xfs_swap_extents_check_format() 1153 !gid_eq(VFS_I(ip)->i_gid, VFS_I(tip)->i_gid) || in xfs_swap_extents_check_format() [all …]
|
H A D | xfs_icache.c | 99 if (inode_init_always(mp->m_super, VFS_I(ip))) { in xfs_inode_alloc() 105 VFS_I(ip)->i_mode = 0; in xfs_inode_alloc() 106 mapping_set_folio_min_order(VFS_I(ip)->i_mapping, in xfs_inode_alloc() 144 switch (VFS_I(ip)->i_mode & S_IFMT) { in xfs_inode_free_callback() 177 call_rcu(&VFS_I(ip)->i_rcu, xfs_inode_free_callback); in __xfs_inode_free() 364 struct inode *inode = VFS_I(ip); in xfs_iget_recycle() 438 if (VFS_I(ip)->i_mode != 0) { in xfs_iget_check_free_state() 441 ip->i_ino, VFS_I(ip)->i_mode); in xfs_iget_check_free_state() 461 if (VFS_I(ip)->i_mode == 0) in xfs_iget_check_free_state() 519 struct inode *inode = VFS_I(ip); in xfs_iget_cache_hit() [all …]
|
H A D | xfs_inode.h | 176 static inline struct inode *VFS_I(struct xfs_inode *ip) in VFS_I() function 194 if (S_ISREG(VFS_I(ip)->i_mode)) in XFS_ISIZE() 195 return i_size_read(VFS_I(ip)); in XFS_ISIZE() 206 xfs_fsize_t i_size = i_size_read(VFS_I(ip)); in xfs_new_eof() 554 (xfs_has_grpid((pip)->i_mount) || (VFS_I(pip)->i_mode & S_ISGID)) 614 mapping_set_stable_writes(VFS_I(ip)->i_mapping); in xfs_update_stable_writes() 616 mapping_clear_stable_writes(VFS_I(ip)->i_mapping); in xfs_update_stable_writes() 630 unlock_new_inode(VFS_I(ip)); in xfs_finish_inode_setup()
|
H A D | xfs_health.c | 287 spin_lock(&VFS_I(ip)->i_lock); in xfs_inode_mark_sick() 288 VFS_I(ip)->i_state &= ~I_DONTCACHE; in xfs_inode_mark_sick() 289 spin_unlock(&VFS_I(ip)->i_lock); in xfs_inode_mark_sick() 311 spin_lock(&VFS_I(ip)->i_lock); in xfs_inode_mark_corrupt() 312 VFS_I(ip)->i_state &= ~I_DONTCACHE; in xfs_inode_mark_corrupt() 313 spin_unlock(&VFS_I(ip)->i_lock); in xfs_inode_mark_corrupt()
|
H A D | xfs_ioctl.c | 545 if (IS_DAX(VFS_I(ip)) && in xfs_ioctl_setattr_xflags() 573 if (rtflag != XFS_IS_REALTIME_INODE(ip) && S_ISREG(VFS_I(ip)->i_mode)) in xfs_ioctl_setattr_xflags() 588 struct inode *inode = VFS_I(ip); in xfs_ioctl_setattr_prepare_dax() 654 if (S_ISREG(VFS_I(ip)->i_mode) && xfs_inode_has_filedata(ip) && in xfs_ioctl_setattr_check_extsize() 680 VFS_I(ip)->i_mode, new_diflags); in xfs_ioctl_setattr_check_extsize() 705 VFS_I(ip)->i_mode, new_diflags, new_diflags2); in xfs_ioctl_setattr_check_cowextsize() 762 error = xfs_qm_vop_dqalloc(ip, VFS_I(ip)->i_uid, in xfs_fileattr_set() 763 VFS_I(ip)->i_gid, fa->fsx_projid, in xfs_fileattr_set() 799 if ((VFS_I(ip)->i_mode & (S_ISUID|S_ISGID)) && in xfs_fileattr_set() 800 !capable_wrt_inode_uidgid(idmap, VFS_I(ip), CAP_FSETID)) in xfs_fileattr_set() [all …]
|
H A D | xfs_iops.c | 232 inode = VFS_I(ip); in xfs_generic_create() 329 inode = VFS_I(cip); in xfs_vn_lookup() 367 return d_splice_alias(VFS_I(ip), dentry); in xfs_vn_ci_lookup() 372 dentry = d_add_ci(dentry, VFS_I(ip), &dname); in xfs_vn_ci_lookup() 450 inode = VFS_I(cip); in xfs_vn_symlink() 789 struct inode *inode = VFS_I(ip); in xfs_setattr_nonsize() 918 struct inode *inode = VFS_I(ip); in xfs_setattr_size() 1040 error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping, in xfs_setattr_size() 1348 if (!S_ISREG(VFS_I(ip)->i_mode)) in xfs_inode_supports_dax() 1381 struct inode *inode = VFS_I(ip); in xfs_diflags_to_iflags()
|
H A D | xfs_exchrange.c | 87 struct inode *inode2 = VFS_I(ip2); in xfs_exchrange_check_freshness() 301 temp = i_size_read(VFS_I(ip2)); in xfs_exchrange_mappings() 302 i_size_write(VFS_I(ip2), i_size_read(VFS_I(ip1))); in xfs_exchrange_mappings() 303 i_size_write(VFS_I(ip1), temp); in xfs_exchrange_mappings() 532 size1 = i_size_read(VFS_I(ip1)); in xfs_exchrange_check_rtalign() 533 size2 = i_size_read(VFS_I(ip2)); in xfs_exchrange_check_rtalign()
|
H A D | xfs_symlink.c | 194 i_size_write(VFS_I(du.ip), du.ip->i_disk_size); in xfs_symlink() 291 VFS_I(ip)->i_mode = (VFS_I(ip)->i_mode & ~S_IFMT) | S_IFREG; in xfs_inactive_symlink_rmt()
|
H A D | xfs_reflink.c | 1242 if (newlen <= i_size_read(VFS_I(dest)) && cowextsize == 0) in xfs_reflink_update_dest() 1252 if (newlen > i_size_read(VFS_I(dest))) { in xfs_reflink_update_dest() 1254 i_size_write(VFS_I(dest), newlen); in xfs_reflink_update_dest() 1504 if (newlen > i_size_read(VFS_I(ip))) { in xfs_reflink_remap_extent() 1506 i_size_write(VFS_I(ip), newlen); in xfs_reflink_remap_extent() 1613 loff_t isize = i_size_read(VFS_I(ip)); in xfs_reflink_zero_posteof() 1869 struct inode *inode = VFS_I(ip); in xfs_reflink_unshare()
|
H A D | xfs_trace.h | 130 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; 630 __entry->dev = VFS_I(ctx->dp)->i_sb->s_dev; 684 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1017 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1048 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1124 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1153 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1155 __entry->count = atomic_read(&VFS_I(ip)->i_count); 1181 __entry->dev = VFS_I(ip)->i_sb->s_dev; 1268 __entry->dev = VFS_I(dp)->i_sb->s_dev; [all …]
|
/linux/fs/xfs/libxfs/ |
H A D | xfs_inode_util.c | 50 if (S_ISDIR(VFS_I(ip)->i_mode)) { in xfs_flags2diflags() 59 } else if (S_ISREG(VFS_I(ip)->i_mode)) { in xfs_flags2diflags() 154 umode_t mode = VFS_I(ip)->i_mode; in xfs_inode_inherit_flags() 205 VFS_I(ip)->i_mode, ip->i_diflags); in xfs_inode_inherit_flags() 232 VFS_I(ip)->i_mode, ip->i_diflags, ip->i_diflags2); in xfs_inode_inherit_flags2() 272 struct inode *dir = pip ? VFS_I(pip) : NULL; in xfs_inode_init() 274 struct inode *inode = VFS_I(ip); in xfs_inode_init() 539 ASSERT(VFS_I(ip)->i_nlink == 0); in xfs_iunlink() 540 ASSERT(VFS_I(ip)->i_mode != 0); in xfs_iunlink() 660 struct inode *inode = VFS_I(ip); in xfs_droplink() [all …]
|
H A D | xfs_dir2.c | 206 ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); in xfs_dir_isempty() 246 ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); in xfs_dir_init() 335 ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); in xfs_dir_createname() 437 ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); in xfs_dir_lookup() 503 ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); in xfs_dir_removename() 560 ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); in xfs_dir_replace() 868 if (S_ISDIR(VFS_I(ip)->i_mode)) { in xfs_dir_create_child() 909 ASSERT(!S_ISDIR(VFS_I(ip)->i_mode)); in xfs_dir_add_child() 920 if (VFS_I(ip)->i_nlink == 0) { in xfs_dir_add_child() 976 if (S_ISDIR(VFS_I(ip)->i_mode)) { in xfs_dir_remove_child() [all …]
|
H A D | xfs_metafile.c | 53 VFS_I(ip)->i_mode &= ~0777; in xfs_metafile_set_iflag() 54 VFS_I(ip)->i_uid = GLOBAL_ROOT_UID; in xfs_metafile_set_iflag() 55 VFS_I(ip)->i_gid = GLOBAL_ROOT_GID; in xfs_metafile_set_iflag() 56 if (S_ISDIR(VFS_I(ip)->i_mode)) in xfs_metafile_set_iflag() 73 ASSERT(VFS_I(ip)->i_nlink == 0); in xfs_metafile_clear_iflag()
|
H A D | xfs_inode_fork.c | 52 zero_terminate = S_ISLNK(VFS_I(ip)->i_mode); in xfs_init_local_fork() 235 struct inode *inode = VFS_I(ip); in xfs_iformat_data_fork() 612 linux_to_xfs_dev_t(VFS_I(ip)->i_rdev)); in xfs_iflush_fork() 676 switch (VFS_I(ip)->i_mode & S_IFMT) { in xfs_ifork_verify_local_data()
|
H A D | xfs_metadir.c | 102 if (!S_ISDIR(VFS_I(dp)->i_mode)) { in xfs_metadir_lookup() 388 xfs_mode_to_ftype(VFS_I(upd->ip)->i_mode)); in xfs_metadir_link()
|
/linux/fs/xfs/scrub/ |
H A D | parent.c | 153 expected_nlink = VFS_I(sc->ip)->i_nlink == 0 ? 0 : 1; in xchk_parent_validate() 173 !S_ISDIR(VFS_I(dp)->i_mode)) { in xchk_parent_validate() 327 if (VFS_I(sc->ip)->i_nlink == 0) in xchk_parent_pptr_and_dotdot() 437 if (!S_ISDIR(VFS_I(ip)->i_mode)) { in xchk_parent_iget() 443 if (VFS_I(ip)->i_generation != be32_to_cpu(pptr->p_gen)) { in xchk_parent_iget() 727 if (S_ISDIR(VFS_I(sc->ip)->i_mode)) { in xchk_parent_count_pptrs() 731 if (VFS_I(sc->ip)->i_nlink == 0 && pp->pptrs_found > 0) in xchk_parent_count_pptrs() 733 else if (VFS_I(sc->ip)->i_nlink > 0 && in xchk_parent_count_pptrs() 745 if (VFS_I(sc->ip)->i_nlink != pp->pptrs_found) in xchk_parent_count_pptrs() 817 if (S_ISDIR(VFS_I(sc->ip)->i_mode)) { in xchk_parent_pptr() [all …]
|
H A D | tempfile.c | 108 VFS_I(sc->tempip)->i_flags |= S_PRIVATE; in xrep_tempfile_create() 109 VFS_I(sc->tempip)->i_opflags &= ~IOP_XATTR; in xrep_tempfile_create() 115 } else if (S_ISLNK(VFS_I(sc->tempip)->i_mode)) { in xrep_tempfile_create() 214 if (!S_ISDIR(VFS_I(sc->tempip)->i_mode) && in xrep_tempfile_adjust_directory_tree() 215 !S_ISREG(VFS_I(sc->tempip)->i_mode)) in xrep_tempfile_adjust_directory_tree() 495 ASSERT(S_ISREG(VFS_I(sc->tempip)->i_mode)); in xrep_tempfile_copyin() 575 i_size_write(VFS_I(sc->tempip), isize); in xrep_tempfile_set_isize() 900 temp = i_size_read(VFS_I(sc->ip)); in xrep_tempexch_contents() 901 i_size_write(VFS_I(sc->ip), i_size_read(VFS_I(sc->tempip))); in xrep_tempexch_contents() 902 i_size_write(VFS_I(sc->tempip), temp); in xrep_tempexch_contents() [all …]
|
H A D | nlinks_repair.c | 166 actual_nlink = VFS_I(ip)->i_nlink; in xrep_nlinks_repair_inode() 178 if (!S_ISDIR(VFS_I(ip)->i_mode) && obs.children != 0) { in xrep_nlinks_repair_inode() 215 actual_nlink = VFS_I(ip)->i_nlink; in xrep_nlinks_repair_inode() 245 set_nlink(VFS_I(ip), min_t(unsigned long long, total_links, in xrep_nlinks_repair_inode()
|
H A D | bmap.c | 53 if (S_ISREG(VFS_I(sc->ip)->i_mode) && in xchk_setup_inode_bmap() 55 struct address_space *mapping = VFS_I(sc->ip)->i_mapping; in xchk_setup_inode_bmap() 62 error = xfs_break_layouts(VFS_I(sc->ip), in xchk_setup_inode_bmap() 68 inode_dio_wait(VFS_I(sc->ip)); in xchk_setup_inode_bmap() 92 VFS_I(sc->ip)->i_mapping); in xchk_setup_inode_bmap() 459 if (!S_ISDIR(VFS_I(ip)->i_mode) && info->whichfork != XFS_ATTR_FORK) in xchk_bmap_dirattr_extent() 776 if ((VFS_I(ip)->i_mode & 0777) != 0) in xchk_bmap_check_empty_attrfork() 778 if (!uid_eq(VFS_I(ip)->i_uid, GLOBAL_ROOT_UID)) in xchk_bmap_check_empty_attrfork() 780 if (!gid_eq(VFS_I(ip)->i_gid, GLOBAL_ROOT_GID)) in xchk_bmap_check_empty_attrfork() 811 return i_size_read(VFS_I(ip)) != 0; in xchk_bmap_check_empty_datafork()
|
H A D | parent_repair.c | 445 if (name->type != xfs_mode_to_ftype(VFS_I(sc->ip)->i_mode)) in xrep_parent_scan_dirent() 492 if (S_ISDIR(VFS_I(ip)->i_mode) && xfs_need_iread_extents(&ip->i_df)) { in xrep_parent_scan_ilock() 519 if (S_ISDIR(VFS_I(ip)->i_mode)) { in xrep_parent_scan_file() 777 if (S_ISDIR(VFS_I(sc->ip)->i_mode)) { in xrep_parent_move_to_orphanage() 832 if (S_ISDIR(VFS_I(sc->ip)->i_mode)) in xrep_parent_move_to_orphanage() 844 if (orig_parent == new_parent && VFS_I(sc->ip)->i_nlink > 0) { in xrep_parent_move_to_orphanage() 1384 if (S_ISDIR(VFS_I(sc->ip)->i_mode)) in xrep_parent_rebuild_tree() 1478 if (VFS_I(ip)->i_nlink != rp->parents) { in xrep_parent_set_nondir_nlink() 1484 set_nlink(VFS_I(ip), min_t(unsigned long long, rp->parents, in xrep_parent_set_nondir_nlink() 1622 if (xfs_has_parent(sc->mp) && !S_ISDIR(VFS_I(sc->ip)->i_mode)) { in xrep_parent()
|
H A D | common.c | 1078 if (VFS_I(ip)->i_generation != sc->sm->sm_gen) { in xchk_install_handle_inode() 1097 if (!igrab(VFS_I(ip))) { in xchk_install_live_inode() 1251 spin_lock(&VFS_I(ip)->i_lock); in xchk_irele() 1252 VFS_I(ip)->i_state &= ~I_DONTCACHE; in xchk_irele() 1253 spin_unlock(&VFS_I(ip)->i_lock); in xchk_irele() 1579 ASSERT(VFS_I(ip)->i_mode != 0); in xchk_inode_is_allocated() 1595 ASSERT(VFS_I(ip)->i_mode != 0); in xchk_inode_is_allocated() 1605 ASSERT(VFS_I(ip)->i_mode != 0); in xchk_inode_is_allocated() 1641 *inuse = VFS_I(ip)->i_mode != 0; in xchk_inode_is_allocated()
|
H A D | dir_repair.c | 424 xname.type = xfs_mode_to_ftype(VFS_I(ip)->i_mode); in xrep_dir_salvage_entry() 698 ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); in xrep_dir_replay_createname() 722 ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); in xrep_dir_replay_removename() 1105 .type = xfs_mode_to_ftype(VFS_I(ip)->i_mode), in xrep_dir_scan_pptr() 1125 parent_gen != VFS_I(sc->ip)->i_generation) in xrep_dir_scan_pptr() 1202 if (S_ISDIR(VFS_I(ip)->i_mode) && xfs_need_iread_extents(&ip->i_df)) { in xrep_dir_scan_ilock() 1245 if (S_ISDIR(VFS_I(ip)->i_mode)) { in xrep_dir_scan_file() 1520 ASSERT(S_ISDIR(VFS_I(dp)->i_mode)); in xrep_dir_replace() 1587 if (VFS_I(dp)->i_nlink != new_nlink) in xrep_dir_set_nlink() 1588 set_nlink(VFS_I(dp), new_nlink); in xrep_dir_set_nlink() [all …]
|
H A D | inode_repair.c | 418 if (S_ISDIR(VFS_I(dp)->i_mode)) in xrep_dinode_find_mode() 1725 if (!uid_valid(VFS_I(sc->ip)->i_uid)) { in xrep_inode_ids() 1726 i_uid_write(VFS_I(sc->ip), 0); in xrep_inode_ids() 1732 if (!gid_valid(VFS_I(sc->ip)->i_gid)) { in xrep_inode_ids() 1733 i_gid_write(VFS_I(sc->ip), 0); in xrep_inode_ids() 1748 VFS_I(sc->ip)->i_mode &= ~(S_ISUID | S_ISGID); in xrep_inode_ids() 1757 *ts = timestamp_truncate(*ts, VFS_I(ip)); in xrep_clamp_timestamp() 1766 struct inode *inode = VFS_I(ip); in xrep_inode_timestamps() 1792 mode = VFS_I(sc->ip)->i_mode; in xrep_inode_flags() 1927 struct inode *inode = VFS_I(ip); in xrep_inode_pptr() [all …]
|
H A D | nlinks.c | 405 if (VFS_I(dp)->i_nlink == 0) in xchk_nlinks_collect_dir() 561 if (S_ISDIR(VFS_I(ip)->i_mode)) in xchk_nlinks_collect() 679 if (!xfs_has_ftype(sc->mp) && S_ISDIR(VFS_I(ip)->i_mode)) in xchk_nlinks_compare_inode() 683 actual_nlink = VFS_I(ip)->i_nlink; in xchk_nlinks_compare_inode() 705 if (S_ISDIR(VFS_I(ip)->i_mode) && actual_nlink > 0) { in xchk_nlinks_compare_inode()
|