1
0
Fork 0

xfs: remove xfs_caddr_t

Just use char pointers directly instead of the confusing typedef to a
pointer type.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
hifive-unleashed-5.1
Christoph Hellwig 2015-06-22 09:45:10 +10:00 committed by Dave Chinner
parent 5809d5e083
commit b2a922cd6c
3 changed files with 29 additions and 30 deletions

View File

@ -35,7 +35,6 @@ typedef unsigned long long int __uint64_t;
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;

View File

@ -1602,7 +1602,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);
@ -3809,7 +3809,7 @@ xlog_verify_iclog(
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);

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;
@ -2502,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;
@ -3363,17 +3363,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;
@ -3409,12 +3409,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;
@ -3503,7 +3503,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)
@ -3610,8 +3610,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;
@ -3660,11 +3660,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;
@ -4009,7 +4009,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;
@ -4039,7 +4039,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;
@ -4121,7 +4121,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;