Merge branch 'xfs-misc-fixes-for-4.2-3' into for-next

This commit is contained in:
Dave Chinner 2015-06-23 08:49:01 +10:00
commit de50e16ffa
15 changed files with 77 additions and 91 deletions

View File

@ -51,8 +51,7 @@ xfs_icluster_size_fsb(
static inline struct xfs_dinode * static inline struct xfs_dinode *
xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o) xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o)
{ {
return (struct xfs_dinode *) return xfs_buf_offset(b, o << (mp)->m_sb.sb_inodelog);
(xfs_buf_offset(b, o << (mp)->m_sb.sb_inodelog));
} }
/* /*

View File

@ -46,8 +46,7 @@ xfs_inobp_check(
j = mp->m_inode_cluster_size >> mp->m_sb.sb_inodelog; j = mp->m_inode_cluster_size >> mp->m_sb.sb_inodelog;
for (i = 0; i < j; i++) { for (i = 0; i < j; i++) {
dip = (xfs_dinode_t *)xfs_buf_offset(bp, dip = xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize);
i * mp->m_sb.sb_inodesize);
if (!dip->di_next_unlinked) { if (!dip->di_next_unlinked) {
xfs_alert(mp, xfs_alert(mp,
"Detected bogus zero next_unlinked field in inode %d buffer 0x%llx.", "Detected bogus zero next_unlinked field in inode %d buffer 0x%llx.",
@ -86,8 +85,7 @@ xfs_inode_buf_verify(
int di_ok; int di_ok;
xfs_dinode_t *dip; xfs_dinode_t *dip;
dip = (struct xfs_dinode *)xfs_buf_offset(bp, dip = xfs_buf_offset(bp, (i << mp->m_sb.sb_inodelog));
(i << mp->m_sb.sb_inodelog));
di_ok = dip->di_magic == cpu_to_be16(XFS_DINODE_MAGIC) && di_ok = dip->di_magic == cpu_to_be16(XFS_DINODE_MAGIC) &&
XFS_DINODE_GOOD_VERSION(dip->di_version); XFS_DINODE_GOOD_VERSION(dip->di_version);
if (unlikely(XFS_TEST_ERROR(!di_ok, mp, if (unlikely(XFS_TEST_ERROR(!di_ok, mp,
@ -186,7 +184,7 @@ xfs_imap_to_bp(
} }
*bpp = bp; *bpp = bp;
*dipp = (struct xfs_dinode *)xfs_buf_offset(bp, imap->im_boffset); *dipp = xfs_buf_offset(bp, imap->im_boffset);
return 0; return 0;
} }

View File

@ -433,8 +433,14 @@ xfs_attr_inactive(
*/ */
xfs_trans_ijoin(trans, dp, 0); xfs_trans_ijoin(trans, dp, 0);
/* invalidate and truncate the attribute fork extents */ /*
if (dp->i_d.di_aformat != XFS_DINODE_FMT_LOCAL) { * Invalidate and truncate the attribute fork extents. Make sure the
* fork actually has attributes as otherwise the invalidation has no
* blocks to read and returns an error. In this case, just do the fork
* removal below.
*/
if (xfs_inode_hasattr(dp) &&
dp->i_d.di_aformat != XFS_DINODE_FMT_LOCAL) {
error = xfs_attr3_root_inactive(&trans, dp); error = xfs_attr3_root_inactive(&trans, dp);
if (error) if (error)
goto out_cancel; goto out_cancel;

View File

@ -1419,9 +1419,9 @@ xfs_buf_submit_wait(
return error; return error;
} }
xfs_caddr_t void *
xfs_buf_offset( xfs_buf_offset(
xfs_buf_t *bp, struct xfs_buf *bp,
size_t offset) size_t offset)
{ {
struct page *page; struct page *page;
@ -1431,7 +1431,7 @@ xfs_buf_offset(
offset += bp->b_offset; offset += bp->b_offset;
page = bp->b_pages[offset >> PAGE_SHIFT]; page = bp->b_pages[offset >> PAGE_SHIFT];
return (xfs_caddr_t)page_address(page) + (offset & (PAGE_SIZE-1)); return page_address(page) + (offset & (PAGE_SIZE-1));
} }
/* /*

View File

@ -299,7 +299,7 @@ extern void xfs_buf_iomove(xfs_buf_t *, size_t, size_t, void *,
xfs_buf_iomove((bp), (off), (len), NULL, XBRW_ZERO) xfs_buf_iomove((bp), (off), (len), NULL, XBRW_ZERO)
/* Buffer Utility Routines */ /* Buffer Utility Routines */
extern xfs_caddr_t xfs_buf_offset(xfs_buf_t *, size_t); extern void *xfs_buf_offset(struct xfs_buf *, size_t);
/* Delayed Write Buffer Routines */ /* Delayed Write Buffer Routines */
extern bool xfs_buf_delwri_queue(struct xfs_buf *, struct list_head *); extern bool xfs_buf_delwri_queue(struct xfs_buf *, struct list_head *);

View File

@ -127,7 +127,7 @@ xfs_error_report(
struct xfs_mount *mp, struct xfs_mount *mp,
const char *filename, const char *filename,
int linenum, int linenum,
inst_t *ra) void *ra)
{ {
if (level <= xfs_error_level) { if (level <= xfs_error_level) {
xfs_alert_tag(mp, XFS_PTAG_ERROR_REPORT, xfs_alert_tag(mp, XFS_PTAG_ERROR_REPORT,
@ -146,7 +146,7 @@ xfs_corruption_error(
void *p, void *p,
const char *filename, const char *filename,
int linenum, int linenum,
inst_t *ra) void *ra)
{ {
if (level <= xfs_error_level) if (level <= xfs_error_level)
xfs_hex_dump(p, 64); xfs_hex_dump(p, 64);

View File

@ -21,10 +21,10 @@
struct xfs_mount; struct xfs_mount;
extern void xfs_error_report(const char *tag, int level, struct xfs_mount *mp, extern void xfs_error_report(const char *tag, int level, struct xfs_mount *mp,
const char *filename, int linenum, inst_t *ra); const char *filename, int linenum, void *ra);
extern void xfs_corruption_error(const char *tag, int level, extern void xfs_corruption_error(const char *tag, int level,
struct xfs_mount *mp, void *p, const char *filename, struct xfs_mount *mp, void *p, const char *filename,
int linenum, inst_t *ra); int linenum, void *ra);
extern void xfs_verifier_error(struct xfs_buf *bp); extern void xfs_verifier_error(struct xfs_buf *bp);
#define XFS_ERROR_REPORT(e, lvl, mp) \ #define XFS_ERROR_REPORT(e, lvl, mp) \

View File

@ -239,7 +239,7 @@ xfs_efi_init(
xfs_log_item_init(mp, &efip->efi_item, XFS_LI_EFI, &xfs_efi_item_ops); xfs_log_item_init(mp, &efip->efi_item, XFS_LI_EFI, &xfs_efi_item_ops);
efip->efi_format.efi_nextents = nextents; efip->efi_format.efi_nextents = nextents;
efip->efi_format.efi_id = (__psint_t)(void*)efip; efip->efi_format.efi_id = (uintptr_t)(void *)efip;
atomic_set(&efip->efi_next_extent, 0); atomic_set(&efip->efi_next_extent, 0);
atomic_set(&efip->efi_refcount, 2); atomic_set(&efip->efi_refcount, 2);

View File

@ -3392,7 +3392,7 @@ xfs_iflush_int(
ASSERT(ip->i_d.di_version > 1); ASSERT(ip->i_d.di_version > 1);
/* set *dip = inode's place in the buffer */ /* set *dip = inode's place in the buffer */
dip = (xfs_dinode_t *)xfs_buf_offset(bp, ip->i_imap.im_boffset); dip = xfs_buf_offset(bp, ip->i_imap.im_boffset);
if (XFS_TEST_ERROR(dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC), if (XFS_TEST_ERROR(dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC),
mp, XFS_ERRTAG_IFLUSH_1, XFS_RANDOM_IFLUSH_1)) { mp, XFS_ERRTAG_IFLUSH_1, XFS_RANDOM_IFLUSH_1)) {

View File

@ -32,26 +32,12 @@ typedef unsigned int __uint32_t;
typedef signed long long int __int64_t; typedef signed long long int __int64_t;
typedef unsigned long long int __uint64_t; typedef unsigned long long int __uint64_t;
typedef __uint32_t inst_t; /* an instruction */
typedef __s64 xfs_off_t; /* <file offset> type */ typedef __s64 xfs_off_t; /* <file offset> type */
typedef unsigned long long xfs_ino_t; /* <inode> type */ typedef unsigned long long xfs_ino_t; /* <inode> type */
typedef __s64 xfs_daddr_t; /* <disk address> type */ typedef __s64 xfs_daddr_t; /* <disk address> type */
typedef char * xfs_caddr_t; /* <core address> type */
typedef __u32 xfs_dev_t; typedef __u32 xfs_dev_t;
typedef __u32 xfs_nlink_t; typedef __u32 xfs_nlink_t;
/* __psint_t is the same size as a pointer */
#if (BITS_PER_LONG == 32)
typedef __int32_t __psint_t;
typedef __uint32_t __psunsigned_t;
#elif (BITS_PER_LONG == 64)
typedef __int64_t __psint_t;
typedef __uint64_t __psunsigned_t;
#else
#error BITS_PER_LONG must be 32 or 64
#endif
#include "xfs_types.h" #include "xfs_types.h"
#include "kmem.h" #include "kmem.h"

View File

@ -109,7 +109,7 @@ xlog_ungrant_log_space(
STATIC void STATIC void
xlog_verify_dest_ptr( xlog_verify_dest_ptr(
struct xlog *log, struct xlog *log,
char *ptr); void *ptr);
STATIC void STATIC void
xlog_verify_grant_tail( xlog_verify_grant_tail(
struct xlog *log); struct xlog *log);
@ -1444,7 +1444,7 @@ xlog_alloc_log(
iclog->ic_bp = bp; iclog->ic_bp = bp;
iclog->ic_data = bp->b_addr; iclog->ic_data = bp->b_addr;
#ifdef DEBUG #ifdef DEBUG
log->l_iclog_bak[i] = (xfs_caddr_t)&(iclog->ic_header); log->l_iclog_bak[i] = &iclog->ic_header;
#endif #endif
head = &iclog->ic_header; head = &iclog->ic_header;
memset(head, 0, sizeof(xlog_rec_header_t)); memset(head, 0, sizeof(xlog_rec_header_t));
@ -1599,7 +1599,7 @@ xlog_pack_data(
int i, j, k; int i, j, k;
int size = iclog->ic_offset + roundoff; int size = iclog->ic_offset + roundoff;
__be32 cycle_lsn; __be32 cycle_lsn;
xfs_caddr_t dp; char *dp;
cycle_lsn = CYCLE_LSN_DISK(iclog->ic_header.h_lsn); cycle_lsn = CYCLE_LSN_DISK(iclog->ic_header.h_lsn);
@ -3661,7 +3661,7 @@ xlog_ticket_alloc(
void void
xlog_verify_dest_ptr( xlog_verify_dest_ptr(
struct xlog *log, struct xlog *log,
char *ptr) void *ptr)
{ {
int i; int i;
int good_ptr = 0; int good_ptr = 0;
@ -3764,9 +3764,8 @@ xlog_verify_iclog(
xlog_op_header_t *ophead; xlog_op_header_t *ophead;
xlog_in_core_t *icptr; xlog_in_core_t *icptr;
xlog_in_core_2_t *xhdr; xlog_in_core_2_t *xhdr;
xfs_caddr_t ptr; void *base_ptr, *ptr, *p;
xfs_caddr_t base_ptr; ptrdiff_t field_offset;
__psint_t field_offset;
__uint8_t clientid; __uint8_t clientid;
int len, i, j, k, op_len; int len, i, j, k, op_len;
int idx; int idx;
@ -3785,9 +3784,9 @@ xlog_verify_iclog(
if (iclog->ic_header.h_magicno != cpu_to_be32(XLOG_HEADER_MAGIC_NUM)) if (iclog->ic_header.h_magicno != cpu_to_be32(XLOG_HEADER_MAGIC_NUM))
xfs_emerg(log->l_mp, "%s: invalid magic num", __func__); xfs_emerg(log->l_mp, "%s: invalid magic num", __func__);
ptr = (xfs_caddr_t) &iclog->ic_header; base_ptr = ptr = &iclog->ic_header;
for (ptr += BBSIZE; ptr < ((xfs_caddr_t)&iclog->ic_header) + count; p = &iclog->ic_header;
ptr += BBSIZE) { for (ptr += BBSIZE; ptr < base_ptr + count; ptr += BBSIZE) {
if (*(__be32 *)ptr == cpu_to_be32(XLOG_HEADER_MAGIC_NUM)) if (*(__be32 *)ptr == cpu_to_be32(XLOG_HEADER_MAGIC_NUM))
xfs_emerg(log->l_mp, "%s: unexpected magic num", xfs_emerg(log->l_mp, "%s: unexpected magic num",
__func__); __func__);
@ -3795,20 +3794,19 @@ xlog_verify_iclog(
/* check fields */ /* check fields */
len = be32_to_cpu(iclog->ic_header.h_num_logops); len = be32_to_cpu(iclog->ic_header.h_num_logops);
ptr = iclog->ic_datap; base_ptr = ptr = iclog->ic_datap;
base_ptr = ptr; ophead = ptr;
ophead = (xlog_op_header_t *)ptr;
xhdr = iclog->ic_data; xhdr = iclog->ic_data;
for (i = 0; i < len; i++) { for (i = 0; i < len; i++) {
ophead = (xlog_op_header_t *)ptr; ophead = ptr;
/* clientid is only 1 byte */ /* clientid is only 1 byte */
field_offset = (__psint_t) p = &ophead->oh_clientid;
((xfs_caddr_t)&(ophead->oh_clientid) - base_ptr); field_offset = p - base_ptr;
if (!syncing || (field_offset & 0x1ff)) { if (!syncing || (field_offset & 0x1ff)) {
clientid = ophead->oh_clientid; clientid = ophead->oh_clientid;
} else { } else {
idx = BTOBBT((xfs_caddr_t)&(ophead->oh_clientid) - iclog->ic_datap); idx = BTOBBT((char *)&ophead->oh_clientid - iclog->ic_datap);
if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) { if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) {
j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE); j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE); k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
@ -3826,13 +3824,13 @@ xlog_verify_iclog(
(unsigned long)field_offset); (unsigned long)field_offset);
/* check length */ /* check length */
field_offset = (__psint_t) p = &ophead->oh_len;
((xfs_caddr_t)&(ophead->oh_len) - base_ptr); field_offset = p - base_ptr;
if (!syncing || (field_offset & 0x1ff)) { if (!syncing || (field_offset & 0x1ff)) {
op_len = be32_to_cpu(ophead->oh_len); op_len = be32_to_cpu(ophead->oh_len);
} else { } else {
idx = BTOBBT((__psint_t)&ophead->oh_len - idx = BTOBBT((uintptr_t)&ophead->oh_len -
(__psint_t)iclog->ic_datap); (uintptr_t)iclog->ic_datap);
if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) { if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) {
j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE); j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE); k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE);

View File

@ -409,7 +409,7 @@ struct xlog {
/* The following field are used for debugging; need to hold icloglock */ /* The following field are used for debugging; need to hold icloglock */
#ifdef DEBUG #ifdef DEBUG
char *l_iclog_bak[XLOG_MAX_ICLOGS]; void *l_iclog_bak[XLOG_MAX_ICLOGS];
#endif #endif
}; };

View File

@ -147,7 +147,7 @@ xlog_put_bp(
* Return the address of the start of the given block number's data * Return the address of the start of the given block number's data
* in a log buffer. The buffer covers a log sector-aligned region. * in a log buffer. The buffer covers a log sector-aligned region.
*/ */
STATIC xfs_caddr_t STATIC char *
xlog_align( xlog_align(
struct xlog *log, struct xlog *log,
xfs_daddr_t blk_no, xfs_daddr_t blk_no,
@ -203,7 +203,7 @@ xlog_bread(
xfs_daddr_t blk_no, xfs_daddr_t blk_no,
int nbblks, int nbblks,
struct xfs_buf *bp, struct xfs_buf *bp,
xfs_caddr_t *offset) char **offset)
{ {
int error; int error;
@ -225,9 +225,9 @@ xlog_bread_offset(
xfs_daddr_t blk_no, /* block to read from */ xfs_daddr_t blk_no, /* block to read from */
int nbblks, /* blocks to read */ int nbblks, /* blocks to read */
struct xfs_buf *bp, struct xfs_buf *bp,
xfs_caddr_t offset) char *offset)
{ {
xfs_caddr_t orig_offset = bp->b_addr; char *orig_offset = bp->b_addr;
int orig_len = BBTOB(bp->b_length); int orig_len = BBTOB(bp->b_length);
int error, error2; int error, error2;
@ -396,7 +396,7 @@ xlog_find_cycle_start(
xfs_daddr_t *last_blk, xfs_daddr_t *last_blk,
uint cycle) uint cycle)
{ {
xfs_caddr_t offset; char *offset;
xfs_daddr_t mid_blk; xfs_daddr_t mid_blk;
xfs_daddr_t end_blk; xfs_daddr_t end_blk;
uint mid_cycle; uint mid_cycle;
@ -443,7 +443,7 @@ xlog_find_verify_cycle(
uint cycle; uint cycle;
xfs_buf_t *bp; xfs_buf_t *bp;
xfs_daddr_t bufblks; xfs_daddr_t bufblks;
xfs_caddr_t buf = NULL; char *buf = NULL;
int error = 0; int error = 0;
/* /*
@ -509,7 +509,7 @@ xlog_find_verify_log_record(
{ {
xfs_daddr_t i; xfs_daddr_t i;
xfs_buf_t *bp; xfs_buf_t *bp;
xfs_caddr_t offset = NULL; char *offset = NULL;
xlog_rec_header_t *head = NULL; xlog_rec_header_t *head = NULL;
int error = 0; int error = 0;
int smallmem = 0; int smallmem = 0;
@ -616,7 +616,7 @@ xlog_find_head(
xfs_daddr_t *return_head_blk) xfs_daddr_t *return_head_blk)
{ {
xfs_buf_t *bp; xfs_buf_t *bp;
xfs_caddr_t offset; char *offset;
xfs_daddr_t new_blk, first_blk, start_blk, last_blk, head_blk; xfs_daddr_t new_blk, first_blk, start_blk, last_blk, head_blk;
int num_scan_bblks; int num_scan_bblks;
uint first_half_cycle, last_half_cycle; uint first_half_cycle, last_half_cycle;
@ -891,7 +891,7 @@ xlog_find_tail(
{ {
xlog_rec_header_t *rhead; xlog_rec_header_t *rhead;
xlog_op_header_t *op_head; xlog_op_header_t *op_head;
xfs_caddr_t offset = NULL; char *offset = NULL;
xfs_buf_t *bp; xfs_buf_t *bp;
int error, i, found; int error, i, found;
xfs_daddr_t umount_data_blk; xfs_daddr_t umount_data_blk;
@ -1099,7 +1099,7 @@ xlog_find_zeroed(
xfs_daddr_t *blk_no) xfs_daddr_t *blk_no)
{ {
xfs_buf_t *bp; xfs_buf_t *bp;
xfs_caddr_t offset; char *offset;
uint first_cycle, last_cycle; uint first_cycle, last_cycle;
xfs_daddr_t new_blk, last_blk, start_blk; xfs_daddr_t new_blk, last_blk, start_blk;
xfs_daddr_t num_scan_bblks; xfs_daddr_t num_scan_bblks;
@ -1199,7 +1199,7 @@ bp_err:
STATIC void STATIC void
xlog_add_record( xlog_add_record(
struct xlog *log, struct xlog *log,
xfs_caddr_t buf, char *buf,
int cycle, int cycle,
int block, int block,
int tail_cycle, int tail_cycle,
@ -1227,7 +1227,7 @@ xlog_write_log_records(
int tail_cycle, int tail_cycle,
int tail_block) int tail_block)
{ {
xfs_caddr_t offset; char *offset;
xfs_buf_t *bp; xfs_buf_t *bp;
int balign, ealign; int balign, ealign;
int sectbb = log->l_sectBBsize; int sectbb = log->l_sectBBsize;
@ -1789,8 +1789,7 @@ xlog_recover_do_inode_buffer(
return -EFSCORRUPTED; return -EFSCORRUPTED;
} }
buffer_nextp = (xfs_agino_t *)xfs_buf_offset(bp, buffer_nextp = xfs_buf_offset(bp, next_unlinked_offset);
next_unlinked_offset);
*buffer_nextp = *logged_nextp; *buffer_nextp = *logged_nextp;
/* /*
@ -1798,7 +1797,7 @@ xlog_recover_do_inode_buffer(
* have to leave the inode in a consistent state for whoever * have to leave the inode in a consistent state for whoever
* reads it next.... * reads it next....
*/ */
xfs_dinode_calc_crc(mp, (struct xfs_dinode *) xfs_dinode_calc_crc(mp,
xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize)); xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize));
} }
@ -2503,8 +2502,8 @@ xlog_recover_inode_pass2(
xfs_buf_t *bp; xfs_buf_t *bp;
xfs_dinode_t *dip; xfs_dinode_t *dip;
int len; int len;
xfs_caddr_t src; char *src;
xfs_caddr_t dest; char *dest;
int error; int error;
int attr_index; int attr_index;
uint fields; uint fields;
@ -2546,7 +2545,7 @@ xlog_recover_inode_pass2(
goto out_release; goto out_release;
} }
ASSERT(in_f->ilf_fields & XFS_ILOG_CORE); ASSERT(in_f->ilf_fields & XFS_ILOG_CORE);
dip = (xfs_dinode_t *)xfs_buf_offset(bp, in_f->ilf_boffset); dip = xfs_buf_offset(bp, in_f->ilf_boffset);
/* /*
* Make sure the place we're flushing out to really looks * Make sure the place we're flushing out to really looks
@ -2885,7 +2884,7 @@ xlog_recover_dquot_pass2(
return error; return error;
ASSERT(bp); ASSERT(bp);
ddq = (xfs_disk_dquot_t *)xfs_buf_offset(bp, dq_f->qlf_boffset); ddq = xfs_buf_offset(bp, dq_f->qlf_boffset);
/* /*
* If the dquot has an LSN in it, recover the dquot only if it's less * If the dquot has an LSN in it, recover the dquot only if it's less
@ -3374,17 +3373,17 @@ STATIC int
xlog_recover_add_to_cont_trans( xlog_recover_add_to_cont_trans(
struct xlog *log, struct xlog *log,
struct xlog_recover *trans, struct xlog_recover *trans,
xfs_caddr_t dp, char *dp,
int len) int len)
{ {
xlog_recover_item_t *item; xlog_recover_item_t *item;
xfs_caddr_t ptr, old_ptr; char *ptr, *old_ptr;
int old_len; int old_len;
if (list_empty(&trans->r_itemq)) { if (list_empty(&trans->r_itemq)) {
/* finish copying rest of trans header */ /* finish copying rest of trans header */
xlog_recover_add_item(&trans->r_itemq); xlog_recover_add_item(&trans->r_itemq);
ptr = (xfs_caddr_t) &trans->r_theader + ptr = (char *)&trans->r_theader +
sizeof(xfs_trans_header_t) - len; sizeof(xfs_trans_header_t) - len;
memcpy(ptr, dp, len); memcpy(ptr, dp, len);
return 0; return 0;
@ -3420,12 +3419,12 @@ STATIC int
xlog_recover_add_to_trans( xlog_recover_add_to_trans(
struct xlog *log, struct xlog *log,
struct xlog_recover *trans, struct xlog_recover *trans,
xfs_caddr_t dp, char *dp,
int len) int len)
{ {
xfs_inode_log_format_t *in_f; /* any will do */ xfs_inode_log_format_t *in_f; /* any will do */
xlog_recover_item_t *item; xlog_recover_item_t *item;
xfs_caddr_t ptr; char *ptr;
if (!len) if (!len)
return 0; return 0;
@ -3514,7 +3513,7 @@ STATIC int
xlog_recovery_process_trans( xlog_recovery_process_trans(
struct xlog *log, struct xlog *log,
struct xlog_recover *trans, struct xlog_recover *trans,
xfs_caddr_t dp, char *dp,
unsigned int len, unsigned int len,
unsigned int flags, unsigned int flags,
int pass) int pass)
@ -3621,8 +3620,8 @@ xlog_recover_process_ophdr(
struct hlist_head rhash[], struct hlist_head rhash[],
struct xlog_rec_header *rhead, struct xlog_rec_header *rhead,
struct xlog_op_header *ohead, struct xlog_op_header *ohead,
xfs_caddr_t dp, char *dp,
xfs_caddr_t end, char *end,
int pass) int pass)
{ {
struct xlog_recover *trans; struct xlog_recover *trans;
@ -3671,11 +3670,11 @@ xlog_recover_process_data(
struct xlog *log, struct xlog *log,
struct hlist_head rhash[], struct hlist_head rhash[],
struct xlog_rec_header *rhead, struct xlog_rec_header *rhead,
xfs_caddr_t dp, char *dp,
int pass) int pass)
{ {
struct xlog_op_header *ohead; struct xlog_op_header *ohead;
xfs_caddr_t end; char *end;
int num_logops; int num_logops;
int error; int error;
@ -4020,7 +4019,7 @@ xlog_recover_process_iunlinks(
STATIC int STATIC int
xlog_unpack_data_crc( xlog_unpack_data_crc(
struct xlog_rec_header *rhead, struct xlog_rec_header *rhead,
xfs_caddr_t dp, char *dp,
struct xlog *log) struct xlog *log)
{ {
__le32 crc; __le32 crc;
@ -4050,7 +4049,7 @@ xlog_unpack_data_crc(
STATIC int STATIC int
xlog_unpack_data( xlog_unpack_data(
struct xlog_rec_header *rhead, struct xlog_rec_header *rhead,
xfs_caddr_t dp, char *dp,
struct xlog *log) struct xlog *log)
{ {
int i, j, k; int i, j, k;
@ -4132,7 +4131,7 @@ xlog_do_recovery_pass(
{ {
xlog_rec_header_t *rhead; xlog_rec_header_t *rhead;
xfs_daddr_t blk_no; xfs_daddr_t blk_no;
xfs_caddr_t offset; char *offset;
xfs_buf_t *hbp, *dbp; xfs_buf_t *hbp, *dbp;
int error = 0, h_size; int error = 0, h_size;
int bblks, split_bblks; int bblks, split_bblks;

View File

@ -104,7 +104,7 @@ xfs_readlink_bmap(
cur_chunk += sizeof(struct xfs_dsymlink_hdr); cur_chunk += sizeof(struct xfs_dsymlink_hdr);
} }
memcpy(link + offset, bp->b_addr, byte_cnt); memcpy(link + offset, cur_chunk, byte_cnt);
pathlen -= byte_cnt; pathlen -= byte_cnt;
offset += byte_cnt; offset += byte_cnt;

View File

@ -159,7 +159,7 @@ xfs_trans_ail_cursor_next(
{ {
struct xfs_log_item *lip = cur->item; struct xfs_log_item *lip = cur->item;
if ((__psint_t)lip & 1) if ((uintptr_t)lip & 1)
lip = xfs_ail_min(ailp); lip = xfs_ail_min(ailp);
if (lip) if (lip)
cur->item = xfs_ail_next(ailp, lip); cur->item = xfs_ail_next(ailp, lip);
@ -196,7 +196,7 @@ xfs_trans_ail_cursor_clear(
list_for_each_entry(cur, &ailp->xa_cursors, list) { list_for_each_entry(cur, &ailp->xa_cursors, list) {
if (cur->item == lip) if (cur->item == lip)
cur->item = (struct xfs_log_item *) cur->item = (struct xfs_log_item *)
((__psint_t)cur->item | 1); ((uintptr_t)cur->item | 1);
} }
} }
@ -287,7 +287,7 @@ xfs_ail_splice(
* find the place in the AIL where the items belong. * find the place in the AIL where the items belong.
*/ */
lip = cur ? cur->item : NULL; lip = cur ? cur->item : NULL;
if (!lip || (__psint_t) lip & 1) if (!lip || (uintptr_t)lip & 1)
lip = __xfs_trans_ail_cursor_last(ailp, lsn); lip = __xfs_trans_ail_cursor_last(ailp, lsn);
/* /*