#define XFS_BUF_DADDR_NULL ((xfs_daddr_t) (-1LL))
-#define XFS_BUF_PTR(bp) ((char *)(bp)->b_addr)
#define xfs_buf_offset(bp, offset) ((bp)->b_addr + (offset))
#define XFS_BUF_ADDR(bp) ((bp)->b_bn)
#define XFS_BUF_SIZE(bp) ((bp)->b_bcount)
struct xfs_buf *buf = (struct xfs_buf *)private;
if (buf &&
- (XFS_BUF_COUNT(buf) < (int)(ptr - XFS_BUF_PTR(buf)) + offset))
+ (XFS_BUF_COUNT(buf) < (int)(ptr - (char *)buf->b_addr) + offset))
abort();
return ptr + offset;
ptr = dptr;
if (btp) {
bp = libxfs_getbufr(btp, start, len);
- ptr = XFS_BUF_PTR(bp);
+ ptr = bp->b_addr;
}
libxfs_log_header(ptr, fs_uuid, version, sunit, fmt, lsn, tail_lsn,
next, bp);
ptr = dptr;
if (btp) {
bp = libxfs_getbufr(btp, blk, len);
- ptr = XFS_BUF_PTR(bp);
+ ptr = bp->b_addr;
}
/*
* Note: pass the full buffer length as the sunit to initialize
{
int fd;
int error = 0;
- char *buf;
+ void *buf;
int i;
fd = libxfs_device_to_fd(btp->dev);
LIBXFS_BBTOOFF64(bp->b_bn), bp->b_flags);
} else {
int i;
- char *buf = bp->b_addr;
+ void *buf = bp->b_addr;
for (i = 0; i < bp->b_nmaps; i++) {
off64_t offset = LIBXFS_BBTOOFF64(bp->b_maps[i].bm_bn);
first_blk = 0; /* read first block */
bp = xlog_get_bp(log, 1);
xlog_bread_noalign(log, 0, 1, bp);
- first_half_cycle = xlog_get_cycle(XFS_BUF_PTR(bp));
+ first_half_cycle = xlog_get_cycle(bp->b_addr);
*last_blk = log->l_logBBsize-1; /* read last block */
xlog_bread_noalign(log, *last_blk, 1, bp);
- last_half_cycle = xlog_get_cycle(XFS_BUF_PTR(bp));
+ last_half_cycle = xlog_get_cycle(bp->b_addr);
ASSERT(last_half_cycle != 0);
if (first_half_cycle == last_half_cycle) /* all cycle nos are same */
d = XFS_FSB_TO_DADDR(mp, map.br_startblock);
bp = libxfs_trans_get_buf(logit ? tp : 0, mp->m_dev, d,
nb << mp->m_blkbb_log, 0);
- memmove(XFS_BUF_PTR(bp), buf, len);
+ memmove(bp->b_addr, buf, len);
if (len < XFS_BUF_COUNT(bp))
- memset(XFS_BUF_PTR(bp) + len, 0, XFS_BUF_COUNT(bp) - len);
+ memset((char *)bp->b_addr + len, 0,
+ XFS_BUF_COUNT(bp) - len);
if (logit)
libxfs_trans_log_buf(tp, bp, 0, XFS_BUF_COUNT(bp) - 1);
else
*/
buf = libxfs_getbuf(mp->m_ddev_targp, (xi->dsize - whack_blks),
whack_blks);
- memset(XFS_BUF_PTR(buf), 0, WHACK_SIZE);
+ memset(buf->b_addr, 0, WHACK_SIZE);
libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
libxfs_purgebuf(buf);
* ext[2,3] and reiserfs (64k) - and hopefully all else.
*/
buf = libxfs_getbuf(mp->m_ddev_targp, 0, whack_blks);
- memset(XFS_BUF_PTR(buf), 0, WHACK_SIZE);
+ memset(buf->b_addr, 0, WHACK_SIZE);
libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
libxfs_purgebuf(buf);
/* OK, now write the superblock... */
buf = libxfs_getbuf(mp->m_ddev_targp, XFS_SB_DADDR, XFS_FSS_TO_BB(mp, 1));
buf->b_ops = &xfs_sb_buf_ops;
- memset(XFS_BUF_PTR(buf), 0, cfg->sectorsize);
- libxfs_sb_to_disk((void *)XFS_BUF_PTR(buf), sbp);
+ memset(buf->b_addr, 0, cfg->sectorsize);
+ libxfs_sb_to_disk(buf->b_addr, sbp);
libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
libxfs_purgebuf(buf);
buf = libxfs_getbuf(mp->m_rtdev_targp,
XFS_FSB_TO_BB(mp, cfg->rtblocks - 1LL),
BTOBB(cfg->blocksize));
- memset(XFS_BUF_PTR(buf), 0, cfg->blocksize);
+ memset(buf->b_addr, 0, cfg->blocksize);
libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
libxfs_purgebuf(buf);
}
XFS_AG_DADDR(mp, agno, XFS_SB_DADDR),
XFS_FSS_TO_BB(mp, 1));
buf->b_ops = &xfs_sb_buf_ops;
- memset(XFS_BUF_PTR(buf), 0, cfg->sectorsize);
- libxfs_sb_to_disk((void *)XFS_BUF_PTR(buf), sbp);
+ memset(buf->b_addr, 0, cfg->sectorsize);
+ libxfs_sb_to_disk(buf->b_addr, sbp);
libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
/*
+ sizeof(sb->sb_dirblklog);
/* Check the buffer we read from disk for garbage outside size */
- for (ip = XFS_BUF_PTR(sbuf) + size;
- ip < XFS_BUF_PTR(sbuf) + mp->m_sb.sb_sectsize;
+ for (ip = (char *)sbuf->b_addr + size;
+ ip < (char *)sbuf->b_addr + mp->m_sb.sb_sectsize;
ip++) {
if (*ip) {
do_bzero = 1;
memcpy(&tmpuuid, &sb->sb_meta_uuid, sizeof(uuid_t));
memset((void *)((intptr_t)sb + size), 0,
mp->m_sb.sb_sectsize - size);
- memset(XFS_BUF_PTR(sbuf) + size, 0,
+ memset((char *)sbuf->b_addr + size, 0,
mp->m_sb.sb_sectsize - size);
/* Preserve meta_uuid so we don't fail uuid checks */
memcpy(&sb->sb_meta_uuid, &tmpuuid, sizeof(uuid_t));
return(1);
}
- memmove(XFS_BUF_PTR(bp), bmp, mp->m_sb.sb_blocksize);
+ memmove(bp->b_addr, bmp, mp->m_sb.sb_blocksize);
libxfs_trans_log_buf(tp, bp, 0, mp->m_sb.sb_blocksize - 1);
return(1);
}
- memmove(XFS_BUF_PTR(bp), smp, mp->m_sb.sb_blocksize);
+ memmove(bp->b_addr, smp, mp->m_sb.sb_blocksize);
libxfs_trans_log_buf(tp, bp, 0, mp->m_sb.sb_blocksize - 1);
size = XFS_BUF_SIZE(bplist[i]);
if (len < size)
break;
- memcpy(XFS_BUF_PTR(bplist[i]), pbuf, size);
+ memcpy(bplist[i]->b_addr, pbuf, size);
bplist[i]->b_flags |= (LIBXFS_B_UPTODATE |
LIBXFS_B_UNCHECKED);
len -= size;