• Home
  • Raw
  • Download

Lines Matching refs:ip

75 	struct xfs_inode	*ip;  in xfs_inode_alloc()  local
81 ip = alloc_inode_sb(mp->m_super, xfs_inode_cache, GFP_KERNEL | __GFP_NOFAIL); in xfs_inode_alloc()
83 if (inode_init_always(mp->m_super, VFS_I(ip))) { in xfs_inode_alloc()
84 kmem_cache_free(xfs_inode_cache, ip); in xfs_inode_alloc()
89 VFS_I(ip)->i_mode = 0; in xfs_inode_alloc()
90 VFS_I(ip)->i_state = 0; in xfs_inode_alloc()
91 mapping_set_large_folios(VFS_I(ip)->i_mapping); in xfs_inode_alloc()
94 ASSERT(atomic_read(&ip->i_pincount) == 0); in xfs_inode_alloc()
95 ASSERT(ip->i_ino == 0); in xfs_inode_alloc()
98 ip->i_ino = ino; in xfs_inode_alloc()
99 ip->i_mount = mp; in xfs_inode_alloc()
100 memset(&ip->i_imap, 0, sizeof(struct xfs_imap)); in xfs_inode_alloc()
101 ip->i_cowfp = NULL; in xfs_inode_alloc()
102 memset(&ip->i_af, 0, sizeof(ip->i_af)); in xfs_inode_alloc()
103 ip->i_af.if_format = XFS_DINODE_FMT_EXTENTS; in xfs_inode_alloc()
104 memset(&ip->i_df, 0, sizeof(ip->i_df)); in xfs_inode_alloc()
105 ip->i_flags = 0; in xfs_inode_alloc()
106 ip->i_delayed_blks = 0; in xfs_inode_alloc()
107 ip->i_diflags2 = mp->m_ino_geo.new_diflags2; in xfs_inode_alloc()
108 ip->i_nblocks = 0; in xfs_inode_alloc()
109 ip->i_forkoff = 0; in xfs_inode_alloc()
110 ip->i_sick = 0; in xfs_inode_alloc()
111 ip->i_checked = 0; in xfs_inode_alloc()
112 INIT_WORK(&ip->i_ioend_work, xfs_end_io); in xfs_inode_alloc()
113 INIT_LIST_HEAD(&ip->i_ioend_list); in xfs_inode_alloc()
114 spin_lock_init(&ip->i_ioend_lock); in xfs_inode_alloc()
115 ip->i_next_unlinked = NULLAGINO; in xfs_inode_alloc()
116 ip->i_prev_unlinked = NULLAGINO; in xfs_inode_alloc()
118 return ip; in xfs_inode_alloc()
126 struct xfs_inode *ip = XFS_I(inode); in xfs_inode_free_callback() local
128 switch (VFS_I(ip)->i_mode & S_IFMT) { in xfs_inode_free_callback()
132 xfs_idestroy_fork(&ip->i_df); in xfs_inode_free_callback()
136 xfs_ifork_zap_attr(ip); in xfs_inode_free_callback()
138 if (ip->i_cowfp) { in xfs_inode_free_callback()
139 xfs_idestroy_fork(ip->i_cowfp); in xfs_inode_free_callback()
140 kmem_cache_free(xfs_ifork_cache, ip->i_cowfp); in xfs_inode_free_callback()
142 if (ip->i_itemp) { in xfs_inode_free_callback()
144 &ip->i_itemp->ili_item.li_flags)); in xfs_inode_free_callback()
145 xfs_inode_item_destroy(ip); in xfs_inode_free_callback()
146 ip->i_itemp = NULL; in xfs_inode_free_callback()
149 kmem_cache_free(xfs_inode_cache, ip); in xfs_inode_free_callback()
154 struct xfs_inode *ip) in __xfs_inode_free() argument
157 ASSERT(atomic_read(&ip->i_pincount) == 0); in __xfs_inode_free()
158 ASSERT(!ip->i_itemp || list_empty(&ip->i_itemp->ili_item.li_bio_list)); in __xfs_inode_free()
159 XFS_STATS_DEC(ip->i_mount, vn_active); in __xfs_inode_free()
161 call_rcu(&VFS_I(ip)->i_rcu, xfs_inode_free_callback); in __xfs_inode_free()
166 struct xfs_inode *ip) in xfs_inode_free() argument
168 ASSERT(!xfs_iflags_test(ip, XFS_IFLUSHING)); in xfs_inode_free()
176 spin_lock(&ip->i_flags_lock); in xfs_inode_free()
177 ip->i_flags = XFS_IRECLAIM; in xfs_inode_free()
178 ip->i_ino = 0; in xfs_inode_free()
179 spin_unlock(&ip->i_flags_lock); in xfs_inode_free()
181 __xfs_inode_free(ip); in xfs_inode_free()
337 struct xfs_inode *ip) __releases(&ip->i_flags_lock) in xfs_iget_recycle() argument
339 struct xfs_mount *mp = ip->i_mount; in xfs_iget_recycle()
340 struct inode *inode = VFS_I(ip); in xfs_iget_recycle()
343 trace_xfs_iget_recycle(ip); in xfs_iget_recycle()
351 ip->i_flags |= XFS_IRECLAIM; in xfs_iget_recycle()
353 spin_unlock(&ip->i_flags_lock); in xfs_iget_recycle()
364 spin_lock(&ip->i_flags_lock); in xfs_iget_recycle()
365 ip->i_flags &= ~(XFS_INEW | XFS_IRECLAIM); in xfs_iget_recycle()
366 ASSERT(ip->i_flags & XFS_IRECLAIMABLE); in xfs_iget_recycle()
367 spin_unlock(&ip->i_flags_lock); in xfs_iget_recycle()
370 trace_xfs_iget_recycle_fail(ip); in xfs_iget_recycle()
375 spin_lock(&ip->i_flags_lock); in xfs_iget_recycle()
382 ip->i_flags &= ~XFS_IRECLAIM_RESET_FLAGS; in xfs_iget_recycle()
383 ip->i_flags |= XFS_INEW; in xfs_iget_recycle()
384 xfs_perag_clear_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino), in xfs_iget_recycle()
387 spin_unlock(&ip->i_flags_lock); in xfs_iget_recycle()
405 struct xfs_inode *ip, in xfs_iget_check_free_state() argument
410 if (VFS_I(ip)->i_mode != 0) { in xfs_iget_check_free_state()
411 xfs_warn(ip->i_mount, in xfs_iget_check_free_state()
413 ip->i_ino, VFS_I(ip)->i_mode); in xfs_iget_check_free_state()
417 if (ip->i_nblocks != 0) { in xfs_iget_check_free_state()
418 xfs_warn(ip->i_mount, in xfs_iget_check_free_state()
420 ip->i_ino); in xfs_iget_check_free_state()
427 if (VFS_I(ip)->i_mode == 0) in xfs_iget_check_free_state()
459 struct xfs_inode *ip, in xfs_iget_cache_hit() argument
464 struct inode *inode = VFS_I(ip); in xfs_iget_cache_hit()
465 struct xfs_mount *mp = ip->i_mount; in xfs_iget_cache_hit()
475 spin_lock(&ip->i_flags_lock); in xfs_iget_cache_hit()
476 if (ip->i_ino != ino) in xfs_iget_cache_hit()
497 if (ip->i_flags & (XFS_INEW | XFS_IRECLAIM | XFS_INACTIVATING)) in xfs_iget_cache_hit()
500 if (ip->i_flags & XFS_NEED_INACTIVE) { in xfs_iget_cache_hit()
502 if (VFS_I(ip)->i_nlink == 0) { in xfs_iget_cache_hit()
513 error = xfs_iget_check_free_state(ip, flags); in xfs_iget_cache_hit()
519 (ip->i_flags & XFS_IRECLAIMABLE)) in xfs_iget_cache_hit()
523 if (ip->i_flags & XFS_IRECLAIMABLE) { in xfs_iget_cache_hit()
525 error = xfs_iget_recycle(pag, ip); in xfs_iget_cache_hit()
534 spin_unlock(&ip->i_flags_lock); in xfs_iget_cache_hit()
536 trace_xfs_iget_hit(ip); in xfs_iget_cache_hit()
540 xfs_ilock(ip, lock_flags); in xfs_iget_cache_hit()
543 xfs_iflags_clear(ip, XFS_ISTALE); in xfs_iget_cache_hit()
549 trace_xfs_iget_skip(ip); in xfs_iget_cache_hit()
553 spin_unlock(&ip->i_flags_lock); in xfs_iget_cache_hit()
558 spin_unlock(&ip->i_flags_lock); in xfs_iget_cache_hit()
579 struct xfs_inode *ip; in xfs_iget_cache_miss() local
584 ip = xfs_inode_alloc(mp, ino); in xfs_iget_cache_miss()
585 if (!ip) in xfs_iget_cache_miss()
588 error = xfs_imap(mp, tp, ip->i_ino, &ip->i_imap, flags); in xfs_iget_cache_miss()
604 VFS_I(ip)->i_generation = get_random_u32(); in xfs_iget_cache_miss()
608 error = xfs_imap_to_bp(mp, tp, &ip->i_imap, &bp); in xfs_iget_cache_miss()
612 error = xfs_inode_from_disk(ip, in xfs_iget_cache_miss()
613 xfs_buf_offset(bp, ip->i_imap.im_boffset)); in xfs_iget_cache_miss()
622 trace_xfs_iget_miss(ip); in xfs_iget_cache_miss()
628 error = xfs_iget_check_free_state(ip, flags); in xfs_iget_cache_miss()
648 if (!xfs_ilock_nowait(ip, lock_flags)) in xfs_iget_cache_miss()
663 d_mark_dontcache(VFS_I(ip)); in xfs_iget_cache_miss()
664 ip->i_udquot = NULL; in xfs_iget_cache_miss()
665 ip->i_gdquot = NULL; in xfs_iget_cache_miss()
666 ip->i_pdquot = NULL; in xfs_iget_cache_miss()
667 xfs_iflags_set(ip, iflags); in xfs_iget_cache_miss()
671 error = radix_tree_insert(&pag->pag_ici_root, agino, ip); in xfs_iget_cache_miss()
681 *ipp = ip; in xfs_iget_cache_miss()
688 xfs_iunlock(ip, lock_flags); in xfs_iget_cache_miss()
690 __destroy_inode(VFS_I(ip)); in xfs_iget_cache_miss()
691 xfs_inode_free(ip); in xfs_iget_cache_miss()
716 struct xfs_inode *ip; in xfs_iget() local
736 ip = radix_tree_lookup(&pag->pag_ici_root, agino); in xfs_iget()
738 if (ip) { in xfs_iget()
739 error = xfs_iget_cache_hit(pag, ip, ino, flags, lock_flags); in xfs_iget()
750 error = xfs_iget_cache_miss(mp, pag, tp, ino, &ip, in xfs_iget()
757 *ipp = ip; in xfs_iget()
764 if (xfs_iflags_test(ip, XFS_INEW) && VFS_I(ip)->i_mode != 0) in xfs_iget()
765 xfs_setup_existing_inode(ip); in xfs_iget()
803 struct xfs_inode *ip; in xfs_icache_inode_is_allocated() local
806 error = xfs_iget(mp, tp, ino, XFS_IGET_INCORE, 0, &ip); in xfs_icache_inode_is_allocated()
810 *inuse = !!(VFS_I(ip)->i_mode); in xfs_icache_inode_is_allocated()
811 xfs_irele(ip); in xfs_icache_inode_is_allocated()
834 struct xfs_inode *ip, in xfs_reclaim_igrab() argument
839 spin_lock(&ip->i_flags_lock); in xfs_reclaim_igrab()
840 if (!__xfs_iflags_test(ip, XFS_IRECLAIMABLE) || in xfs_reclaim_igrab()
841 __xfs_iflags_test(ip, XFS_IRECLAIM)) { in xfs_reclaim_igrab()
843 spin_unlock(&ip->i_flags_lock); in xfs_reclaim_igrab()
848 if (ip->i_sick && in xfs_reclaim_igrab()
850 spin_unlock(&ip->i_flags_lock); in xfs_reclaim_igrab()
854 __xfs_iflags_set(ip, XFS_IRECLAIM); in xfs_reclaim_igrab()
855 spin_unlock(&ip->i_flags_lock); in xfs_reclaim_igrab()
873 struct xfs_inode *ip, in xfs_reclaim_inode() argument
876 xfs_ino_t ino = ip->i_ino; /* for radix_tree_delete */ in xfs_reclaim_inode()
878 if (!xfs_ilock_nowait(ip, XFS_ILOCK_EXCL)) in xfs_reclaim_inode()
880 if (xfs_iflags_test_and_set(ip, XFS_IFLUSHING)) in xfs_reclaim_inode()
890 if (xlog_is_shutdown(ip->i_mount->m_log)) { in xfs_reclaim_inode()
891 xfs_iunpin_wait(ip); in xfs_reclaim_inode()
892 xfs_iflush_shutdown_abort(ip); in xfs_reclaim_inode()
895 if (xfs_ipincount(ip)) in xfs_reclaim_inode()
897 if (!xfs_inode_clean(ip)) in xfs_reclaim_inode()
900 xfs_iflags_clear(ip, XFS_IFLUSHING); in xfs_reclaim_inode()
902 trace_xfs_inode_reclaiming(ip); in xfs_reclaim_inode()
914 spin_lock(&ip->i_flags_lock); in xfs_reclaim_inode()
915 ip->i_flags = XFS_IRECLAIM; in xfs_reclaim_inode()
916 ip->i_ino = 0; in xfs_reclaim_inode()
917 ip->i_sick = 0; in xfs_reclaim_inode()
918 ip->i_checked = 0; in xfs_reclaim_inode()
919 spin_unlock(&ip->i_flags_lock); in xfs_reclaim_inode()
921 ASSERT(!ip->i_itemp || ip->i_itemp->ili_item.li_buf == NULL); in xfs_reclaim_inode()
922 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_reclaim_inode()
924 XFS_STATS_INC(ip->i_mount, xs_ig_reclaims); in xfs_reclaim_inode()
934 XFS_INO_TO_AGINO(ip->i_mount, ino))) in xfs_reclaim_inode()
947 xfs_ilock(ip, XFS_ILOCK_EXCL); in xfs_reclaim_inode()
948 ASSERT(!ip->i_udquot && !ip->i_gdquot && !ip->i_pdquot); in xfs_reclaim_inode()
949 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_reclaim_inode()
950 ASSERT(xfs_inode_clean(ip)); in xfs_reclaim_inode()
952 __xfs_inode_free(ip); in xfs_reclaim_inode()
956 xfs_iflags_clear(ip, XFS_IFLUSHING); in xfs_reclaim_inode()
958 xfs_iunlock(ip, XFS_ILOCK_EXCL); in xfs_reclaim_inode()
960 xfs_iflags_clear(ip, XFS_IRECLAIM); in xfs_reclaim_inode()
1039 struct xfs_inode *ip, in xfs_icwalk_match_id() argument
1043 !uid_eq(VFS_I(ip)->i_uid, icw->icw_uid)) in xfs_icwalk_match_id()
1047 !gid_eq(VFS_I(ip)->i_gid, icw->icw_gid)) in xfs_icwalk_match_id()
1051 ip->i_projid != icw->icw_prid) in xfs_icwalk_match_id()
1063 struct xfs_inode *ip, in xfs_icwalk_match_id_union() argument
1067 uid_eq(VFS_I(ip)->i_uid, icw->icw_uid)) in xfs_icwalk_match_id_union()
1071 gid_eq(VFS_I(ip)->i_gid, icw->icw_gid)) in xfs_icwalk_match_id_union()
1075 ip->i_projid == icw->icw_prid) in xfs_icwalk_match_id_union()
1088 struct xfs_inode *ip, in xfs_icwalk_match() argument
1097 match = xfs_icwalk_match_id_union(ip, icw); in xfs_icwalk_match()
1099 match = xfs_icwalk_match_id(ip, icw); in xfs_icwalk_match()
1105 XFS_ISIZE(ip) < icw->icw_min_file_size) in xfs_icwalk_match()
1130 struct xfs_inode *ip, in xfs_inode_free_eofblocks() argument
1138 if (!xfs_iflags_test(ip, XFS_IEOFBLOCKS)) in xfs_inode_free_eofblocks()
1145 if (!wait && mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY)) in xfs_inode_free_eofblocks()
1148 if (!xfs_icwalk_match(ip, icw)) in xfs_inode_free_eofblocks()
1155 if (!xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) { in xfs_inode_free_eofblocks()
1162 if (xfs_can_free_eofblocks(ip, false)) in xfs_inode_free_eofblocks()
1163 return xfs_free_eofblocks(ip); in xfs_inode_free_eofblocks()
1166 trace_xfs_inode_free_eofblocks_invalid(ip); in xfs_inode_free_eofblocks()
1167 xfs_inode_clear_eofblocks_tag(ip); in xfs_inode_free_eofblocks()
1173 struct xfs_inode *ip, in xfs_blockgc_set_iflag() argument
1176 struct xfs_mount *mp = ip->i_mount; in xfs_blockgc_set_iflag()
1185 if (ip->i_flags & iflag) in xfs_blockgc_set_iflag()
1187 spin_lock(&ip->i_flags_lock); in xfs_blockgc_set_iflag()
1188 ip->i_flags |= iflag; in xfs_blockgc_set_iflag()
1189 spin_unlock(&ip->i_flags_lock); in xfs_blockgc_set_iflag()
1191 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in xfs_blockgc_set_iflag()
1194 xfs_perag_set_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino), in xfs_blockgc_set_iflag()
1203 xfs_inode_t *ip) in xfs_inode_set_eofblocks_tag() argument
1205 trace_xfs_inode_set_eofblocks_tag(ip); in xfs_inode_set_eofblocks_tag()
1206 return xfs_blockgc_set_iflag(ip, XFS_IEOFBLOCKS); in xfs_inode_set_eofblocks_tag()
1211 struct xfs_inode *ip, in xfs_blockgc_clear_iflag() argument
1214 struct xfs_mount *mp = ip->i_mount; in xfs_blockgc_clear_iflag()
1220 spin_lock(&ip->i_flags_lock); in xfs_blockgc_clear_iflag()
1221 ip->i_flags &= ~iflag; in xfs_blockgc_clear_iflag()
1222 clear_tag = (ip->i_flags & (XFS_IEOFBLOCKS | XFS_ICOWBLOCKS)) == 0; in xfs_blockgc_clear_iflag()
1223 spin_unlock(&ip->i_flags_lock); in xfs_blockgc_clear_iflag()
1228 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in xfs_blockgc_clear_iflag()
1231 xfs_perag_clear_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino), in xfs_blockgc_clear_iflag()
1240 xfs_inode_t *ip) in xfs_inode_clear_eofblocks_tag() argument
1242 trace_xfs_inode_clear_eofblocks_tag(ip); in xfs_inode_clear_eofblocks_tag()
1243 return xfs_blockgc_clear_iflag(ip, XFS_IEOFBLOCKS); in xfs_inode_clear_eofblocks_tag()
1253 struct xfs_inode *ip) in xfs_prep_free_cowblocks() argument
1259 if (!xfs_inode_has_cow_data(ip)) { in xfs_prep_free_cowblocks()
1260 trace_xfs_inode_free_cowblocks_invalid(ip); in xfs_prep_free_cowblocks()
1261 xfs_inode_clear_cowblocks_tag(ip); in xfs_prep_free_cowblocks()
1269 if ((VFS_I(ip)->i_state & I_DIRTY_PAGES) || in xfs_prep_free_cowblocks()
1270 mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY) || in xfs_prep_free_cowblocks()
1271 mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_WRITEBACK) || in xfs_prep_free_cowblocks()
1272 atomic_read(&VFS_I(ip)->i_dio_count)) in xfs_prep_free_cowblocks()
1292 struct xfs_inode *ip, in xfs_inode_free_cowblocks() argument
1301 if (!xfs_iflags_test(ip, XFS_ICOWBLOCKS)) in xfs_inode_free_cowblocks()
1304 if (!xfs_prep_free_cowblocks(ip)) in xfs_inode_free_cowblocks()
1307 if (!xfs_icwalk_match(ip, icw)) in xfs_inode_free_cowblocks()
1315 !xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL)) { in xfs_inode_free_cowblocks()
1322 if (!xfs_ilock_nowait(ip, XFS_MMAPLOCK_EXCL)) { in xfs_inode_free_cowblocks()
1333 if (xfs_prep_free_cowblocks(ip)) in xfs_inode_free_cowblocks()
1334 ret = xfs_reflink_cancel_cow_range(ip, 0, NULLFILEOFF, false); in xfs_inode_free_cowblocks()
1340 xfs_inode_t *ip) in xfs_inode_set_cowblocks_tag() argument
1342 trace_xfs_inode_set_cowblocks_tag(ip); in xfs_inode_set_cowblocks_tag()
1343 return xfs_blockgc_set_iflag(ip, XFS_ICOWBLOCKS); in xfs_inode_set_cowblocks_tag()
1348 xfs_inode_t *ip) in xfs_inode_clear_cowblocks_tag() argument
1350 trace_xfs_inode_clear_cowblocks_tag(ip); in xfs_inode_clear_cowblocks_tag()
1351 return xfs_blockgc_clear_iflag(ip, XFS_ICOWBLOCKS); in xfs_inode_clear_cowblocks_tag()
1399 struct xfs_inode *ip) in xfs_blockgc_igrab() argument
1401 struct inode *inode = VFS_I(ip); in xfs_blockgc_igrab()
1406 spin_lock(&ip->i_flags_lock); in xfs_blockgc_igrab()
1407 if (!ip->i_ino) in xfs_blockgc_igrab()
1410 if (ip->i_flags & XFS_BLOCKGC_NOGRAB_IFLAGS) in xfs_blockgc_igrab()
1412 spin_unlock(&ip->i_flags_lock); in xfs_blockgc_igrab()
1415 if (xfs_is_shutdown(ip->i_mount)) in xfs_blockgc_igrab()
1426 spin_unlock(&ip->i_flags_lock); in xfs_blockgc_igrab()
1433 struct xfs_inode *ip, in xfs_blockgc_scan_inode() argument
1439 error = xfs_inode_free_eofblocks(ip, icw, &lockflags); in xfs_blockgc_scan_inode()
1443 error = xfs_inode_free_cowblocks(ip, icw, &lockflags); in xfs_blockgc_scan_inode()
1446 xfs_iunlock(ip, lockflags); in xfs_blockgc_scan_inode()
1447 xfs_irele(ip); in xfs_blockgc_scan_inode()
1576 struct xfs_inode *ip, in xfs_blockgc_free_quota() argument
1579 return xfs_blockgc_free_dquots(ip->i_mount, in xfs_blockgc_free_quota()
1580 xfs_inode_dquot(ip, XFS_DQTYPE_USER), in xfs_blockgc_free_quota()
1581 xfs_inode_dquot(ip, XFS_DQTYPE_GROUP), in xfs_blockgc_free_quota()
1582 xfs_inode_dquot(ip, XFS_DQTYPE_PROJ), iwalk_flags); in xfs_blockgc_free_quota()
1603 struct xfs_inode *ip, in xfs_icwalk_igrab() argument
1608 return xfs_blockgc_igrab(ip); in xfs_icwalk_igrab()
1610 return xfs_reclaim_igrab(ip, icw); in xfs_icwalk_igrab()
1623 struct xfs_inode *ip, in xfs_icwalk_process_inode() argument
1631 error = xfs_blockgc_scan_inode(ip, icw); in xfs_icwalk_process_inode()
1634 xfs_reclaim_inode(ip, pag); in xfs_icwalk_process_inode()
1686 struct xfs_inode *ip = batch[i]; in xfs_icwalk_ag() local
1688 if (done || !xfs_icwalk_igrab(goal, ip, icw)) in xfs_icwalk_ag()
1703 if (XFS_INO_TO_AGNO(mp, ip->i_ino) != pag->pag_agno) in xfs_icwalk_ag()
1705 first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); in xfs_icwalk_ag()
1706 if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino)) in xfs_icwalk_ag()
1781 struct xfs_inode *ip, in xfs_check_delalloc() argument
1784 struct xfs_ifork *ifp = xfs_ifork_ptr(ip, whichfork); in xfs_check_delalloc()
1788 if (!ifp || !xfs_iext_lookup_extent(ip, ifp, 0, &icur, &got)) in xfs_check_delalloc()
1792 xfs_warn(ip->i_mount, in xfs_check_delalloc()
1794 ip->i_ino, in xfs_check_delalloc()
1801 #define xfs_check_delalloc(ip, whichfork) do { } while (0) argument
1807 struct xfs_inode *ip) in xfs_inodegc_set_reclaimable() argument
1809 struct xfs_mount *mp = ip->i_mount; in xfs_inodegc_set_reclaimable()
1812 if (!xfs_is_shutdown(mp) && ip->i_delayed_blks) { in xfs_inodegc_set_reclaimable()
1813 xfs_check_delalloc(ip, XFS_DATA_FORK); in xfs_inodegc_set_reclaimable()
1814 xfs_check_delalloc(ip, XFS_COW_FORK); in xfs_inodegc_set_reclaimable()
1818 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in xfs_inodegc_set_reclaimable()
1820 spin_lock(&ip->i_flags_lock); in xfs_inodegc_set_reclaimable()
1822 trace_xfs_inode_set_reclaimable(ip); in xfs_inodegc_set_reclaimable()
1823 ip->i_flags &= ~(XFS_NEED_INACTIVE | XFS_INACTIVATING); in xfs_inodegc_set_reclaimable()
1824 ip->i_flags |= XFS_IRECLAIMABLE; in xfs_inodegc_set_reclaimable()
1825 xfs_perag_set_inode_tag(pag, XFS_INO_TO_AGINO(mp, ip->i_ino), in xfs_inodegc_set_reclaimable()
1828 spin_unlock(&ip->i_flags_lock); in xfs_inodegc_set_reclaimable()
1840 struct xfs_inode *ip) in xfs_inodegc_inactivate() argument
1842 trace_xfs_inode_inactivating(ip); in xfs_inodegc_inactivate()
1843 xfs_inactive(ip); in xfs_inodegc_inactivate()
1844 xfs_inodegc_set_reclaimable(ip); in xfs_inodegc_inactivate()
1854 struct xfs_inode *ip, *n; in xfs_inodegc_worker() local
1863 ip = llist_entry(node, struct xfs_inode, i_gclist); in xfs_inodegc_worker()
1864 trace_xfs_inodegc_worker(ip->i_mount, READ_ONCE(gc->shrinker_hits)); in xfs_inodegc_worker()
1867 llist_for_each_entry_safe(ip, n, node, i_gclist) { in xfs_inodegc_worker()
1868 xfs_iflags_set(ip, XFS_INACTIVATING); in xfs_inodegc_worker()
1869 xfs_inodegc_inactivate(ip); in xfs_inodegc_worker()
1952 struct xfs_inode *ip) in xfs_inodegc_want_queue_rt_file() argument
1954 struct xfs_mount *mp = ip->i_mount; in xfs_inodegc_want_queue_rt_file()
1956 if (!XFS_IS_REALTIME_INODE(ip)) in xfs_inodegc_want_queue_rt_file()
1967 # define xfs_inodegc_want_queue_rt_file(ip) (false) argument
1979 struct xfs_inode *ip, in xfs_inodegc_want_queue_work() argument
1982 struct xfs_mount *mp = ip->i_mount; in xfs_inodegc_want_queue_work()
1992 if (xfs_inodegc_want_queue_rt_file(ip)) in xfs_inodegc_want_queue_work()
1995 if (xfs_inode_near_dquot_enforcement(ip, XFS_DQTYPE_USER)) in xfs_inodegc_want_queue_work()
1998 if (xfs_inode_near_dquot_enforcement(ip, XFS_DQTYPE_GROUP)) in xfs_inodegc_want_queue_work()
2001 if (xfs_inode_near_dquot_enforcement(ip, XFS_DQTYPE_PROJ)) in xfs_inodegc_want_queue_work()
2024 struct xfs_inode *ip, in xfs_inodegc_want_flush_work() argument
2047 struct xfs_inode *ip) in xfs_inodegc_queue() argument
2049 struct xfs_mount *mp = ip->i_mount; in xfs_inodegc_queue()
2055 trace_xfs_inode_set_need_inactive(ip); in xfs_inodegc_queue()
2056 spin_lock(&ip->i_flags_lock); in xfs_inodegc_queue()
2057 ip->i_flags |= XFS_NEED_INACTIVE; in xfs_inodegc_queue()
2058 spin_unlock(&ip->i_flags_lock); in xfs_inodegc_queue()
2061 llist_add(&ip->i_gclist, &gc->list); in xfs_inodegc_queue()
2075 if (xfs_inodegc_want_queue_work(ip, items)) in xfs_inodegc_queue()
2083 if (xfs_inodegc_want_flush_work(ip, items, shrinker_hits)) { in xfs_inodegc_queue()
2142 struct xfs_inode *ip) in xfs_inode_mark_reclaimable() argument
2144 struct xfs_mount *mp = ip->i_mount; in xfs_inode_mark_reclaimable()
2152 ASSERT_ALWAYS(!xfs_iflags_test(ip, XFS_ALL_IRECLAIM_FLAGS)); in xfs_inode_mark_reclaimable()
2154 need_inactive = xfs_inode_needs_inactive(ip); in xfs_inode_mark_reclaimable()
2156 xfs_inodegc_queue(ip); in xfs_inode_mark_reclaimable()
2161 xfs_qm_dqdetach(ip); in xfs_inode_mark_reclaimable()
2162 xfs_inodegc_set_reclaimable(ip); in xfs_inode_mark_reclaimable()