Skip to content

Commit decb545

Browse files
Christoph Hellwigdchinner
authored andcommitted
xfs: change the type of ic_datap
Turn ic_datap from a char into a void pointer given that it points to arbitrary data. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> [dgc: also remove (char *) cast in xlog_alloc_log()] Signed-off-by: Dave Chinner <david@fromorbit.com>
1 parent d80fc29 commit decb545

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

fs/xfs/xfs_log.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,7 @@ xlog_alloc_log(
16441644
iclog->ic_log = log;
16451645
atomic_set(&iclog->ic_refcnt, 0);
16461646
INIT_LIST_HEAD(&iclog->ic_callbacks);
1647-
iclog->ic_datap = (char *)iclog->ic_data + log->l_iclog_hsize;
1647+
iclog->ic_datap = (void *)iclog->ic_data + log->l_iclog_hsize;
16481648

16491649
init_waitqueue_head(&iclog->ic_force_wait);
16501650
init_waitqueue_head(&iclog->ic_write_wait);
@@ -3664,7 +3664,7 @@ xlog_verify_iclog(
36643664
if (field_offset & 0x1ff) {
36653665
clientid = ophead->oh_clientid;
36663666
} else {
3667-
idx = BTOBBT((char *)&ophead->oh_clientid - iclog->ic_datap);
3667+
idx = BTOBBT((void *)&ophead->oh_clientid - iclog->ic_datap);
36683668
if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) {
36693669
j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
36703670
k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
@@ -3687,8 +3687,7 @@ xlog_verify_iclog(
36873687
if (field_offset & 0x1ff) {
36883688
op_len = be32_to_cpu(ophead->oh_len);
36893689
} else {
3690-
idx = BTOBBT((uintptr_t)&ophead->oh_len -
3691-
(uintptr_t)iclog->ic_datap);
3690+
idx = BTOBBT((void *)&ophead->oh_len - iclog->ic_datap);
36923691
if (idx >= (XLOG_HEADER_CYCLE_SIZE / BBSIZE)) {
36933692
j = idx / (XLOG_HEADER_CYCLE_SIZE / BBSIZE);
36943693
k = idx % (XLOG_HEADER_CYCLE_SIZE / BBSIZE);

fs/xfs/xfs_log_priv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ typedef struct xlog_in_core {
190190
u32 ic_offset;
191191
enum xlog_iclog_state ic_state;
192192
unsigned int ic_flags;
193-
char *ic_datap; /* pointer to iclog data */
193+
void *ic_datap; /* pointer to iclog data */
194194
struct list_head ic_callbacks;
195195

196196
/* reference counts need their own cacheline */

0 commit comments

Comments
 (0)