aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/libxfs/xfs_ialloc.h3
-rw-r--r--fs/xfs/libxfs/xfs_inode_buf.c8
-rw-r--r--fs/xfs/xfs_attr_inactive.c10
-rw-r--r--fs/xfs/xfs_buf.c6
-rw-r--r--fs/xfs/xfs_buf.h2
-rw-r--r--fs/xfs/xfs_error.c4
-rw-r--r--fs/xfs/xfs_error.h4
-rw-r--r--fs/xfs/xfs_extfree_item.c2
-rw-r--r--fs/xfs/xfs_inode.c2
-rw-r--r--fs/xfs/xfs_linux.h14
-rw-r--r--fs/xfs/xfs_log.c40
-rw-r--r--fs/xfs/xfs_log_priv.h2
-rw-r--r--fs/xfs/xfs_log_recover.c63
-rw-r--r--fs/xfs/xfs_symlink.c2
-rw-r--r--fs/xfs/xfs_trans_ail.c6
15 files changed, 77 insertions, 91 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc.h b/fs/xfs/libxfs/xfs_ialloc.h
index 12401fea7bff..6e450df2979b 100644
--- a/fs/xfs/libxfs/xfs_ialloc.h
+++ b/fs/xfs/libxfs/xfs_ialloc.h
@@ -51,8 +51,7 @@ xfs_icluster_size_fsb(
51static inline struct xfs_dinode * 51static inline struct xfs_dinode *
52xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o) 52xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o)
53{ 53{
54 return (struct xfs_dinode *) 54 return xfs_buf_offset(b, o << (mp)->m_sb.sb_inodelog);
55 (xfs_buf_offset(b, o << (mp)->m_sb.sb_inodelog));
56} 55}
57 56
58/* 57/*
diff --git a/fs/xfs/libxfs/xfs_inode_buf.c b/fs/xfs/libxfs/xfs_inode_buf.c
index 002b6b3a1988..6526e7696184 100644
--- a/fs/xfs/libxfs/xfs_inode_buf.c
+++ b/fs/xfs/libxfs/xfs_inode_buf.c
@@ -46,8 +46,7 @@ xfs_inobp_check(
46 j = mp->m_inode_cluster_size >> mp->m_sb.sb_inodelog; 46 j = mp->m_inode_cluster_size >> mp->m_sb.sb_inodelog;
47 47
48 for (i = 0; i < j; i++) { 48 for (i = 0; i < j; i++) {
49 dip = (xfs_dinode_t *)xfs_buf_offset(bp, 49 dip = xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize);
50 i * mp->m_sb.sb_inodesize);
51 if (!dip->di_next_unlinked) { 50 if (!dip->di_next_unlinked) {
52 xfs_alert(mp, 51 xfs_alert(mp,
53 "Detected bogus zero next_unlinked field in inode %d buffer 0x%llx.", 52 "Detected bogus zero next_unlinked field in inode %d buffer 0x%llx.",
@@ -86,8 +85,7 @@ xfs_inode_buf_verify(
86 int di_ok; 85 int di_ok;
87 xfs_dinode_t *dip; 86 xfs_dinode_t *dip;
88 87
89 dip = (struct xfs_dinode *)xfs_buf_offset(bp, 88 dip = xfs_buf_offset(bp, (i << mp->m_sb.sb_inodelog));
90 (i << mp->m_sb.sb_inodelog));
91 di_ok = dip->di_magic == cpu_to_be16(XFS_DINODE_MAGIC) && 89 di_ok = dip->di_magic == cpu_to_be16(XFS_DINODE_MAGIC) &&
92 XFS_DINODE_GOOD_VERSION(dip->di_version); 90 XFS_DINODE_GOOD_VERSION(dip->di_version);
93 if (unlikely(XFS_TEST_ERROR(!di_ok, mp, 91 if (unlikely(XFS_TEST_ERROR(!di_ok, mp,
@@ -186,7 +184,7 @@ xfs_imap_to_bp(
186 } 184 }
187 185
188 *bpp = bp; 186 *bpp = bp;
189 *dipp = (struct xfs_dinode *)xfs_buf_offset(bp, imap->im_boffset); 187 *dipp = xfs_buf_offset(bp, imap->im_boffset);
190 return 0; 188 return 0;
191} 189}
192 190
diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
index 69a154c58287..2bb959ada45b 100644
--- a/fs/xfs/xfs_attr_inactive.c
+++ b/fs/xfs/xfs_attr_inactive.c
@@ -433,8 +433,14 @@ xfs_attr_inactive(
433 */ 433 */
434 xfs_trans_ijoin(trans, dp, 0); 434 xfs_trans_ijoin(trans, dp, 0);
435 435
436 /* invalidate and truncate the attribute fork extents */ 436 /*
437 if (dp->i_d.di_aformat != XFS_DINODE_FMT_LOCAL) { 437 * Invalidate and truncate the attribute fork extents. Make sure the
438 * fork actually has attributes as otherwise the invalidation has no
439 * blocks to read and returns an error. In this case, just do the fork
440 * removal below.
441 */
442 if (xfs_inode_hasattr(dp) &&
443 dp->i_d.di_aformat != XFS_DINODE_FMT_LOCAL) {
438 error = xfs_attr3_root_inactive(&trans, dp); 444 error = xfs_attr3_root_inactive(&trans, dp);
439 if (error) 445 if (error)
440 goto out_cancel; 446 goto out_cancel;
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 1790b00bea7a..a4b7d92e946c 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1419,9 +1419,9 @@ xfs_buf_submit_wait(
1419 return error; 1419 return error;
1420} 1420}
1421 1421
1422xfs_caddr_t 1422void *
1423xfs_buf_offset( 1423xfs_buf_offset(
1424 xfs_buf_t *bp, 1424 struct xfs_buf *bp,
1425 size_t offset) 1425 size_t offset)
1426{ 1426{
1427 struct page *page; 1427 struct page *page;
@@ -1431,7 +1431,7 @@ xfs_buf_offset(
1431 1431
1432 offset += bp->b_offset; 1432 offset += bp->b_offset;
1433 page = bp->b_pages[offset >> PAGE_SHIFT]; 1433 page = bp->b_pages[offset >> PAGE_SHIFT];
1434 return (xfs_caddr_t)page_address(page) + (offset & (PAGE_SIZE-1)); 1434 return page_address(page) + (offset & (PAGE_SIZE-1));
1435} 1435}
1436 1436
1437/* 1437/*
diff --git a/fs/xfs/xfs_buf.h b/fs/xfs/xfs_buf.h
index 75ff5d5a7d2e..331c1ccf8264 100644
--- a/fs/xfs/xfs_buf.h
+++ b/fs/xfs/xfs_buf.h
@@ -299,7 +299,7 @@ extern void xfs_buf_iomove(xfs_buf_t *, size_t, size_t, void *,
299 xfs_buf_iomove((bp), (off), (len), NULL, XBRW_ZERO) 299 xfs_buf_iomove((bp), (off), (len), NULL, XBRW_ZERO)
300 300
301/* Buffer Utility Routines */ 301/* Buffer Utility Routines */
302extern xfs_caddr_t xfs_buf_offset(xfs_buf_t *, size_t); 302extern void *xfs_buf_offset(struct xfs_buf *, size_t);
303 303
304/* Delayed Write Buffer Routines */ 304/* Delayed Write Buffer Routines */
305extern bool xfs_buf_delwri_queue(struct xfs_buf *, struct list_head *); 305extern bool xfs_buf_delwri_queue(struct xfs_buf *, struct list_head *);
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c
index 338e50bbfd1e..74d0e5966ebc 100644
--- a/fs/xfs/xfs_error.c
+++ b/fs/xfs/xfs_error.c
@@ -127,7 +127,7 @@ xfs_error_report(
127 struct xfs_mount *mp, 127 struct xfs_mount *mp,
128 const char *filename, 128 const char *filename,
129 int linenum, 129 int linenum,
130 inst_t *ra) 130 void *ra)
131{ 131{
132 if (level <= xfs_error_level) { 132 if (level <= xfs_error_level) {
133 xfs_alert_tag(mp, XFS_PTAG_ERROR_REPORT, 133 xfs_alert_tag(mp, XFS_PTAG_ERROR_REPORT,
@@ -146,7 +146,7 @@ xfs_corruption_error(
146 void *p, 146 void *p,
147 const char *filename, 147 const char *filename,
148 int linenum, 148 int linenum,
149 inst_t *ra) 149 void *ra)
150{ 150{
151 if (level <= xfs_error_level) 151 if (level <= xfs_error_level)
152 xfs_hex_dump(p, 64); 152 xfs_hex_dump(p, 64);
diff --git a/fs/xfs/xfs_error.h b/fs/xfs/xfs_error.h
index c0394ed126fc..4ed3042a0f16 100644
--- a/fs/xfs/xfs_error.h
+++ b/fs/xfs/xfs_error.h
@@ -21,10 +21,10 @@
21struct xfs_mount; 21struct xfs_mount;
22 22
23extern void xfs_error_report(const char *tag, int level, struct xfs_mount *mp, 23extern void xfs_error_report(const char *tag, int level, struct xfs_mount *mp,
24 const char *filename, int linenum, inst_t *ra); 24 const char *filename, int linenum, void *ra);
25extern void xfs_corruption_error(const char *tag, int level, 25extern void xfs_corruption_error(const char *tag, int level,
26 struct xfs_mount *mp, void *p, const char *filename, 26 struct xfs_mount *mp, void *p, const char *filename,
27 int linenum, inst_t *ra); 27 int linenum, void *ra);
28extern void xfs_verifier_error(struct xfs_buf *bp); 28extern void xfs_verifier_error(struct xfs_buf *bp);
29 29
30#define XFS_ERROR_REPORT(e, lvl, mp) \ 30#define XFS_ERROR_REPORT(e, lvl, mp) \
diff --git a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
index cb7fe64cdbfa..adc8f8fdd145 100644
--- a/fs/xfs/xfs_extfree_item.c
+++ b/fs/xfs/xfs_extfree_item.c
@@ -239,7 +239,7 @@ xfs_efi_init(
239 239
240 xfs_log_item_init(mp, &efip->efi_item, XFS_LI_EFI, &xfs_efi_item_ops); 240 xfs_log_item_init(mp, &efip->efi_item, XFS_LI_EFI, &xfs_efi_item_ops);
241 efip->efi_format.efi_nextents = nextents; 241 efip->efi_format.efi_nextents = nextents;
242 efip->efi_format.efi_id = (__psint_t)(void*)efip; 242 efip->efi_format.efi_id = (uintptr_t)(void *)efip;
243 atomic_set(&efip->efi_next_extent, 0); 243 atomic_set(&efip->efi_next_extent, 0);
244 atomic_set(&efip->efi_refcount, 2); 244 atomic_set(&efip->efi_refcount, 2);
245 245
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index a37a1011b6e4..3da9f4da4f3d 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -3392,7 +3392,7 @@ xfs_iflush_int(
3392 ASSERT(ip->i_d.di_version > 1); 3392 ASSERT(ip->i_d.di_version > 1);
3393 3393
3394 /* set *dip = inode's place in the buffer */ 3394 /* set *dip = inode's place in the buffer */
3395 dip = (xfs_dinode_t *)xfs_buf_offset(bp, ip->i_imap.im_boffset); 3395 dip = xfs_buf_offset(bp, ip->i_imap.im_boffset);
3396 3396
3397 if (XFS_TEST_ERROR(dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC), 3397 if (XFS_TEST_ERROR(dip->di_magic != cpu_to_be16(XFS_DINODE_MAGIC),
3398 mp, XFS_ERRTAG_IFLUSH_1, XFS_RANDOM_IFLUSH_1)) { 3398 mp, XFS_ERRTAG_IFLUSH_1, XFS_RANDOM_IFLUSH_1)) {
diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
index 7c7842c85a08..85f883dd6207 100644
--- a/fs/xfs/xfs_linux.h
+++ b/fs/xfs/xfs_linux.h
@@ -32,26 +32,12 @@ typedef unsigned int __uint32_t;
32typedef signed long long int __int64_t; 32typedef signed long long int __int64_t;
33typedef unsigned long long int __uint64_t; 33typedef unsigned long long int __uint64_t;
34 34
35typedef __uint32_t inst_t; /* an instruction */
36
37typedef __s64 xfs_off_t; /* <file offset> type */ 35typedef __s64 xfs_off_t; /* <file offset> type */
38typedef unsigned long long xfs_ino_t; /* <inode> type */ 36typedef unsigned long long xfs_ino_t; /* <inode> type */
39typedef __s64 xfs_daddr_t; /* <disk address> type */ 37typedef __s64 xfs_daddr_t; /* <disk address> type */
40typedef char * xfs_caddr_t; /* <core address> type */
41typedef __u32 xfs_dev_t; 38typedef __u32 xfs_dev_t;
42typedef __u32 xfs_nlink_t; 39typedef __u32 xfs_nlink_t;
43 40
44/* __psint_t is the same size as a pointer */
45#if (BITS_PER_LONG == 32)
46typedef __int32_t __psint_t;
47typedef __uint32_t __psunsigned_t;
48#elif (BITS_PER_LONG == 64)
49typedef __int64_t __psint_t;
50typedef __uint64_t __psunsigned_t;
51#else
52#error BITS_PER_LONG must be 32 or 64
53#endif
54
55#include "xfs_types.h" 41#include "xfs_types.h"
56 42
57#include "kmem.h" 43#include "kmem.h"
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index c8d09ef81c4f..08d4fe46f0fa 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -109,7 +109,7 @@ xlog_ungrant_log_space(
109STATIC void 109STATIC void
110xlog_verify_dest_ptr( 110xlog_verify_dest_ptr(
111 struct xlog *log, 111 struct xlog *log,
112 char *ptr); 112 void *ptr);
113STATIC void 113STATIC void
114xlog_verify_grant_tail( 114xlog_verify_grant_tail(
115 struct xlog *log); 115 struct xlog *log);
@@ -1444,7 +1444,7 @@ xlog_alloc_log(
1444 iclog->ic_bp = bp; 1444 iclog->ic_bp = bp;
1445 iclog->ic_data = bp->b_addr; 1445 iclog->ic_data = bp->b_addr;
1446#ifdef DEBUG 1446#ifdef DEBUG
1447 log->l_iclog_bak[i] = (xfs_caddr_t)&(iclog->ic_header); 1447 log->l_iclog_bak[i] = &iclog->ic_header;
1448#endif 1448#endif
1449 head = &iclog->ic_header; 1449 head = &iclog->ic_header;
1450 memset(head, 0, sizeof(xlog_rec_header_t)); 1450 memset(head, 0, sizeof(xlog_rec_header_t));
@@ -1599,7 +1599,7 @@ xlog_pack_data(
1599 int i, j, k; 1599 int i, j, k;
1600 int size = iclog->ic_offset + roundoff; 1600 int size = iclog->ic_offset + roundoff;
1601 __be32 cycle_lsn; 1601 __be32 cycle_lsn;
1602 xfs_caddr_t dp; 1602 char *dp;
1603 1603
1604 cycle_lsn = CYCLE_LSN_DISK(iclog->ic_header.h_lsn); 1604 cycle_lsn = CYCLE_LSN_DISK(iclog->ic_header.h_lsn);
1605 1605
@@ -3661,7 +3661,7 @@ xlog_ticket_alloc(
3661void 3661void
3662xlog_verify_dest_ptr( 3662xlog_verify_dest_ptr(
3663 struct xlog *log, 3663 struct xlog *log,
3664 char *ptr) 3664 void *ptr)
3665{ 3665{
3666 int i; 3666 int i;
3667 int good_ptr = 0; 3667 int good_ptr = 0;
@@ -3764,9 +3764,8 @@ xlog_verify_iclog(
3764 xlog_op_header_t *ophead; 3764 xlog_op_header_t *ophead;
3765 xlog_in_core_t *icptr; 3765 xlog_in_core_t *icptr;
3766 xlog_in_core_2_t *xhdr; 3766 xlog_in_core_2_t *xhdr;
3767 xfs_caddr_t ptr; 3767 void *base_ptr, *ptr, *p;
3768 xfs_caddr_t base_ptr; 3768 ptrdiff_t field_offset;
3769 __psint_t field_offset;
3770 __uint8_t clientid; 3769 __uint8_t clientid;
3771 int len, i, j, k, op_len; 3770 int len, i, j, k, op_len;
3772 int idx; 3771 int idx;
@@ -3785,9 +3784,9 @@ xlog_verify_iclog(
3785 if (iclog->ic_header.h_magicno != cpu_to_be32(XLOG_HEADER_MAGIC_NUM)) 3784 if (iclog->ic_header.h_magicno != cpu_to_be32(XLOG_HEADER_MAGIC_NUM))
3786 xfs_emerg(log->l_mp, "%s: invalid magic num", __func__); 3785 xfs_emerg(log->l_mp, "%s: invalid magic num", __func__);
3787 3786
3788 ptr = (xfs_caddr_t) &iclog->ic_header; 3787 base_ptr = ptr = &iclog->ic_header;
3789 for (ptr += BBSIZE; ptr < ((xfs_caddr_t)&iclog->ic_header) + count; 3788 p = &iclog->ic_header;
3790 ptr += BBSIZE) { 3789 for (ptr += BBSIZE; ptr < base_ptr + count; ptr += BBSIZE) {
3791 if (*(__be32 *)ptr == cpu_to_be32(XLOG_HEADER_MAGIC_NUM)) 3790 if (*(__be32 *)ptr == cpu_to_be32(XLOG_HEADER_MAGIC_NUM))
3792 xfs_emerg(log->l_mp, "%s: unexpected magic num", 3791 xfs_emerg(log->l_mp, "%s: unexpected magic num",
3793 __func__); 3792 __func__);
@@ -3795,20 +3794,19 @@ xlog_verify_iclog(
3795 3794
3796 /* check fields */ 3795 /* check fields */
3797 len = be32_to_cpu(iclog->ic_header.h_num_logops); 3796 len = be32_to_cpu(iclog->ic_header.h_num_logops);
3798 ptr = iclog->ic_datap; 3797 base_ptr = ptr = iclog->ic_datap;
3799 base_ptr = ptr; 3798 ophead = ptr;
3800 ophead = (xlog_op_header_t *)ptr;
3801 xhdr = iclog->ic_data; 3799 xhdr = iclog->ic_data;
3802 for (i = 0; i < len; i++) { 3800 for (i = 0; i < len; i++) {
3803 ophead = (xlog_op_header_t *)ptr; 3801 ophead = ptr;
3804 3802
3805 /* clientid is only 1 byte */ 3803 /* clientid is only 1 byte */
3806 field_offset = (__psint_t) 3804 p = &ophead->oh_clientid;
3807 ((xfs_caddr_t)&(ophead->oh_clientid) - base_ptr); 3805 field_offset = p - base_ptr;
3808 if (!syncing || (field_offset & 0x1ff)) { 3806 if (!syncing || (field_offset & 0x1ff)) {
3809 clientid = ophead->oh_clientid; 3807 clientid = ophead->oh_clientid;
3810 } else { 3808 } else {
3811 idx = BTOBBT((xfs_caddr_t)&(ophead->oh_clientid) - iclog->ic_datap); 3809 idx = BTOBBT((char *)&ophead->oh_clientid - iclog->ic_datap);
3812 if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) { 3810 if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) {
3813 j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE); 3811 j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
3814 k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE); 3812 k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
@@ -3826,13 +3824,13 @@ xlog_verify_iclog(
3826 (unsigned long)field_offset); 3824 (unsigned long)field_offset);
3827 3825
3828 /* check length */ 3826 /* check length */
3829 field_offset = (__psint_t) 3827 p = &ophead->oh_len;
3830 ((xfs_caddr_t)&(ophead->oh_len) - base_ptr); 3828 field_offset = p - base_ptr;
3831 if (!syncing || (field_offset & 0x1ff)) { 3829 if (!syncing || (field_offset & 0x1ff)) {
3832 op_len = be32_to_cpu(ophead->oh_len); 3830 op_len = be32_to_cpu(ophead->oh_len);
3833 } else { 3831 } else {
3834 idx = BTOBBT((__psint_t)&ophead->oh_len - 3832 idx = BTOBBT((uintptr_t)&ophead->oh_len -
3835 (__psint_t)iclog->ic_datap); 3833 (uintptr_t)iclog->ic_datap);
3836 if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) { 3834 if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) {
3837 j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE); 3835 j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
3838 k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE); 3836 k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index db7cbdeb2b42..1c87c8abfbed 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -409,7 +409,7 @@ struct xlog {
409 409
410 /* The following field are used for debugging; need to hold icloglock */ 410 /* The following field are used for debugging; need to hold icloglock */
411#ifdef DEBUG 411#ifdef DEBUG
412 char *l_iclog_bak[XLOG_MAX_ICLOGS]; 412 void *l_iclog_bak[XLOG_MAX_ICLOGS];
413#endif 413#endif
414 414
415}; 415};
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 299fbaff1f2c..01dd228ca05e 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -147,7 +147,7 @@ xlog_put_bp(
147 * Return the address of the start of the given block number's data 147 * Return the address of the start of the given block number's data
148 * in a log buffer. The buffer covers a log sector-aligned region. 148 * in a log buffer. The buffer covers a log sector-aligned region.
149 */ 149 */
150STATIC xfs_caddr_t 150STATIC char *
151xlog_align( 151xlog_align(
152 struct xlog *log, 152 struct xlog *log,
153 xfs_daddr_t blk_no, 153 xfs_daddr_t blk_no,
@@ -203,7 +203,7 @@ xlog_bread(
203 xfs_daddr_t blk_no, 203 xfs_daddr_t blk_no,
204 int nbblks, 204 int nbblks,
205 struct xfs_buf *bp, 205 struct xfs_buf *bp,
206 xfs_caddr_t *offset) 206 char **offset)
207{ 207{
208 int error; 208 int error;
209 209
@@ -225,9 +225,9 @@ xlog_bread_offset(
225 xfs_daddr_t blk_no, /* block to read from */ 225 xfs_daddr_t blk_no, /* block to read from */
226 int nbblks, /* blocks to read */ 226 int nbblks, /* blocks to read */
227 struct xfs_buf *bp, 227 struct xfs_buf *bp,
228 xfs_caddr_t offset) 228 char *offset)
229{ 229{
230 xfs_caddr_t orig_offset = bp->b_addr; 230 char *orig_offset = bp->b_addr;
231 int orig_len = BBTOB(bp->b_length); 231 int orig_len = BBTOB(bp->b_length);
232 int error, error2; 232 int error, error2;
233 233
@@ -396,7 +396,7 @@ xlog_find_cycle_start(
396 xfs_daddr_t *last_blk, 396 xfs_daddr_t *last_blk,
397 uint cycle) 397 uint cycle)
398{ 398{
399 xfs_caddr_t offset; 399 char *offset;
400 xfs_daddr_t mid_blk; 400 xfs_daddr_t mid_blk;
401 xfs_daddr_t end_blk; 401 xfs_daddr_t end_blk;
402 uint mid_cycle; 402 uint mid_cycle;
@@ -443,7 +443,7 @@ xlog_find_verify_cycle(
443 uint cycle; 443 uint cycle;
444 xfs_buf_t *bp; 444 xfs_buf_t *bp;
445 xfs_daddr_t bufblks; 445 xfs_daddr_t bufblks;
446 xfs_caddr_t buf = NULL; 446 char *buf = NULL;
447 int error = 0; 447 int error = 0;
448 448
449 /* 449 /*
@@ -509,7 +509,7 @@ xlog_find_verify_log_record(
509{ 509{
510 xfs_daddr_t i; 510 xfs_daddr_t i;
511 xfs_buf_t *bp; 511 xfs_buf_t *bp;
512 xfs_caddr_t offset = NULL; 512 char *offset = NULL;
513 xlog_rec_header_t *head = NULL; 513 xlog_rec_header_t *head = NULL;
514 int error = 0; 514 int error = 0;
515 int smallmem = 0; 515 int smallmem = 0;
@@ -616,7 +616,7 @@ xlog_find_head(
616 xfs_daddr_t *return_head_blk) 616 xfs_daddr_t *return_head_blk)
617{ 617{
618 xfs_buf_t *bp; 618 xfs_buf_t *bp;
619 xfs_caddr_t offset; 619 char *offset;
620 xfs_daddr_t new_blk, first_blk, start_blk, last_blk, head_blk; 620 xfs_daddr_t new_blk, first_blk, start_blk, last_blk, head_blk;
621 int num_scan_bblks; 621 int num_scan_bblks;
622 uint first_half_cycle, last_half_cycle; 622 uint first_half_cycle, last_half_cycle;
@@ -891,7 +891,7 @@ xlog_find_tail(
891{ 891{
892 xlog_rec_header_t *rhead; 892 xlog_rec_header_t *rhead;
893 xlog_op_header_t *op_head; 893 xlog_op_header_t *op_head;
894 xfs_caddr_t offset = NULL; 894 char *offset = NULL;
895 xfs_buf_t *bp; 895 xfs_buf_t *bp;
896 int error, i, found; 896 int error, i, found;
897 xfs_daddr_t umount_data_blk; 897 xfs_daddr_t umount_data_blk;
@@ -1099,7 +1099,7 @@ xlog_find_zeroed(
1099 xfs_daddr_t *blk_no) 1099 xfs_daddr_t *blk_no)
1100{ 1100{
1101 xfs_buf_t *bp; 1101 xfs_buf_t *bp;
1102 xfs_caddr_t offset; 1102 char *offset;
1103 uint first_cycle, last_cycle; 1103 uint first_cycle, last_cycle;
1104 xfs_daddr_t new_blk, last_blk, start_blk; 1104 xfs_daddr_t new_blk, last_blk, start_blk;
1105 xfs_daddr_t num_scan_bblks; 1105 xfs_daddr_t num_scan_bblks;
@@ -1199,7 +1199,7 @@ bp_err:
1199STATIC void 1199STATIC void
1200xlog_add_record( 1200xlog_add_record(
1201 struct xlog *log, 1201 struct xlog *log,
1202 xfs_caddr_t buf, 1202 char *buf,
1203 int cycle, 1203 int cycle,
1204 int block, 1204 int block,
1205 int tail_cycle, 1205 int tail_cycle,
@@ -1227,7 +1227,7 @@ xlog_write_log_records(
1227 int tail_cycle, 1227 int tail_cycle,
1228 int tail_block) 1228 int tail_block)
1229{ 1229{
1230 xfs_caddr_t offset; 1230 char *offset;
1231 xfs_buf_t *bp; 1231 xfs_buf_t *bp;
1232 int balign, ealign; 1232 int balign, ealign;
1233 int sectbb = log->l_sectBBsize; 1233 int sectbb = log->l_sectBBsize;
@@ -1789,8 +1789,7 @@ xlog_recover_do_inode_buffer(
1789 return -EFSCORRUPTED; 1789 return -EFSCORRUPTED;
1790 } 1790 }
1791 1791
1792 buffer_nextp = (xfs_agino_t *)xfs_buf_offset(bp, 1792 buffer_nextp = xfs_buf_offset(bp, next_unlinked_offset);
1793 next_unlinked_offset);
1794 *buffer_nextp = *logged_nextp; 1793 *buffer_nextp = *logged_nextp;
1795 1794
1796 /* 1795 /*
@@ -1798,7 +1797,7 @@ xlog_recover_do_inode_buffer(
1798 * have to leave the inode in a consistent state for whoever 1797 * have to leave the inode in a consistent state for whoever
1799 * reads it next.... 1798 * reads it next....
1800 */ 1799 */
1801 xfs_dinode_calc_crc(mp, (struct xfs_dinode *) 1800 xfs_dinode_calc_crc(mp,
1802 xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize)); 1801 xfs_buf_offset(bp, i * mp->m_sb.sb_inodesize));
1803 1802
1804 } 1803 }
@@ -2503,8 +2502,8 @@ xlog_recover_inode_pass2(
2503 xfs_buf_t *bp; 2502 xfs_buf_t *bp;
2504 xfs_dinode_t *dip; 2503 xfs_dinode_t *dip;
2505 int len; 2504 int len;
2506 xfs_caddr_t src; 2505 char *src;
2507 xfs_caddr_t dest; 2506 char *dest;
2508 int error; 2507 int error;
2509 int attr_index; 2508 int attr_index;
2510 uint fields; 2509 uint fields;
@@ -2546,7 +2545,7 @@ xlog_recover_inode_pass2(
2546 goto out_release; 2545 goto out_release;
2547 } 2546 }
2548 ASSERT(in_f->ilf_fields & XFS_ILOG_CORE); 2547 ASSERT(in_f->ilf_fields & XFS_ILOG_CORE);
2549 dip = (xfs_dinode_t *)xfs_buf_offset(bp, in_f->ilf_boffset); 2548 dip = xfs_buf_offset(bp, in_f->ilf_boffset);
2550 2549
2551 /* 2550 /*
2552 * Make sure the place we're flushing out to really looks 2551 * Make sure the place we're flushing out to really looks
@@ -2885,7 +2884,7 @@ xlog_recover_dquot_pass2(
2885 return error; 2884 return error;
2886 2885
2887 ASSERT(bp); 2886 ASSERT(bp);
2888 ddq = (xfs_disk_dquot_t *)xfs_buf_offset(bp, dq_f->qlf_boffset); 2887 ddq = xfs_buf_offset(bp, dq_f->qlf_boffset);
2889 2888
2890 /* 2889 /*
2891 * If the dquot has an LSN in it, recover the dquot only if it's less 2890 * If the dquot has an LSN in it, recover the dquot only if it's less
@@ -3374,17 +3373,17 @@ STATIC int
3374xlog_recover_add_to_cont_trans( 3373xlog_recover_add_to_cont_trans(
3375 struct xlog *log, 3374 struct xlog *log,
3376 struct xlog_recover *trans, 3375 struct xlog_recover *trans,
3377 xfs_caddr_t dp, 3376 char *dp,
3378 int len) 3377 int len)
3379{ 3378{
3380 xlog_recover_item_t *item; 3379 xlog_recover_item_t *item;
3381 xfs_caddr_t ptr, old_ptr; 3380 char *ptr, *old_ptr;
3382 int old_len; 3381 int old_len;
3383 3382
3384 if (list_empty(&trans->r_itemq)) { 3383 if (list_empty(&trans->r_itemq)) {
3385 /* finish copying rest of trans header */ 3384 /* finish copying rest of trans header */
3386 xlog_recover_add_item(&trans->r_itemq); 3385 xlog_recover_add_item(&trans->r_itemq);
3387 ptr = (xfs_caddr_t) &trans->r_theader + 3386 ptr = (char *)&trans->r_theader +
3388 sizeof(xfs_trans_header_t) - len; 3387 sizeof(xfs_trans_header_t) - len;
3389 memcpy(ptr, dp, len); 3388 memcpy(ptr, dp, len);
3390 return 0; 3389 return 0;
@@ -3420,12 +3419,12 @@ STATIC int
3420xlog_recover_add_to_trans( 3419xlog_recover_add_to_trans(
3421 struct xlog *log, 3420 struct xlog *log,
3422 struct xlog_recover *trans, 3421 struct xlog_recover *trans,
3423 xfs_caddr_t dp, 3422 char *dp,
3424 int len) 3423 int len)
3425{ 3424{
3426 xfs_inode_log_format_t *in_f; /* any will do */ 3425 xfs_inode_log_format_t *in_f; /* any will do */
3427 xlog_recover_item_t *item; 3426 xlog_recover_item_t *item;
3428 xfs_caddr_t ptr; 3427 char *ptr;
3429 3428
3430 if (!len) 3429 if (!len)
3431 return 0; 3430 return 0;
@@ -3514,7 +3513,7 @@ STATIC int
3514xlog_recovery_process_trans( 3513xlog_recovery_process_trans(
3515 struct xlog *log, 3514 struct xlog *log,
3516 struct xlog_recover *trans, 3515 struct xlog_recover *trans,
3517 xfs_caddr_t dp, 3516 char *dp,
3518 unsigned int len, 3517 unsigned int len,
3519 unsigned int flags, 3518 unsigned int flags,
3520 int pass) 3519 int pass)
@@ -3621,8 +3620,8 @@ xlog_recover_process_ophdr(
3621 struct hlist_head rhash[], 3620 struct hlist_head rhash[],
3622 struct xlog_rec_header *rhead, 3621 struct xlog_rec_header *rhead,
3623 struct xlog_op_header *ohead, 3622 struct xlog_op_header *ohead,
3624 xfs_caddr_t dp, 3623 char *dp,
3625 xfs_caddr_t end, 3624 char *end,
3626 int pass) 3625 int pass)
3627{ 3626{
3628 struct xlog_recover *trans; 3627 struct xlog_recover *trans;
@@ -3671,11 +3670,11 @@ xlog_recover_process_data(
3671 struct xlog *log, 3670 struct xlog *log,
3672 struct hlist_head rhash[], 3671 struct hlist_head rhash[],
3673 struct xlog_rec_header *rhead, 3672 struct xlog_rec_header *rhead,
3674 xfs_caddr_t dp, 3673 char *dp,
3675 int pass) 3674 int pass)
3676{ 3675{
3677 struct xlog_op_header *ohead; 3676 struct xlog_op_header *ohead;
3678 xfs_caddr_t end; 3677 char *end;
3679 int num_logops; 3678 int num_logops;
3680 int error; 3679 int error;
3681 3680
@@ -4020,7 +4019,7 @@ xlog_recover_process_iunlinks(
4020STATIC int 4019STATIC int
4021xlog_unpack_data_crc( 4020xlog_unpack_data_crc(
4022 struct xlog_rec_header *rhead, 4021 struct xlog_rec_header *rhead,
4023 xfs_caddr_t dp, 4022 char *dp,
4024 struct xlog *log) 4023 struct xlog *log)
4025{ 4024{
4026 __le32 crc; 4025 __le32 crc;
@@ -4050,7 +4049,7 @@ xlog_unpack_data_crc(
4050STATIC int 4049STATIC int
4051xlog_unpack_data( 4050xlog_unpack_data(
4052 struct xlog_rec_header *rhead, 4051 struct xlog_rec_header *rhead,
4053 xfs_caddr_t dp, 4052 char *dp,
4054 struct xlog *log) 4053 struct xlog *log)
4055{ 4054{
4056 int i, j, k; 4055 int i, j, k;
@@ -4132,7 +4131,7 @@ xlog_do_recovery_pass(
4132{ 4131{
4133 xlog_rec_header_t *rhead; 4132 xlog_rec_header_t *rhead;
4134 xfs_daddr_t blk_no; 4133 xfs_daddr_t blk_no;
4135 xfs_caddr_t offset; 4134 char *offset;
4136 xfs_buf_t *hbp, *dbp; 4135 xfs_buf_t *hbp, *dbp;
4137 int error = 0, h_size; 4136 int error = 0, h_size;
4138 int bblks, split_bblks; 4137 int bblks, split_bblks;
diff --git a/fs/xfs/xfs_symlink.c b/fs/xfs/xfs_symlink.c
index 2d90452062b0..4be27b0210af 100644
--- a/fs/xfs/xfs_symlink.c
+++ b/fs/xfs/xfs_symlink.c
@@ -104,7 +104,7 @@ xfs_readlink_bmap(
104 cur_chunk += sizeof(struct xfs_dsymlink_hdr); 104 cur_chunk += sizeof(struct xfs_dsymlink_hdr);
105 } 105 }
106 106
107 memcpy(link + offset, bp->b_addr, byte_cnt); 107 memcpy(link + offset, cur_chunk, byte_cnt);
108 108
109 pathlen -= byte_cnt; 109 pathlen -= byte_cnt;
110 offset += byte_cnt; 110 offset += byte_cnt;
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c
index 573aefb5a573..1098cf490189 100644
--- a/fs/xfs/xfs_trans_ail.c
+++ b/fs/xfs/xfs_trans_ail.c
@@ -159,7 +159,7 @@ xfs_trans_ail_cursor_next(
159{ 159{
160 struct xfs_log_item *lip = cur->item; 160 struct xfs_log_item *lip = cur->item;
161 161
162 if ((__psint_t)lip & 1) 162 if ((uintptr_t)lip & 1)
163 lip = xfs_ail_min(ailp); 163 lip = xfs_ail_min(ailp);
164 if (lip) 164 if (lip)
165 cur->item = xfs_ail_next(ailp, lip); 165 cur->item = xfs_ail_next(ailp, lip);
@@ -196,7 +196,7 @@ xfs_trans_ail_cursor_clear(
196 list_for_each_entry(cur, &ailp->xa_cursors, list) { 196 list_for_each_entry(cur, &ailp->xa_cursors, list) {
197 if (cur->item == lip) 197 if (cur->item == lip)
198 cur->item = (struct xfs_log_item *) 198 cur->item = (struct xfs_log_item *)
199 ((__psint_t)cur->item | 1); 199 ((uintptr_t)cur->item | 1);
200 } 200 }
201} 201}
202 202
@@ -287,7 +287,7 @@ xfs_ail_splice(
287 * find the place in the AIL where the items belong. 287 * find the place in the AIL where the items belong.
288 */ 288 */
289 lip = cur ? cur->item : NULL; 289 lip = cur ? cur->item : NULL;
290 if (!lip || (__psint_t) lip & 1) 290 if (!lip || (uintptr_t)lip & 1)
291 lip = __xfs_trans_ail_cursor_last(ailp, lsn); 291 lip = __xfs_trans_ail_cursor_last(ailp, lsn);
292 292
293 /* 293 /*