• Home
  • Raw
  • Download

Lines Matching +full:scrubber +full:- +full:done

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
45 if (inode_init_always(mp->m_super, VFS_I(ip))) { in xfs_inode_alloc()
51 VFS_I(ip)->i_mode = 0; in xfs_inode_alloc()
52 VFS_I(ip)->i_state = 0; in xfs_inode_alloc()
55 ASSERT(atomic_read(&ip->i_pincount) == 0); in xfs_inode_alloc()
56 ASSERT(ip->i_ino == 0); in xfs_inode_alloc()
59 ip->i_ino = ino; in xfs_inode_alloc()
60 ip->i_mount = mp; in xfs_inode_alloc()
61 memset(&ip->i_imap, 0, sizeof(struct xfs_imap)); in xfs_inode_alloc()
62 ip->i_afp = NULL; in xfs_inode_alloc()
63 ip->i_cowfp = NULL; in xfs_inode_alloc()
64 memset(&ip->i_df, 0, sizeof(ip->i_df)); in xfs_inode_alloc()
65 ip->i_flags = 0; in xfs_inode_alloc()
66 ip->i_delayed_blks = 0; in xfs_inode_alloc()
67 memset(&ip->i_d, 0, sizeof(ip->i_d)); in xfs_inode_alloc()
68 ip->i_sick = 0; in xfs_inode_alloc()
69 ip->i_checked = 0; in xfs_inode_alloc()
70 INIT_WORK(&ip->i_ioend_work, xfs_end_io); in xfs_inode_alloc()
71 INIT_LIST_HEAD(&ip->i_ioend_list); in xfs_inode_alloc()
72 spin_lock_init(&ip->i_ioend_lock); in xfs_inode_alloc()
84 switch (VFS_I(ip)->i_mode & S_IFMT) { in xfs_inode_free_callback()
88 xfs_idestroy_fork(&ip->i_df); in xfs_inode_free_callback()
92 if (ip->i_afp) { in xfs_inode_free_callback()
93 xfs_idestroy_fork(ip->i_afp); in xfs_inode_free_callback()
94 kmem_cache_free(xfs_ifork_zone, ip->i_afp); in xfs_inode_free_callback()
96 if (ip->i_cowfp) { in xfs_inode_free_callback()
97 xfs_idestroy_fork(ip->i_cowfp); in xfs_inode_free_callback()
98 kmem_cache_free(xfs_ifork_zone, ip->i_cowfp); in xfs_inode_free_callback()
100 if (ip->i_itemp) { in xfs_inode_free_callback()
102 &ip->i_itemp->ili_item.li_flags)); in xfs_inode_free_callback()
104 ip->i_itemp = NULL; in xfs_inode_free_callback()
115 ASSERT(atomic_read(&ip->i_pincount) == 0); in __xfs_inode_free()
116 ASSERT(!ip->i_itemp || list_empty(&ip->i_itemp->ili_item.li_bio_list)); in __xfs_inode_free()
117 XFS_STATS_DEC(ip->i_mount, vn_active); in __xfs_inode_free()
119 call_rcu(&VFS_I(ip)->i_rcu, xfs_inode_free_callback); in __xfs_inode_free()
131 * free state. The ip->i_flags_lock provides the barrier against lookup in xfs_inode_free()
134 spin_lock(&ip->i_flags_lock); in xfs_inode_free()
135 ip->i_flags = XFS_IRECLAIM; in xfs_inode_free()
136 ip->i_ino = 0; in xfs_inode_free()
137 spin_unlock(&ip->i_flags_lock); in xfs_inode_free()
152 if (radix_tree_tagged(&mp->m_perag_tree, XFS_ICI_RECLAIM_TAG)) { in xfs_reclaim_work_queue()
153 queue_delayed_work(mp->m_reclaim_workqueue, &mp->m_reclaim_work, in xfs_reclaim_work_queue()
163 struct xfs_mount *mp = pag->pag_mount; in xfs_perag_set_reclaim_tag()
165 lockdep_assert_held(&pag->pag_ici_lock); in xfs_perag_set_reclaim_tag()
166 if (pag->pag_ici_reclaimable++) in xfs_perag_set_reclaim_tag()
170 spin_lock(&mp->m_perag_lock); in xfs_perag_set_reclaim_tag()
171 radix_tree_tag_set(&mp->m_perag_tree, pag->pag_agno, in xfs_perag_set_reclaim_tag()
173 spin_unlock(&mp->m_perag_lock); in xfs_perag_set_reclaim_tag()
178 trace_xfs_perag_set_reclaim(mp, pag->pag_agno, -1, _RET_IP_); in xfs_perag_set_reclaim_tag()
185 struct xfs_mount *mp = pag->pag_mount; in xfs_perag_clear_reclaim_tag()
187 lockdep_assert_held(&pag->pag_ici_lock); in xfs_perag_clear_reclaim_tag()
188 if (--pag->pag_ici_reclaimable) in xfs_perag_clear_reclaim_tag()
192 spin_lock(&mp->m_perag_lock); in xfs_perag_clear_reclaim_tag()
193 radix_tree_tag_clear(&mp->m_perag_tree, pag->pag_agno, in xfs_perag_clear_reclaim_tag()
195 spin_unlock(&mp->m_perag_lock); in xfs_perag_clear_reclaim_tag()
196 trace_xfs_perag_clear_reclaim(mp, pag->pag_agno, -1, _RET_IP_); in xfs_perag_clear_reclaim_tag()
209 struct xfs_mount *mp = ip->i_mount; in xfs_inode_set_reclaim_tag()
212 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in xfs_inode_set_reclaim_tag()
213 spin_lock(&pag->pag_ici_lock); in xfs_inode_set_reclaim_tag()
214 spin_lock(&ip->i_flags_lock); in xfs_inode_set_reclaim_tag()
216 radix_tree_tag_set(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ip->i_ino), in xfs_inode_set_reclaim_tag()
221 spin_unlock(&ip->i_flags_lock); in xfs_inode_set_reclaim_tag()
222 spin_unlock(&pag->pag_ici_lock); in xfs_inode_set_reclaim_tag()
231 radix_tree_tag_clear(&pag->pag_ici_root, in xfs_inode_clear_reclaim_tag()
232 XFS_INO_TO_AGINO(pag->pag_mount, ino), in xfs_inode_clear_reclaim_tag()
241 wait_queue_head_t *wq = bit_waitqueue(&ip->i_flags, __XFS_INEW_BIT); in xfs_inew_wait()
242 DEFINE_WAIT_BIT(wait, &ip->i_flags, __XFS_INEW_BIT); in xfs_inew_wait()
254 * When we recycle a reclaimable inode, we need to re-initialise the VFS inode
256 * information about the on-disk values in the VFS inode and so we can't just
267 uint32_t nlink = inode->i_nlink; in xfs_reinit_inode()
268 uint32_t generation = inode->i_generation; in xfs_reinit_inode()
270 umode_t mode = inode->i_mode; in xfs_reinit_inode()
271 dev_t dev = inode->i_rdev; in xfs_reinit_inode()
272 kuid_t uid = inode->i_uid; in xfs_reinit_inode()
273 kgid_t gid = inode->i_gid; in xfs_reinit_inode()
275 error = inode_init_always(mp->m_super, inode); in xfs_reinit_inode()
278 inode->i_generation = generation; in xfs_reinit_inode()
280 inode->i_mode = mode; in xfs_reinit_inode()
281 inode->i_rdev = dev; in xfs_reinit_inode()
282 inode->i_uid = uid; in xfs_reinit_inode()
283 inode->i_gid = gid; in xfs_reinit_inode()
294 * -ENOENT if the inode is free and we are not allocating
295 * -EFSCORRUPTED if there is any state mismatch at all
304 if (VFS_I(ip)->i_mode != 0) { in xfs_iget_check_free_state()
305 xfs_warn(ip->i_mount, in xfs_iget_check_free_state()
307 ip->i_ino, VFS_I(ip)->i_mode); in xfs_iget_check_free_state()
308 return -EFSCORRUPTED; in xfs_iget_check_free_state()
311 if (ip->i_d.di_nblocks != 0) { in xfs_iget_check_free_state()
312 xfs_warn(ip->i_mount, in xfs_iget_check_free_state()
314 ip->i_ino); in xfs_iget_check_free_state()
315 return -EFSCORRUPTED; in xfs_iget_check_free_state()
321 if (VFS_I(ip)->i_mode == 0) in xfs_iget_check_free_state()
322 return -ENOENT; in xfs_iget_check_free_state()
339 struct xfs_mount *mp = ip->i_mount; in xfs_iget_cache_hit()
343 * check for re-use of an inode within an RCU grace period due to the in xfs_iget_cache_hit()
349 spin_lock(&ip->i_flags_lock); in xfs_iget_cache_hit()
350 if (ip->i_ino != ino) { in xfs_iget_cache_hit()
353 error = -EAGAIN; in xfs_iget_cache_hit()
368 if (ip->i_flags & (XFS_INEW|XFS_IRECLAIM)) { in xfs_iget_cache_hit()
371 error = -EAGAIN; in xfs_iget_cache_hit()
387 if (ip->i_flags & XFS_IRECLAIMABLE) { in xfs_iget_cache_hit()
391 error = -EAGAIN; in xfs_iget_cache_hit()
401 ip->i_flags |= XFS_IRECLAIM; in xfs_iget_cache_hit()
403 spin_unlock(&ip->i_flags_lock); in xfs_iget_cache_hit()
406 ASSERT(!rwsem_is_locked(&inode->i_rwsem)); in xfs_iget_cache_hit()
411 * Re-initializing the inode failed, and we are in deep in xfs_iget_cache_hit()
412 * trouble. Try to re-add it to the reclaim list. in xfs_iget_cache_hit()
415 spin_lock(&ip->i_flags_lock); in xfs_iget_cache_hit()
417 ip->i_flags &= ~(XFS_INEW | XFS_IRECLAIM); in xfs_iget_cache_hit()
419 wake_up_bit(&ip->i_flags, __XFS_INEW_BIT); in xfs_iget_cache_hit()
420 ASSERT(ip->i_flags & XFS_IRECLAIMABLE); in xfs_iget_cache_hit()
425 spin_lock(&pag->pag_ici_lock); in xfs_iget_cache_hit()
426 spin_lock(&ip->i_flags_lock); in xfs_iget_cache_hit()
429 * Clear the per-lifetime state in the inode as we are now in xfs_iget_cache_hit()
433 ip->i_flags &= ~XFS_IRECLAIM_RESET_FLAGS; in xfs_iget_cache_hit()
434 ip->i_flags |= XFS_INEW; in xfs_iget_cache_hit()
435 xfs_inode_clear_reclaim_tag(pag, ip->i_ino); in xfs_iget_cache_hit()
436 inode->i_state = I_NEW; in xfs_iget_cache_hit()
437 ip->i_sick = 0; in xfs_iget_cache_hit()
438 ip->i_checked = 0; in xfs_iget_cache_hit()
440 spin_unlock(&ip->i_flags_lock); in xfs_iget_cache_hit()
441 spin_unlock(&pag->pag_ici_lock); in xfs_iget_cache_hit()
446 error = -EAGAIN; in xfs_iget_cache_hit()
451 spin_unlock(&ip->i_flags_lock); in xfs_iget_cache_hit()
466 spin_unlock(&ip->i_flags_lock); in xfs_iget_cache_hit()
489 return -ENOMEM; in xfs_iget_cache_miss()
491 error = xfs_imap(mp, tp, ip->i_ino, &ip->i_imap, flags); in xfs_iget_cache_miss()
501 * the di_flushiter field being initialised from the current on-disk in xfs_iget_cache_miss()
505 if (xfs_sb_version_has_v3inode(&mp->m_sb) && in xfs_iget_cache_miss()
506 (flags & XFS_IGET_CREATE) && !(mp->m_flags & XFS_MOUNT_IKEEP)) { in xfs_iget_cache_miss()
507 VFS_I(ip)->i_generation = prandom_u32(); in xfs_iget_cache_miss()
512 error = xfs_imap_to_bp(mp, tp, &ip->i_imap, &dip, &bp, 0); in xfs_iget_cache_miss()
542 error = -EAGAIN; in xfs_iget_cache_miss()
547 * Because the inode hasn't been added to the radix-tree yet it can't in xfs_iget_cache_miss()
548 * be found by another thread, so we can do the non-sleeping lock here. in xfs_iget_cache_miss()
560 * The ip->i_flags_lock that protects the XFS_INEW flag forms the in xfs_iget_cache_miss()
567 ip->i_udquot = NULL; in xfs_iget_cache_miss()
568 ip->i_gdquot = NULL; in xfs_iget_cache_miss()
569 ip->i_pdquot = NULL; in xfs_iget_cache_miss()
573 spin_lock(&pag->pag_ici_lock); in xfs_iget_cache_miss()
574 error = radix_tree_insert(&pag->pag_ici_root, agino, ip); in xfs_iget_cache_miss()
576 WARN_ON(error != -EEXIST); in xfs_iget_cache_miss()
578 error = -EAGAIN; in xfs_iget_cache_miss()
581 spin_unlock(&pag->pag_ici_lock); in xfs_iget_cache_miss()
588 spin_unlock(&pag->pag_ici_lock); in xfs_iget_cache_miss()
607 * Inode lookup is only done during metadata operations and not as part of the
627 if (!ino || XFS_INO_TO_AGNO(mp, ino) >= mp->m_sb.sb_agcount) in xfs_iget()
628 return -EINVAL; in xfs_iget()
639 ip = radix_tree_lookup(&pag->pag_ici_root, agino); in xfs_iget()
648 error = -ENODATA; in xfs_iget()
663 * If we have a real type for an on-disk inode, we can setup the inode in xfs_iget()
666 if (xfs_iflags_test(ip, XFS_INEW) && VFS_I(ip)->i_mode != 0) in xfs_iget()
671 if (!(flags & XFS_IGET_INCORE) && error == -EAGAIN) { in xfs_iget()
691 * reclaimable, or being reclaimed), -EAGAIN will be returned; if the
692 * inode is not in the cache, -ENOENT will be returned. The caller must
695 * This is a specialized use case for the online scrubber; if you're
712 *inuse = !!(VFS_I(ip)->i_mode); in xfs_icache_inode_is_allocated()
718 * The inode lookup is done in batches to keep the amount of lock traffic and
741 spin_lock(&ip->i_flags_lock); in xfs_inode_walk_ag_grab()
742 if (!ip->i_ino) in xfs_inode_walk_ag_grab()
749 spin_unlock(&ip->i_flags_lock); in xfs_inode_walk_ag_grab()
752 if (XFS_FORCED_SHUTDOWN(ip->i_mount)) in xfs_inode_walk_ag_grab()
763 spin_unlock(&ip->i_flags_lock); in xfs_inode_walk_ag_grab()
768 * For a given per-AG structure @pag, grab, @execute, and rele all incore
779 struct xfs_mount *mp = pag->pag_mount; in xfs_inode_walk_ag()
783 bool done; in xfs_inode_walk_ag() local
787 done = false; in xfs_inode_walk_ag()
799 nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, in xfs_inode_walk_ag()
804 &pag->pag_ici_root, in xfs_inode_walk_ag()
820 if (done || !xfs_inode_walk_ag_grab(ip, iter_flags)) in xfs_inode_walk_ag()
835 if (XFS_INO_TO_AGNO(mp, ip->i_ino) != pag->pag_agno) in xfs_inode_walk_ag()
837 first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); in xfs_inode_walk_ag()
838 if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino)) in xfs_inode_walk_ag()
839 done = true; in xfs_inode_walk_ag()
853 if (error == -EAGAIN) { in xfs_inode_walk_ag()
857 if (error && last_error != -EFSCORRUPTED) in xfs_inode_walk_ag()
862 if (error == -EFSCORRUPTED) in xfs_inode_walk_ag()
867 } while (nr_found && !done); in xfs_inode_walk_ag()
876 /* Fetch the next (possibly tagged) per-AG structure. */
907 ag = pag->pag_agno + 1; in xfs_inode_walk()
912 if (error == -EFSCORRUPTED) in xfs_inode_walk()
920 * Background scanning to trim post-EOF preallocated space. This is queued
928 if (radix_tree_tagged(&mp->m_perag_tree, XFS_ICI_EOFBLOCKS_TAG)) in xfs_queue_eofblocks()
929 queue_delayed_work(mp->m_eofblocks_workqueue, in xfs_queue_eofblocks()
930 &mp->m_eofblocks_work, in xfs_queue_eofblocks()
942 if (!sb_start_write_trylock(mp->m_super)) in xfs_eofblocks_worker()
945 sb_end_write(mp->m_super); in xfs_eofblocks_worker()
953 * (We'll just piggyback on the post-EOF prealloc space workqueue.)
960 if (radix_tree_tagged(&mp->m_perag_tree, XFS_ICI_COWBLOCKS_TAG)) in xfs_queue_cowblocks()
961 queue_delayed_work(mp->m_eofblocks_workqueue, in xfs_queue_cowblocks()
962 &mp->m_cowblocks_work, in xfs_queue_cowblocks()
974 if (!sb_start_write_trylock(mp->m_super)) in xfs_cowblocks_worker()
977 sb_end_write(mp->m_super); in xfs_cowblocks_worker()
1005 spin_lock(&ip->i_flags_lock); in xfs_reclaim_inode_grab()
1009 spin_unlock(&ip->i_flags_lock); in xfs_reclaim_inode_grab()
1013 spin_unlock(&ip->i_flags_lock); in xfs_reclaim_inode_grab()
1018 * Inode reclaim is non-blocking, so the default action if progress cannot be
1024 * We do no IO here - if callers require inodes to be cleaned they must push the
1026 * done in the background in a non-blocking manner, and enables memory reclaim
1034 xfs_ino_t ino = ip->i_ino; /* for radix_tree_delete */ in xfs_reclaim_inode()
1041 if (XFS_FORCED_SHUTDOWN(ip->i_mount)) { in xfs_reclaim_inode()
1064 spin_lock(&ip->i_flags_lock); in xfs_reclaim_inode()
1065 ip->i_flags = XFS_IRECLAIM; in xfs_reclaim_inode()
1066 ip->i_ino = 0; in xfs_reclaim_inode()
1067 spin_unlock(&ip->i_flags_lock); in xfs_reclaim_inode()
1071 XFS_STATS_INC(ip->i_mount, xs_ig_reclaims); in xfs_reclaim_inode()
1073 * Remove the inode from the per-AG radix tree. in xfs_reclaim_inode()
1079 spin_lock(&pag->pag_ici_lock); in xfs_reclaim_inode()
1080 if (!radix_tree_delete(&pag->pag_ici_root, in xfs_reclaim_inode()
1081 XFS_INO_TO_AGINO(ip->i_mount, ino))) in xfs_reclaim_inode()
1084 spin_unlock(&pag->pag_ici_lock); in xfs_reclaim_inode()
1116 * Returns non-zero if any AGs or inodes were skipped in the reclaim pass
1130 int done = 0; in xfs_reclaim_inodes_ag() local
1133 ag = pag->pag_agno + 1; in xfs_reclaim_inodes_ag()
1135 first_index = READ_ONCE(pag->pag_ici_reclaim_cursor); in xfs_reclaim_inodes_ag()
1142 &pag->pag_ici_root, in xfs_reclaim_inodes_ag()
1147 done = 1; in xfs_reclaim_inodes_ag()
1159 if (done || !xfs_reclaim_inode_grab(ip)) in xfs_reclaim_inodes_ag()
1176 if (XFS_INO_TO_AGNO(mp, ip->i_ino) != in xfs_reclaim_inodes_ag()
1177 pag->pag_agno) in xfs_reclaim_inodes_ag()
1179 first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); in xfs_reclaim_inodes_ag()
1180 if (first_index < XFS_INO_TO_AGINO(mp, ip->i_ino)) in xfs_reclaim_inodes_ag()
1181 done = 1; in xfs_reclaim_inodes_ag()
1192 *nr_to_scan -= XFS_LOOKUP_BATCH; in xfs_reclaim_inodes_ag()
1194 } while (nr_found && !done && *nr_to_scan > 0); in xfs_reclaim_inodes_ag()
1196 if (done) in xfs_reclaim_inodes_ag()
1198 WRITE_ONCE(pag->pag_ici_reclaim_cursor, first_index); in xfs_reclaim_inodes_ag()
1209 while (radix_tree_tagged(&mp->m_perag_tree, XFS_ICI_RECLAIM_TAG)) { in xfs_reclaim_inodes()
1210 xfs_ail_push_all_sync(mp->m_ail); in xfs_reclaim_inodes()
1229 xfs_ail_push_all(mp->m_ail); in xfs_reclaim_inodes_nr()
1248 ag = pag->pag_agno + 1; in xfs_reclaim_inodes_count()
1249 reclaimable += pag->pag_ici_reclaimable; in xfs_reclaim_inodes_count()
1260 if ((eofb->eof_flags & XFS_EOF_FLAGS_UID) && in xfs_inode_match_id()
1261 !uid_eq(VFS_I(ip)->i_uid, eofb->eof_uid)) in xfs_inode_match_id()
1264 if ((eofb->eof_flags & XFS_EOF_FLAGS_GID) && in xfs_inode_match_id()
1265 !gid_eq(VFS_I(ip)->i_gid, eofb->eof_gid)) in xfs_inode_match_id()
1268 if ((eofb->eof_flags & XFS_EOF_FLAGS_PRID) && in xfs_inode_match_id()
1269 ip->i_d.di_projid != eofb->eof_prid) in xfs_inode_match_id()
1276 * A union-based inode filtering algorithm. Process the inode if any of the
1284 if ((eofb->eof_flags & XFS_EOF_FLAGS_UID) && in xfs_inode_match_id_union()
1285 uid_eq(VFS_I(ip)->i_uid, eofb->eof_uid)) in xfs_inode_match_id_union()
1288 if ((eofb->eof_flags & XFS_EOF_FLAGS_GID) && in xfs_inode_match_id_union()
1289 gid_eq(VFS_I(ip)->i_gid, eofb->eof_gid)) in xfs_inode_match_id_union()
1292 if ((eofb->eof_flags & XFS_EOF_FLAGS_PRID) && in xfs_inode_match_id_union()
1293 ip->i_d.di_projid == eofb->eof_prid) in xfs_inode_match_id_union()
1314 if (eofb->eof_flags & XFS_EOF_FLAGS_UNION) in xfs_inode_matches_eofb()
1322 if ((eofb->eof_flags & XFS_EOF_FLAGS_MINFILESIZE) && in xfs_inode_matches_eofb()
1323 XFS_ISIZE(ip) < eofb->eof_min_file_size) in xfs_inode_matches_eofb()
1356 wait = eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC); in xfs_inode_free_eofblocks()
1359 /* inode could be preallocated or append-only */ in xfs_inode_free_eofblocks()
1369 if (!wait && mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY)) in xfs_inode_free_eofblocks()
1376 * If the caller is waiting, return -EAGAIN to keep the background in xfs_inode_free_eofblocks()
1381 return -EAGAIN; in xfs_inode_free_eofblocks()
1422 if (XFS_IS_UQUOTA_ENFORCED(ip->i_mount)) { in __xfs_inode_free_quota_eofblocks()
1425 eofb.eof_uid = VFS_I(ip)->i_uid; in __xfs_inode_free_quota_eofblocks()
1431 if (XFS_IS_GQUOTA_ENFORCED(ip->i_mount)) { in __xfs_inode_free_quota_eofblocks()
1434 eofb.eof_gid = VFS_I(ip)->i_gid; in __xfs_inode_free_quota_eofblocks()
1441 execute(ip->i_mount, &eofb); in __xfs_inode_free_quota_eofblocks()
1476 struct xfs_mount *mp = ip->i_mount; in __xfs_inode_set_blocks_tag()
1484 if (ip->i_flags & xfs_iflag_for_tag(tag)) in __xfs_inode_set_blocks_tag()
1486 spin_lock(&ip->i_flags_lock); in __xfs_inode_set_blocks_tag()
1487 ip->i_flags |= xfs_iflag_for_tag(tag); in __xfs_inode_set_blocks_tag()
1488 spin_unlock(&ip->i_flags_lock); in __xfs_inode_set_blocks_tag()
1490 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in __xfs_inode_set_blocks_tag()
1491 spin_lock(&pag->pag_ici_lock); in __xfs_inode_set_blocks_tag()
1493 tagged = radix_tree_tagged(&pag->pag_ici_root, tag); in __xfs_inode_set_blocks_tag()
1494 radix_tree_tag_set(&pag->pag_ici_root, in __xfs_inode_set_blocks_tag()
1495 XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino), tag); in __xfs_inode_set_blocks_tag()
1498 spin_lock(&ip->i_mount->m_perag_lock); in __xfs_inode_set_blocks_tag()
1499 radix_tree_tag_set(&ip->i_mount->m_perag_tree, in __xfs_inode_set_blocks_tag()
1500 XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino), in __xfs_inode_set_blocks_tag()
1502 spin_unlock(&ip->i_mount->m_perag_lock); in __xfs_inode_set_blocks_tag()
1505 execute(ip->i_mount); in __xfs_inode_set_blocks_tag()
1507 set_tp(ip->i_mount, pag->pag_agno, -1, _RET_IP_); in __xfs_inode_set_blocks_tag()
1510 spin_unlock(&pag->pag_ici_lock); in __xfs_inode_set_blocks_tag()
1531 struct xfs_mount *mp = ip->i_mount; in __xfs_inode_clear_blocks_tag()
1534 spin_lock(&ip->i_flags_lock); in __xfs_inode_clear_blocks_tag()
1535 ip->i_flags &= ~xfs_iflag_for_tag(tag); in __xfs_inode_clear_blocks_tag()
1536 spin_unlock(&ip->i_flags_lock); in __xfs_inode_clear_blocks_tag()
1538 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); in __xfs_inode_clear_blocks_tag()
1539 spin_lock(&pag->pag_ici_lock); in __xfs_inode_clear_blocks_tag()
1541 radix_tree_tag_clear(&pag->pag_ici_root, in __xfs_inode_clear_blocks_tag()
1542 XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino), tag); in __xfs_inode_clear_blocks_tag()
1543 if (!radix_tree_tagged(&pag->pag_ici_root, tag)) { in __xfs_inode_clear_blocks_tag()
1545 spin_lock(&ip->i_mount->m_perag_lock); in __xfs_inode_clear_blocks_tag()
1546 radix_tree_tag_clear(&ip->i_mount->m_perag_tree, in __xfs_inode_clear_blocks_tag()
1547 XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino), in __xfs_inode_clear_blocks_tag()
1549 spin_unlock(&ip->i_mount->m_perag_lock); in __xfs_inode_clear_blocks_tag()
1550 clear_tp(ip->i_mount, pag->pag_agno, -1, _RET_IP_); in __xfs_inode_clear_blocks_tag()
1553 spin_unlock(&pag->pag_ici_lock); in __xfs_inode_clear_blocks_tag()
1589 if ((VFS_I(ip)->i_state & I_DIRTY_PAGES) || in xfs_prep_free_cowblocks()
1590 mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_DIRTY) || in xfs_prep_free_cowblocks()
1591 mapping_tagged(VFS_I(ip)->i_mapping, PAGECACHE_TAG_WRITEBACK) || in xfs_prep_free_cowblocks()
1592 atomic_read(&VFS_I(ip)->i_dio_count)) in xfs_prep_free_cowblocks()
1676 /* Disable post-EOF and CoW block auto-reclamation. */
1681 cancel_delayed_work_sync(&mp->m_eofblocks_work); in xfs_stop_block_reaping()
1682 cancel_delayed_work_sync(&mp->m_cowblocks_work); in xfs_stop_block_reaping()
1685 /* Enable post-EOF and CoW block auto-reclamation. */