+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2006 Silicon Graphics, Inc.
* All Rights Reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it would be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
struct xfs_buf *buf = (struct xfs_buf *)private;
if (buf &&
- (XFS_BUF_COUNT(buf) < (int)(ptr - XFS_BUF_PTR(buf)) + offset))
+ (buf->b_bcount < (int)(ptr - (char *)buf->b_addr) + offset))
abort();
return ptr + offset;
* previous cycle.
*/
len = ((version == 2) && sunit) ? BTOBB(sunit) : 2;
- len = MAX(len, 2);
+ len = max(len, 2);
lsn = xlog_assign_lsn(cycle, 0);
if (cycle == XLOG_INIT_CYCLE)
tail_lsn = lsn;
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
head->h_prev_block = cpu_to_be32(-1);
head->h_num_logops = cpu_to_be32(1);
head->h_fmt = cpu_to_be32(fmt);
- head->h_size = cpu_to_be32(MAX(sunit, XLOG_BIG_RECORD_BSIZE));
+ head->h_size = cpu_to_be32(max(sunit, XLOG_BIG_RECORD_BSIZE));
head->h_lsn = cpu_to_be64(lsn);
head->h_tail_lsn = cpu_to_be64(tail_lsn);
* minimum (1 hdr blk + 1 data blk). The record length is the total
* minus however many header blocks are required.
*/
- head->h_len = cpu_to_be32(MAX(BBTOB(2), sunit) - hdrs * BBSIZE);
+ head->h_len = cpu_to_be32(max(BBTOB(2), sunit) - hdrs * BBSIZE);
/*
* Write out the unmount record, pack the first word into the record
* the cycle. We don't need to pack any of these blocks because the
* cycle data in the headers has already been zeroed.
*/
- len = MAX(len, hdrs + 1);
+ len = max(len, hdrs + 1);
for (i = hdrs + 1; i < len; i++) {
p = nextfunc(p, BBSIZE, private);
memset(p, 0, BBSIZE);
{
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);