Lines Matching refs:ip
88 struct xfs_inode *ip; in xfs_inode_alloc() local
94 ip = alloc_inode_sb(mp->m_super, xfs_inode_cache, GFP_KERNEL | __GFP_NOFAIL); in xfs_inode_alloc()
96 if (inode_init_always(mp->m_super, VFS_I(ip))) { in xfs_inode_alloc()
97 kmem_cache_free(xfs_inode_cache, ip); in xfs_inode_alloc()
102 VFS_I(ip)->i_mode = 0; in xfs_inode_alloc()
103 mapping_set_folio_min_order(VFS_I(ip)->i_mapping, in xfs_inode_alloc()
107 ASSERT(atomic_read(&ip->i_pincount) == 0); in xfs_inode_alloc()
108 ASSERT(ip->i_ino == 0); in xfs_inode_alloc()
111 ip->i_ino = ino; in xfs_inode_alloc()
112 ip->i_mount = mp; in xfs_inode_alloc()
113 memset(&ip->i_imap, 0, sizeof(struct xfs_imap)); in xfs_inode_alloc()
114 ip->i_cowfp = NULL; in xfs_inode_alloc()
115 memset(&ip->i_af, 0, sizeof(ip->i_af)); in xfs_inode_alloc()
116 ip->i_af.if_format = XFS_DINODE_FMT_EXTENTS; in xfs_inode_alloc()
117 memset(&ip->i_df, 0, sizeof(ip->i_df)); in xfs_inode_alloc()
118 ip->i_flags = 0; in xfs_inode_alloc()
119 ip->i_delayed_blks = 0; in xfs_inode_alloc()
120 ip->i_diflags2 = mp->m_ino_geo.new_diflags2; in xfs_inode_alloc()
121 ip->i_nblocks = 0; in xfs_inode_alloc()
122 ip->i_forkoff = 0; in xfs_inode_alloc()
123 ip->i_sick = 0; in xfs_inode_alloc()
124 ip->i_checked = 0; in xfs_inode_alloc()
125 INIT_WORK(&ip->i_ioend_work, xfs_end_io); in xfs_inode_alloc()
126 INIT_LIST_HEAD(&ip->i_ioend_list); in xfs_inode_alloc()
127 spin_lock_init(&ip->i_ioend_lock); in xfs_inode_alloc()
128 ip->i_next_unlinked = NULLAGINO; in xfs_inode_alloc()
129 ip->i_prev_unlinked = 0; in xfs_inode_alloc()
131 return ip; in xfs_inode_alloc()
139 struct xfs_inode *ip = XFS_I(inode); in xfs_inode_free_callback() local
141 switch (VFS_I(ip)->i_mode & S_IFMT) { in xfs_inode_free_callback()
145 xfs_idestroy_fork(&ip->i_df); in xfs_inode_free_callback()
149 xfs_ifork_zap_attr(ip); in xfs_inode_free_callback()
151 if (ip->i_cowfp) { in xfs_inode_free_callback()
152 xfs_idestroy_fork(ip->i_cowfp); in xfs_inode_free_callback()
153 kmem_cache_free(xfs_ifork_cache, ip->i_cowfp); in xfs_inode_free_callback()
155 if (ip->i_itemp) { in xfs_inode_free_callback()
157 &ip->i_itemp->ili_item.li_flags)); in xfs_inode_free_callback()
158 xfs_inode_item_destroy(ip); in xfs_inode_free_callback()
159 ip->i_itemp = NULL; in xfs_inode_free_callback()
162 kmem_cache_free(xfs_inode_cache, ip); in xfs_inode_free_callback()
167 struct xfs_inode *ip) in __xfs_inode_free() argument
170 ASSERT(atomic_read(&ip->i_pincount) == 0); in __xfs_inode_free()
171 ASSERT(!ip->i_itemp || list_empty(&ip->i_itemp->ili_item.li_bio_list)); in __xfs_inode_free()
172 XFS_STATS_DEC(ip->i_mount, vn_active); in __xfs_inode_free()
174 call_rcu(&VFS_I(ip)->i_rcu, xfs_inode_free_callback); in __xfs_inode_free()
179 struct xfs_inode *ip) in xfs_inode_free() argument
181 ASSERT(!xfs_iflags_test(ip, XFS_IFLUSHING)); in xfs_inode_free()
189 spin_lock(&ip->i_flags_lock); in xfs_inode_free()
190 ip->i_flags = XFS_IRECLAIM; in xfs_inode_free()
191 ip->i_ino = 0; in xfs_inode_free()
192 spin_unlock(&ip->i_flags_lock); in xfs_inode_free()
194 __xfs_inode_free(ip); in xfs_inode_free()
376 struct xfs_inode *ip) __releases(&ip->i_flags_lock) in xfs_iget_recycle() argument
378 struct xfs_mount *mp = ip->i_mount; in xfs_iget_recycle()
379 struct inode *inode = VFS_I(ip); in xfs_iget_recycle()
382 trace_xfs_iget_recycle(ip); in xfs_iget_recycle()
384 if (!xfs_ilock_nowait(ip, XFS_ILOCK_EXCL)) in xfs_iget_recycle()
393 ip->i_flags |= XFS_IRECLAIM; in xfs_iget_recycle()
395 spin_unlock(&ip->i_flags_lock); in xfs_iget_recycle()
400 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_iget_recycle()
407 spin_lock(&ip->i_flags_lock); in xfs_iget_recycle()
408 ip->i_flags &= ~(XFS_INEW | XFS_IRECLAIM); in xfs_iget_recycle()
409 ASSERT(ip->i_flags & XFS_IRECLAIMABLE); in xfs_iget_recycle()
410 spin_unlock(&ip->i_flags_lock); in xfs_iget_recycle()
413 trace_xfs_iget_recycle_fail(ip); in xfs_iget_recycle()
418 spin_lock(&ip->i_flags_lock); in xfs_iget_recycle()
425 ip->i_flags &= ~XFS_IRECLAIM_RESET_FLAGS; in xfs_iget_recycle()
426 ip->i_flags |= XFS_INEW; in xfs_iget_recycle()
427 xfs_perag_clear_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino), in xfs_iget_recycle()
430 spin_unlock(&ip->i_flags_lock); in xfs_iget_recycle()
448 struct xfs_inode *ip, in xfs_iget_check_free_state() argument
453 if (VFS_I(ip)->i_mode != 0) { in xfs_iget_check_free_state()
454 xfs_warn(ip->i_mount, in xfs_iget_check_free_state()
456 ip->i_ino, VFS_I(ip)->i_mode); in xfs_iget_check_free_state()
457 xfs_agno_mark_sick(ip->i_mount, in xfs_iget_check_free_state()
458 XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino), in xfs_iget_check_free_state()
463 if (ip->i_nblocks != 0) { in xfs_iget_check_free_state()
464 xfs_warn(ip->i_mount, in xfs_iget_check_free_state()
466 ip->i_ino); in xfs_iget_check_free_state()
467 xfs_agno_mark_sick(ip->i_mount, in xfs_iget_check_free_state()
468 XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino), in xfs_iget_check_free_state()
476 if (VFS_I(ip)->i_mode == 0) in xfs_iget_check_free_state()
529 struct xfs_inode *ip, in xfs_iget_cache_hit() argument
534 struct inode *inode = VFS_I(ip); in xfs_iget_cache_hit()
535 struct xfs_mount *mp = ip->i_mount; in xfs_iget_cache_hit()
545 spin_lock(&ip->i_flags_lock); in xfs_iget_cache_hit()
546 if (ip->i_ino != ino) in xfs_iget_cache_hit()
567 if (ip->i_flags & (XFS_INEW | XFS_IRECLAIM | XFS_INACTIVATING)) in xfs_iget_cache_hit()
570 if (ip->i_flags & XFS_NEED_INACTIVE) { in xfs_iget_cache_hit()
572 if (VFS_I(ip)->i_nlink == 0) { in xfs_iget_cache_hit()
583 error = xfs_iget_check_free_state(ip, flags); in xfs_iget_cache_hit()
589 (ip->i_flags & XFS_IRECLAIMABLE)) in xfs_iget_cache_hit()
593 if (ip->i_flags & XFS_IRECLAIMABLE) { in xfs_iget_cache_hit()
595 error = xfs_iget_recycle(pag, ip); in xfs_iget_cache_hit()
606 spin_unlock(&ip->i_flags_lock); in xfs_iget_cache_hit()
608 trace_xfs_iget_hit(ip); in xfs_iget_cache_hit()
612 xfs_ilock(ip, lock_flags); in xfs_iget_cache_hit()
615 xfs_iflags_clear(ip, XFS_ISTALE); in xfs_iget_cache_hit()
621 trace_xfs_iget_skip(ip); in xfs_iget_cache_hit()
625 spin_unlock(&ip->i_flags_lock); in xfs_iget_cache_hit()
630 spin_unlock(&ip->i_flags_lock); in xfs_iget_cache_hit()
651 struct xfs_inode *ip; in xfs_iget_cache_miss() local
655 ip = xfs_inode_alloc(mp, ino); in xfs_iget_cache_miss()
656 if (!ip) in xfs_iget_cache_miss()
659 error = xfs_imap(pag, tp, ip->i_ino, &ip->i_imap, flags); in xfs_iget_cache_miss()
675 VFS_I(ip)->i_generation = get_random_u32(); in xfs_iget_cache_miss()
679 error = xfs_imap_to_bp(mp, tp, &ip->i_imap, &bp); in xfs_iget_cache_miss()
683 error = xfs_inode_from_disk(ip, in xfs_iget_cache_miss()
684 xfs_buf_offset(bp, ip->i_imap.im_boffset)); in xfs_iget_cache_miss()
688 xfs_inode_mark_sick(ip, XFS_SICK_INO_CORE); in xfs_iget_cache_miss()
695 trace_xfs_iget_miss(ip); in xfs_iget_cache_miss()
701 error = xfs_iget_check_free_state(ip, flags); in xfs_iget_cache_miss()
720 if (!xfs_ilock_nowait(ip, lock_flags)) in xfs_iget_cache_miss()
734 d_mark_dontcache(VFS_I(ip)); in xfs_iget_cache_miss()
735 ip->i_udquot = NULL; in xfs_iget_cache_miss()
736 ip->i_gdquot = NULL; in xfs_iget_cache_miss()
737 ip->i_pdquot = NULL; in xfs_iget_cache_miss()
738 xfs_iflags_set(ip, XFS_INEW); in xfs_iget_cache_miss()
742 error = radix_tree_insert(&pag->pag_ici_root, agino, ip); in xfs_iget_cache_miss()
752 *ipp = ip; in xfs_iget_cache_miss()
759 xfs_iunlock(ip, lock_flags); in xfs_iget_cache_miss()
761 __destroy_inode(VFS_I(ip)); in xfs_iget_cache_miss()
762 xfs_inode_free(ip); in xfs_iget_cache_miss()
787 struct xfs_inode *ip; in xfs_iget() local
807 ip = radix_tree_lookup(&pag->pag_ici_root, agino); in xfs_iget()
809 if (ip) { in xfs_iget()
810 error = xfs_iget_cache_hit(pag, ip, ino, flags, lock_flags); in xfs_iget()
821 error = xfs_iget_cache_miss(mp, pag, tp, ino, &ip, in xfs_iget()
828 *ipp = ip; in xfs_iget()
835 if (xfs_iflags_test(ip, XFS_INEW) && VFS_I(ip)->i_mode != 0) in xfs_iget()
836 xfs_setup_existing_inode(ip); in xfs_iget()
868 struct xfs_inode *ip, in xfs_reclaim_igrab() argument
873 spin_lock(&ip->i_flags_lock); in xfs_reclaim_igrab()
874 if (!__xfs_iflags_test(ip, XFS_IRECLAIMABLE) || in xfs_reclaim_igrab()
875 __xfs_iflags_test(ip, XFS_IRECLAIM)) { in xfs_reclaim_igrab()
877 spin_unlock(&ip->i_flags_lock); in xfs_reclaim_igrab()
882 if (ip->i_sick && in xfs_reclaim_igrab()
884 spin_unlock(&ip->i_flags_lock); in xfs_reclaim_igrab()
888 __xfs_iflags_set(ip, XFS_IRECLAIM); in xfs_reclaim_igrab()
889 spin_unlock(&ip->i_flags_lock); in xfs_reclaim_igrab()
907 struct xfs_inode *ip, in xfs_reclaim_inode() argument
910 xfs_ino_t ino = ip->i_ino; /* for radix_tree_delete */ in xfs_reclaim_inode()
912 if (!xfs_ilock_nowait(ip, XFS_ILOCK_EXCL)) in xfs_reclaim_inode()
914 if (xfs_iflags_test_and_set(ip, XFS_IFLUSHING)) in xfs_reclaim_inode()
924 if (xlog_is_shutdown(ip->i_mount->m_log)) { in xfs_reclaim_inode()
925 xfs_iunpin_wait(ip); in xfs_reclaim_inode()
926 xfs_iflush_shutdown_abort(ip); in xfs_reclaim_inode()
929 if (xfs_ipincount(ip)) in xfs_reclaim_inode()
931 if (!xfs_inode_clean(ip)) in xfs_reclaim_inode()
934 xfs_iflags_clear(ip, XFS_IFLUSHING); in xfs_reclaim_inode()
936 trace_xfs_inode_reclaiming(ip); in xfs_reclaim_inode()
948 spin_lock(&ip->i_flags_lock); in xfs_reclaim_inode()
949 ip->i_flags = XFS_IRECLAIM; in xfs_reclaim_inode()
950 ip->i_ino = 0; in xfs_reclaim_inode()
951 ip->i_sick = 0; in xfs_reclaim_inode()
952 ip->i_checked = 0; in xfs_reclaim_inode()
953 spin_unlock(&ip->i_flags_lock); in xfs_reclaim_inode()
955 ASSERT(!ip->i_itemp || ip->i_itemp->ili_item.li_buf == NULL); in xfs_reclaim_inode()
956 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_reclaim_inode()
958 XFS_STATS_INC(ip->i_mount, xs_ig_reclaims); in xfs_reclaim_inode()
968 XFS_INO_TO_AGINO(ip->i_mount, ino))) in xfs_reclaim_inode()
981 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_reclaim_inode()
982 ASSERT(!ip->i_udquot && !ip->i_gdquot && !ip->i_pdquot); in xfs_reclaim_inode()
983 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_reclaim_inode()
984 ASSERT(xfs_inode_clean(ip)); in xfs_reclaim_inode()
986 __xfs_inode_free(ip); in xfs_reclaim_inode()
990 xfs_iflags_clear(ip, XFS_IFLUSHING); in xfs_reclaim_inode()
992 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_reclaim_inode()
994 xfs_iflags_clear(ip, XFS_IRECLAIM); in xfs_reclaim_inode()
1075 struct xfs_inode *ip, in xfs_icwalk_match_id() argument
1079 !uid_eq(VFS_I(ip)->i_uid, icw->icw_uid)) in xfs_icwalk_match_id()
1083 !gid_eq(VFS_I(ip)->i_gid, icw->icw_gid)) in xfs_icwalk_match_id()
1087 ip->i_projid != icw->icw_prid) in xfs_icwalk_match_id()
1099 struct xfs_inode *ip, in xfs_icwalk_match_id_union() argument
1103 uid_eq(VFS_I(ip)->i_uid, icw->icw_uid)) in xfs_icwalk_match_id_union()
1107 gid_eq(VFS_I(ip)->i_gid, icw->icw_gid)) in xfs_icwalk_match_id_union()
1111 ip->i_projid == icw->icw_prid) in xfs_icwalk_match_id_union()
1124 struct xfs_inode *ip, in xfs_icwalk_match() argument
1133 match = xfs_icwalk_match_id_union(ip, icw); in xfs_icwalk_match()
1135 match = xfs_icwalk_match_id(ip, icw); in xfs_icwalk_match()
1141 XFS_ISIZE(ip) < icw->icw_min_file_size) in xfs_icwalk_match()
1166 struct xfs_inode *ip, in xfs_inode_free_eofblocks() argument
1174 if (!xfs_iflags_test(ip, XFS_IEOFBLOCKS)) in xfs_inode_free_eofblocks()
1181 if (!wait && mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY)) in xfs_inode_free_eofblocks()
1184 if (!xfs_icwalk_match(ip, icw)) in xfs_inode_free_eofblocks()
1191 if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) { in xfs_inode_free_eofblocks()
1198 if (xfs_can_free_eofblocks(ip)) in xfs_inode_free_eofblocks()
1199 return xfs_free_eofblocks(ip); in xfs_inode_free_eofblocks()
1202 trace_xfs_inode_free_eofblocks_invalid(ip); in xfs_inode_free_eofblocks()
1203 xfs_inode_clear_eofblocks_tag(ip); in xfs_inode_free_eofblocks()
1209 struct xfs_inode *ip, in xfs_blockgc_set_iflag() argument
1212 struct xfs_mount *mp = ip->i_mount; in xfs_blockgc_set_iflag()
1221 if (ip->i_flags & iflag) in xfs_blockgc_set_iflag()
1223 spin_lock(&ip->i_flags_lock); in xfs_blockgc_set_iflag()
1224 ip->i_flags |= iflag; in xfs_blockgc_set_iflag()
1225 spin_unlock(&ip->i_flags_lock); in xfs_blockgc_set_iflag()
1227 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in xfs_blockgc_set_iflag()
1230 xfs_perag_set_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino), in xfs_blockgc_set_iflag()
1239 xfs_inode_t *ip) in xfs_inode_set_eofblocks_tag() argument
1241 trace_xfs_inode_set_eofblocks_tag(ip); in xfs_inode_set_eofblocks_tag()
1242 return xfs_blockgc_set_iflag(ip, XFS_IEOFBLOCKS); in xfs_inode_set_eofblocks_tag()
1247 struct xfs_inode *ip, in xfs_blockgc_clear_iflag() argument
1250 struct xfs_mount *mp = ip->i_mount; in xfs_blockgc_clear_iflag()
1256 spin_lock(&ip->i_flags_lock); in xfs_blockgc_clear_iflag()
1257 ip->i_flags &= ~iflag; in xfs_blockgc_clear_iflag()
1258 clear_tag = (ip->i_flags & (XFS_IEOFBLOCKS | XFS_ICOWBLOCKS)) == 0; in xfs_blockgc_clear_iflag()
1259 spin_unlock(&ip->i_flags_lock); in xfs_blockgc_clear_iflag()
1264 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in xfs_blockgc_clear_iflag()
1267 xfs_perag_clear_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino), in xfs_blockgc_clear_iflag()
1276 xfs_inode_t *ip) in xfs_inode_clear_eofblocks_tag() argument
1278 trace_xfs_inode_clear_eofblocks_tag(ip); in xfs_inode_clear_eofblocks_tag()
1279 return xfs_blockgc_clear_iflag(ip, XFS_IEOFBLOCKS); in xfs_inode_clear_eofblocks_tag()
1287 struct xfs_inode *ip, in xfs_prep_free_cowblocks() argument
1298 if (!xfs_inode_has_cow_data(ip)) { in xfs_prep_free_cowblocks()
1299 trace_xfs_inode_free_cowblocks_invalid(ip); in xfs_prep_free_cowblocks()
1300 xfs_inode_clear_cowblocks_tag(ip); in xfs_prep_free_cowblocks()
1318 if (!sync && inode_is_open_for_write(VFS_I(ip))) in xfs_prep_free_cowblocks()
1320 return xfs_can_free_cowblocks(ip); in xfs_prep_free_cowblocks()
1337 struct xfs_inode *ip, in xfs_inode_free_cowblocks() argument
1346 if (!xfs_iflags_test(ip, XFS_ICOWBLOCKS)) in xfs_inode_free_cowblocks()
1349 if (!xfs_prep_free_cowblocks(ip, icw)) in xfs_inode_free_cowblocks()
1352 if (!xfs_icwalk_match(ip, icw)) in xfs_inode_free_cowblocks()
1360 !xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) { in xfs_inode_free_cowblocks()
1367 if (!xfs_ilock_nowait(ip, XFS_MMAPLOCK_EXCL)) { in xfs_inode_free_cowblocks()
1378 if (xfs_prep_free_cowblocks(ip, icw)) in xfs_inode_free_cowblocks()
1379 ret = xfs_reflink_cancel_cow_range(ip, 0, NULLFILEOFF, false); in xfs_inode_free_cowblocks()
1385 xfs_inode_t *ip) in xfs_inode_set_cowblocks_tag() argument
1387 trace_xfs_inode_set_cowblocks_tag(ip); in xfs_inode_set_cowblocks_tag()
1388 return xfs_blockgc_set_iflag(ip, XFS_ICOWBLOCKS); in xfs_inode_set_cowblocks_tag()
1393 xfs_inode_t *ip) in xfs_inode_clear_cowblocks_tag() argument
1395 trace_xfs_inode_clear_cowblocks_tag(ip); in xfs_inode_clear_cowblocks_tag()
1396 return xfs_blockgc_clear_iflag(ip, XFS_ICOWBLOCKS); in xfs_inode_clear_cowblocks_tag()
1443 struct xfs_inode *ip) in xfs_blockgc_igrab() argument
1445 struct inode *inode = VFS_I(ip); in xfs_blockgc_igrab()
1450 spin_lock(&ip->i_flags_lock); in xfs_blockgc_igrab()
1451 if (!ip->i_ino) in xfs_blockgc_igrab()
1454 if (ip->i_flags & XFS_BLOCKGC_NOGRAB_IFLAGS) in xfs_blockgc_igrab()
1456 spin_unlock(&ip->i_flags_lock); in xfs_blockgc_igrab()
1459 if (xfs_is_shutdown(ip->i_mount)) in xfs_blockgc_igrab()
1470 spin_unlock(&ip->i_flags_lock); in xfs_blockgc_igrab()
1477 struct xfs_inode *ip, in xfs_blockgc_scan_inode() argument
1483 error = xfs_inode_free_eofblocks(ip, icw, &lockflags); in xfs_blockgc_scan_inode()
1487 error = xfs_inode_free_cowblocks(ip, icw, &lockflags); in xfs_blockgc_scan_inode()
1490 xfs_iunlock(ip, lockflags); in xfs_blockgc_scan_inode()
1491 xfs_irele(ip); in xfs_blockgc_scan_inode()
1617 struct xfs_inode *ip, in xfs_blockgc_free_quota() argument
1620 return xfs_blockgc_free_dquots(ip->i_mount, in xfs_blockgc_free_quota()
1621 xfs_inode_dquot(ip, XFS_DQTYPE_USER), in xfs_blockgc_free_quota()
1622 xfs_inode_dquot(ip, XFS_DQTYPE_GROUP), in xfs_blockgc_free_quota()
1623 xfs_inode_dquot(ip, XFS_DQTYPE_PROJ), iwalk_flags); in xfs_blockgc_free_quota()
1644 struct xfs_inode *ip, in xfs_icwalk_igrab() argument
1649 return xfs_blockgc_igrab(ip); in xfs_icwalk_igrab()
1651 return xfs_reclaim_igrab(ip, icw); in xfs_icwalk_igrab()
1664 struct xfs_inode *ip, in xfs_icwalk_process_inode() argument
1672 error = xfs_blockgc_scan_inode(ip, icw); in xfs_icwalk_process_inode()
1675 xfs_reclaim_inode(ip, pag); in xfs_icwalk_process_inode()
1727 struct xfs_inode *ip = batch[i]; in xfs_icwalk_ag() local
1729 if (done || !xfs_icwalk_igrab(goal, ip, icw)) in xfs_icwalk_ag()
1744 if (XFS_INO_TO_AGNO(mp, ip->i_ino) != pag->pag_agno) in xfs_icwalk_ag()
1746 first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); in xfs_icwalk_ag()
1747 if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino)) in xfs_icwalk_ag()
1821 struct xfs_inode *ip, in xfs_check_delalloc() argument
1824 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_check_delalloc()
1828 if (!ifp || !xfs_iext_lookup_extent(ip, ifp, 0, &icur, &got)) in xfs_check_delalloc()
1832 xfs_warn(ip->i_mount, in xfs_check_delalloc()
1834 ip->i_ino, in xfs_check_delalloc()
1841 #define xfs_check_delalloc(ip, whichfork) do { } while (0) argument
1847 struct xfs_inode *ip) in xfs_inodegc_set_reclaimable() argument
1849 struct xfs_mount *mp = ip->i_mount; in xfs_inodegc_set_reclaimable()
1852 if (!xfs_is_shutdown(mp) && ip->i_delayed_blks) { in xfs_inodegc_set_reclaimable()
1853 xfs_check_delalloc(ip, XFS_DATA_FORK); in xfs_inodegc_set_reclaimable()
1854 xfs_check_delalloc(ip, XFS_COW_FORK); in xfs_inodegc_set_reclaimable()
1858 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in xfs_inodegc_set_reclaimable()
1860 spin_lock(&ip->i_flags_lock); in xfs_inodegc_set_reclaimable()
1862 trace_xfs_inode_set_reclaimable(ip); in xfs_inodegc_set_reclaimable()
1863 ip->i_flags &= ~(XFS_NEED_INACTIVE | XFS_INACTIVATING); in xfs_inodegc_set_reclaimable()
1864 ip->i_flags |= XFS_IRECLAIMABLE; in xfs_inodegc_set_reclaimable()
1865 xfs_perag_set_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino), in xfs_inodegc_set_reclaimable()
1868 spin_unlock(&ip->i_flags_lock); in xfs_inodegc_set_reclaimable()
1880 struct xfs_inode *ip) in xfs_inodegc_inactivate() argument
1884 trace_xfs_inode_inactivating(ip); in xfs_inodegc_inactivate()
1885 error = xfs_inactive(ip); in xfs_inodegc_inactivate()
1886 xfs_inodegc_set_reclaimable(ip); in xfs_inodegc_inactivate()
1898 struct xfs_inode *ip, *n; in xfs_inodegc_worker() local
1923 ip = llist_entry(node, struct xfs_inode, i_gclist); in xfs_inodegc_worker()
1927 llist_for_each_entry_safe(ip, n, node, i_gclist) { in xfs_inodegc_worker()
1930 xfs_iflags_set(ip, XFS_INACTIVATING); in xfs_inodegc_worker()
1931 error = xfs_inodegc_inactivate(ip); in xfs_inodegc_worker()
2018 struct xfs_inode *ip) in xfs_inodegc_want_queue_rt_file() argument
2020 struct xfs_mount *mp = ip->i_mount; in xfs_inodegc_want_queue_rt_file()
2022 if (!XFS_IS_REALTIME_INODE(ip)) in xfs_inodegc_want_queue_rt_file()
2033 # define xfs_inodegc_want_queue_rt_file(ip) (false) argument
2045 struct xfs_inode *ip, in xfs_inodegc_want_queue_work() argument
2048 struct xfs_mount *mp = ip->i_mount; in xfs_inodegc_want_queue_work()
2058 if (xfs_inodegc_want_queue_rt_file(ip)) in xfs_inodegc_want_queue_work()
2061 if (xfs_inode_near_dquot_enforcement(ip, XFS_DQTYPE_USER)) in xfs_inodegc_want_queue_work()
2064 if (xfs_inode_near_dquot_enforcement(ip, XFS_DQTYPE_GROUP)) in xfs_inodegc_want_queue_work()
2067 if (xfs_inode_near_dquot_enforcement(ip, XFS_DQTYPE_PROJ)) in xfs_inodegc_want_queue_work()
2092 struct xfs_inode *ip, in xfs_inodegc_want_flush_work() argument
2115 struct xfs_inode *ip) in xfs_inodegc_queue() argument
2117 struct xfs_mount *mp = ip->i_mount; in xfs_inodegc_queue()
2124 trace_xfs_inode_set_need_inactive(ip); in xfs_inodegc_queue()
2125 spin_lock(&ip->i_flags_lock); in xfs_inodegc_queue()
2126 ip->i_flags |= XFS_NEED_INACTIVE; in xfs_inodegc_queue()
2127 spin_unlock(&ip->i_flags_lock); in xfs_inodegc_queue()
2131 llist_add(&ip->i_gclist, &gc->list); in xfs_inodegc_queue()
2154 if (xfs_inodegc_want_queue_work(ip, items)) in xfs_inodegc_queue()
2162 if (xfs_inodegc_want_flush_work(ip, items, shrinker_hits)) { in xfs_inodegc_queue()
2180 struct xfs_inode *ip) in xfs_inode_mark_reclaimable() argument
2182 struct xfs_mount *mp = ip->i_mount; in xfs_inode_mark_reclaimable()
2190 ASSERT_ALWAYS(!xfs_iflags_test(ip, XFS_ALL_IRECLAIM_FLAGS)); in xfs_inode_mark_reclaimable()
2192 need_inactive = xfs_inode_needs_inactive(ip); in xfs_inode_mark_reclaimable()
2194 xfs_inodegc_queue(ip); in xfs_inode_mark_reclaimable()
2199 xfs_qm_dqdetach(ip); in xfs_inode_mark_reclaimable()
2200 xfs_inodegc_set_reclaimable(ip); in xfs_inode_mark_reclaimable()