if (error)
return -EAGAIN;
- error = xfs_imap_to_bp(pag_mount(pag), tp, &imap, &bp);
+ error = xfs_read_icluster(pag_mount(pag), tp, imap.im_blkno, &bp);
if (error)
return -EAGAIN;
/*
- * This routine is called to map an inode to the buffer containing the on-disk
- * version of the inode. It returns a pointer to the buffer containing the
- * on-disk inode in the bpp parameter.
+ * Read the inode cluster at @bno and return it in @bpp.
*/
int
-xfs_imap_to_bp(
+xfs_read_icluster(
struct xfs_mount *mp,
struct xfs_trans *tp,
- struct xfs_imap *imap,
+ xfs_daddr_t bno,
struct xfs_buf **bpp)
{
int error;
- error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, imap->im_blkno,
+ error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, bno,
XFS_FSB_TO_BB(mp, M_IGEO(mp)->blocks_per_cluster),
0, bpp, &xfs_inode_buf_ops);
if (xfs_metadata_is_sick(error))
- xfs_agno_mark_sick(mp, xfs_daddr_to_agno(mp, imap->im_blkno),
+ xfs_agno_mark_sick(mp, xfs_daddr_to_agno(mp, bno),
XFS_SICK_AG_INODES);
return error;
}
/*
* Inode location information. Stored in the inode and passed to
- * xfs_imap_to_bp() to get a buffer and dinode for a given inode.
+ * xfs_read_icluster() to get a buffer and dinode for a given inode.
*/
struct xfs_imap {
xfs_daddr_t im_blkno; /* starting BB of inode chunk */
unsigned short im_boffset; /* inode offset in block in bytes */
};
-int xfs_imap_to_bp(struct xfs_mount *mp, struct xfs_trans *tp,
- struct xfs_imap *imap, struct xfs_buf **bpp);
+int xfs_read_icluster(struct xfs_mount *mp, struct xfs_trans *tp,
+ xfs_daddr_t bno, struct xfs_buf **bpp);
void xfs_dinode_calc_crc(struct xfs_mount *mp, struct xfs_dinode *dip);
void xfs_inode_to_disk(struct xfs_inode *ip, struct xfs_dinode *to,
xfs_lsn_t lsn);
&XFS_RMAP_OINFO_INODES);
/* Grab the inode cluster buffer. */
- error = xfs_imap_to_bp(mp, bs->cur->bc_tp, &imap, &cluster_bp);
+ error = xfs_read_icluster(mp, bs->cur->bc_tp, imap.im_blkno,
+ &cluster_bp);
if (!xchk_btree_xref_process_error(bs->sc, bs->cur, 0, &error))
return error;
struct xrep_ibt *ri,
xfs_agblock_t cluster_bno)
{
- struct xfs_imap imap;
struct xfs_buf *cluster_bp;
struct xfs_scrub *sc = ri->sc;
struct xfs_mount *mp = sc->mp;
* inobt because imap_to_bp directly maps the buffer without touching
* either inode btree.
*/
- imap.im_blkno = xfs_agbno_to_daddr(sc->sa.pag, cluster_bno);
- imap.im_boffset = 0;
- error = xfs_imap_to_bp(mp, sc->tp, &imap, &cluster_bp);
+ error = xfs_read_icluster(mp, sc->tp,
+ xfs_agbno_to_daddr(sc->sa.pag, cluster_bno),
+ &cluster_bp);
if (error)
return error;
} else {
struct xfs_buf *bp;
- error = xfs_imap_to_bp(mp, tp, &ip->i_imap, &bp);
+ error = xfs_read_icluster(mp, tp, ip->i_imap.im_blkno, &bp);
if (error)
goto out_destroy;
* here.
*/
spin_unlock(&iip->ili_lock);
- error = xfs_imap_to_bp(ip->i_mount, tp, &ip->i_imap, &bp);
+ error = xfs_read_icluster(ip->i_mount, tp, ip->i_imap.im_blkno,
+ &bp);
if (error)
return error;
int offset;
int error;
- error = xfs_imap_to_bp(tp->t_mountp, tp, &ip->i_imap, &ibp);
+ error = xfs_read_icluster(tp->t_mountp, tp, ip->i_imap.im_blkno, &ibp);
if (error)
return error;
/*