Wrap the bufobj operations in macros: BO_STRATEGY() and BO_WRITE()

This commit is contained in:
Poul-Henning Kamp 2005-01-11 09:10:46 +00:00
parent 1c7adc9b77
commit 0391e5a151
11 changed files with 14 additions and 11 deletions

View File

@ -733,7 +733,7 @@ cd9660_strategy(ap)
}
bp->b_iooffset = dbtob(bp->b_blkno);
bo = ip->i_mnt->im_bo;
bo->bo_ops->bop_strategy(bo, bp);
BO_STRATEGY(bo, bp);
return (0);
}

View File

@ -674,7 +674,7 @@ hpfs_strategy(ap)
}
bp->b_iooffset = dbtob(bp->b_blkno);
bo = hp->h_hpmp->hpm_bo;
bo->bo_ops->bop_strategy(bo, bp);
BO_STRATEGY(bo, bp);
return (0);
}

View File

@ -1803,7 +1803,7 @@ msdosfs_strategy(ap)
*/
bp->b_iooffset = dbtob(bp->b_blkno);
bo = dep->de_pmp->pm_bo;
bo->bo_ops->bop_strategy(bo, bp);
BO_STRATEGY(bo, bp);
return (0);
}

View File

@ -848,7 +848,7 @@ udf_strategy(struct vop_strategy_args *a)
}
bo = node->udfmp->im_bo;
bp->b_iooffset = dbtob(bp->b_blkno);
bo->bo_ops->bop_strategy(bo, bp);
BO_STRATEGY(bo, bp);
return (0);
}

View File

@ -1432,7 +1432,7 @@ ext2_strategy(ap)
}
bp->b_iooffset = dbtob(bp->b_blkno);
bo = VFSTOEXT2(vp->v_mount)->um_bo;
bo->bo_ops->bop_strategy(bo, bp);
BO_STRATEGY(bo, bp);
return (0);
}

View File

@ -1432,7 +1432,7 @@ ext2_strategy(ap)
}
bp->b_iooffset = dbtob(bp->b_blkno);
bo = VFSTOEXT2(vp->v_mount)->um_bo;
bo->bo_ops->bop_strategy(bo, bp);
BO_STRATEGY(bo, bp);
return (0);
}

View File

@ -733,7 +733,7 @@ cd9660_strategy(ap)
}
bp->b_iooffset = dbtob(bp->b_blkno);
bo = ip->i_mnt->im_bo;
bo->bo_ops->bop_strategy(bo, bp);
BO_STRATEGY(bo, bp);
return (0);
}

View File

@ -399,7 +399,7 @@ bwrite(struct buf *bp)
KASSERT(bp->b_bufobj->bo_ops != NULL, ("bwrite: no bo_ops bp=%p", bp));
KASSERT(bp->b_bufobj->bo_ops->bop_write != NULL,
("bwrite: no bop_write bp=%p", bp));
return (bp->b_bufobj->bo_ops->bop_write(bp));
return (BO_WRITE(bp->b_bufobj, bp));
}
static __inline void
@ -411,7 +411,7 @@ bstrategy(struct buf *bp)
("bstrategy: no bo_ops bp=%p", bp));
KASSERT(bp->b_bufobj->bo_ops->bop_strategy != NULL,
("bstrategy: no bop_strategy bp=%p", bp));
bp->b_bufobj->bo_ops->bop_strategy(bp->b_bufobj, bp);
BO_STRATEGY(bp->b_bufobj, bp);
}
static __inline void

View File

@ -76,6 +76,9 @@ struct buf_ops {
b_strategy_t *bop_strategy;
};
#define BO_STRATEGY(bo, bp) ((bo)->bo_ops->bop_strategy((bo), (bp)))
#define BO_WRITE(bo, bp) ((bo)->bo_ops->bop_write((bp)))
struct bufobj {
struct mtx *bo_mtx; /* Mutex which protects "i" things */
struct bufv bo_clean; /* i Clean buffers */

View File

@ -252,7 +252,7 @@ ffs_rawread_readahead(struct vnode *vp,
if (vmapbuf(bp) < 0)
return EFAULT;
dp->v_bufobj.bo_ops->bop_strategy(&dp->v_bufobj, bp);
BO_STRATEGY(&dp->v_bufobj, bp);
return 0;
}

View File

@ -1949,7 +1949,7 @@ ufs_strategy(ap)
}
bp->b_iooffset = dbtob(bp->b_blkno);
bo = ip->i_umbufobj;
bo->bo_ops->bop_strategy(bo, bp);
BO_STRATEGY(bo, bp);
return (0);
}