void xfs_inode_set_eofblocks_tag( xfs_inode_t *ip) { struct xfs_mount *mp = ip->i_mount; struct xfs_perag *pag; int tagged; pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino)); spin_lock(&pag->pag_ici_lock); trace_xfs_inode_set_eofblocks_tag(ip); tagged = radix_tree_tagged(&pag->pag_ici_root, XFS_ICI_EOFBLOCKS_TAG); radix_tree_tag_set(&pag->pag_ici_root, XFS_INO_TO_AGINO(ip->i_mount, ip->i_ino), XFS_ICI_EOFBLOCKS_TAG); if (!tagged) { /* propagate the eofblocks tag up into the perag radix tree */ spin_lock(&ip->i_mount->m_perag_lock); radix_tree_tag_set(&ip->i_mount->m_perag_tree, XFS_INO_TO_AGNO(ip->i_mount, ip->i_ino), XFS_ICI_EOFBLOCKS_TAG); spin_unlock(&ip->i_mount->m_perag_lock); /* kick off background trimming */ xfs_queue_eofblocks(ip->i_mount); trace_xfs_perag_set_eofblocks(ip->i_mount, pag->pag_agno, -1, _RET_IP_); } spin_unlock(&pag->pag_ici_lock); xfs_perag_put(pag); }
/* Enable post-EOF and CoW block auto-reclamation. */ void xfs_icache_enable_reclaim( struct xfs_mount *mp) { xfs_queue_eofblocks(mp); xfs_queue_cowblocks(mp); }
void xfs_eofblocks_worker( struct work_struct *work) { struct xfs_mount *mp = container_of(to_delayed_work(work), struct xfs_mount, m_eofblocks_work); xfs_icache_free_eofblocks(mp, NULL); xfs_queue_eofblocks(mp); }