kmem_zone_t *xfs_log_ticket_zone;
-#define xlog_write_adv_cnt(ptr, len, off, bytes) \
- { (ptr) += (bytes); \
- (len) -= (bytes); \
- (off) += (bytes);}
-
/* Local miscellaneous function prototypes */
STATIC int xlog_commit_record(struct log *log, struct xlog_ticket *ticket,
xlog_in_core_t **, xfs_lsn_t *);
uint flags);
#if defined(DEBUG)
-STATIC void xlog_verify_dest_ptr(xlog_t *log, __psint_t ptr);
+STATIC void xlog_verify_dest_ptr(xlog_t *log, char *ptr);
STATIC void xlog_verify_grant_head(xlog_t *log, int equals);
STATIC void xlog_verify_iclog(xlog_t *log, xlog_in_core_t *iclog,
int count, boolean_t syncing);
*/
static int
xlog_write_start_rec(
- __psint_t ptr,
+ struct xlog_op_header *ophdr,
struct xlog_ticket *ticket)
{
- struct xlog_op_header *ophdr = (struct xlog_op_header *)ptr;
-
if (!(ticket->t_flags & XLOG_TIC_INITED))
return 0;
static xlog_op_header_t *
xlog_write_setup_ophdr(
struct log *log,
- __psint_t ptr,
+ struct xlog_op_header *ophdr,
struct xlog_ticket *ticket,
uint flags)
{
- struct xlog_op_header *ophdr = (struct xlog_op_header *)ptr;
-
ophdr->oh_tid = cpu_to_be32(ticket->t_tid);
ophdr->oh_clientid = ticket->t_clientid;
ophdr->oh_res2 = 0;
lv = log_vector;
vecp = lv->lv_iovecp;
while (lv && index < lv->lv_niovecs) {
- __psint_t ptr;
+ void *ptr;
int log_offset;
error = xlog_state_get_iclog_space(log, len, &iclog, ticket,
return error;
ASSERT(log_offset <= iclog->ic_size - 1);
- ptr = (__psint_t)((char *)iclog->ic_datap + log_offset);
+ ptr = iclog->ic_datap + log_offset;
/* start_lsn is the first lsn written to. That's all we need. */
if (!*start_lsn)
int copy_off;
ASSERT(reg->i_len % sizeof(__int32_t) == 0);
- ASSERT((__psint_t)ptr % sizeof(__int32_t) == 0);
+ ASSERT((unsigned long)ptr % sizeof(__int32_t) == 0);
start_rec_copy = xlog_write_start_rec(ptr, ticket);
if (start_rec_copy) {
record_cnt++;
- xlog_write_adv_cnt(ptr, len, log_offset,
+ xlog_write_adv_cnt(&ptr, &len, &log_offset,
start_rec_copy);
}
if (!ophdr)
return XFS_ERROR(EIO);
- xlog_write_adv_cnt(ptr, len, log_offset,
+ xlog_write_adv_cnt(&ptr, &len, &log_offset,
sizeof(struct xlog_op_header));
len += xlog_write_setup_copy(ticket, ophdr,
/* copy region */
ASSERT(copy_len >= 0);
- memcpy((xfs_caddr_t)ptr, reg->i_addr + copy_off,
- copy_len);
- xlog_write_adv_cnt(ptr, len, log_offset, copy_len);
+ memcpy(ptr, reg->i_addr + copy_off, copy_len);
+ xlog_write_adv_cnt(&ptr, &len, &log_offset, copy_len);
copy_len += start_rec_copy + sizeof(xlog_op_header_t);
record_cnt++;
* part of the log in case we trash the log structure.
*/
void
-xlog_verify_dest_ptr(xlog_t *log,
- __psint_t ptr)
+xlog_verify_dest_ptr(
+ struct log *log,
+ char *ptr)
{
int i;
int good_ptr = 0;
- for (i=0; i < log->l_iclog_bufs; i++) {
- if (ptr >= (__psint_t)log->l_iclog_bak[i] &&
- ptr <= (__psint_t)log->l_iclog_bak[i]+log->l_iclog_size)
+ for (i = 0; i < log->l_iclog_bufs; i++) {
+ if (ptr >= log->l_iclog_bak[i] &&
+ ptr <= log->l_iclog_bak[i] + log->l_iclog_size)
good_ptr++;
}
- if (! good_ptr)
+
+ if (!good_ptr)
xlog_panic("xlog_verify_dest_ptr: invalid ptr");
-} /* xlog_verify_dest_ptr */
+}
STATIC void
xlog_verify_grant_head(xlog_t *log, int equals)