aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_sync.c
diff options
context:
space:
mode:
authorDavid Chinner <david@fromorbit.com>2008-10-30 02:37:26 -0400
committerLachlan McIlroy <lachlan@sgi.com>2008-10-30 02:37:26 -0400
commit396beb85311689e38634926058d9a3bb0576ca8a (patch)
tree58b3e6904d9618930fe6c0f8abba52aaeea00130 /fs/xfs/linux-2.6/xfs_sync.c
parent1dc3318ae1c1cc11f9fb8279a806de448e2b90e8 (diff)
[XFS] mark inodes for reclaim via a tag in the inode radix tree
Prepare for removing the deleted inode list by marking inodes for reclaim in the inode radix trees so that we can use the radix trees to find reclaimable inodes. SGI-PV: 988142 SGI-Modid: xfs-linux-melb:xfs-kern:32331a Signed-off-by: David Chinner <david@fromorbit.com> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com> Signed-off-by: Christoph Hellwig <hch@infradead.org>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_sync.c')
-rw-r--r--fs/xfs/linux-2.6/xfs_sync.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c
index 34413ceaea9f..9e7f4dccab72 100644
--- a/fs/xfs/linux-2.6/xfs_sync.c
+++ b/fs/xfs/linux-2.6/xfs_sync.c
@@ -644,6 +644,47 @@ xfs_reclaim_inode(
644 return 0; 644 return 0;
645} 645}
646 646
647void
648xfs_inode_set_reclaim_tag(
649 xfs_inode_t *ip)
650{
651 xfs_mount_t *mp = ip->i_mount;
652 xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino);
653
654 read_lock(&pag->pag_ici_lock);
655 spin_lock(&ip->i_flags_lock);
656 radix_tree_tag_set(&pag->pag_ici_root,
657 XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG);
658 spin_unlock(&ip->i_flags_lock);
659 read_unlock(&pag->pag_ici_lock);
660 xfs_put_perag(mp, pag);
661}
662
663void
664__xfs_inode_clear_reclaim_tag(
665 xfs_mount_t *mp,
666 xfs_perag_t *pag,
667 xfs_inode_t *ip)
668{
669 radix_tree_tag_clear(&pag->pag_ici_root,
670 XFS_INO_TO_AGINO(mp, ip->i_ino), XFS_ICI_RECLAIM_TAG);
671}
672
673void
674xfs_inode_clear_reclaim_tag(
675 xfs_inode_t *ip)
676{
677 xfs_mount_t *mp = ip->i_mount;
678 xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino);
679
680 read_lock(&pag->pag_ici_lock);
681 spin_lock(&ip->i_flags_lock);
682 __xfs_inode_clear_reclaim_tag(mp, pag, ip);
683 spin_unlock(&ip->i_flags_lock);
684 read_unlock(&pag->pag_ici_lock);
685 xfs_put_perag(mp, pag);
686}
687
647int 688int
648xfs_reclaim_inodes( 689xfs_reclaim_inodes(
649 xfs_mount_t *mp, 690 xfs_mount_t *mp,