blk_start_plug(&plug);
list_for_each_entry(busyp, &extents->extent_list, list) {
- trace_xfs_discard_extent(mp, busyp->agno, busyp->bno,
+ trace_xfs_discard_extent(mp, busyp->pag->pag_agno, busyp->bno,
busyp->length);
error = __blkdev_issue_discard(mp->m_ddev_targp->bt_bdev,
- XFS_AGB_TO_DADDR(mp, busyp->agno, busyp->bno),
+ xfs_agbno_to_daddr(busyp->pag, busyp->bno),
XFS_FSB_TO_BB(mp, busyp->length),
GFP_KERNEL, &bio);
if (error && error != -EOPNOTSUPP) {
new = kzalloc(sizeof(struct xfs_extent_busy),
GFP_KERNEL | __GFP_NOFAIL);
- new->agno = pag->pag_agno;
+ new->pag = xfs_perag_hold(pag);
new->bno = bno;
new->length = len;
INIT_LIST_HEAD(&new->list);
busyp->flags = XFS_EXTENT_BUSY_DISCARDED;
return false;
}
- trace_xfs_extent_busy_clear(pag->pag_mount, busyp->agno,
- busyp->bno, busyp->length);
+ trace_xfs_extent_busy_clear(pag->pag_mount,
+ busyp->pag->pag_agno, busyp->bno,
+ busyp->length);
rb_erase(&busyp->rb_node, &pag->pagb_tree);
}
list_del_init(&busyp->list);
+ xfs_perag_put(busyp->pag);
kfree(busyp);
return true;
}
return;
do {
+ struct xfs_perag *pag = xfs_perag_hold(busyp->pag);
bool wakeup = false;
- struct xfs_perag *pag;
- pag = xfs_perag_get(mp, busyp->agno);
spin_lock(&pag->pagb_lock);
do {
next = list_next_entry(busyp, list);
wakeup = true;
busyp = next;
} while (!list_entry_is_head(busyp, list, list) &&
- busyp->agno == pag->pag_agno);
+ busyp->pag == pag);
if (wakeup) {
pag->pagb_gen++;
container_of(l2, struct xfs_extent_busy, list);
s32 diff;
- diff = b1->agno - b2->agno;
+ diff = b1->pag->pag_agno - b2->pag->pag_agno;
if (!diff)
diff = b1->bno - b2->bno;
return diff;