diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-06-23 04:11:15 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-07-26 14:16:36 -0400 |
commit | 4e0d5f926b80b06234a4ed664d6ae8c54fb08c4b (patch) | |
tree | 6e8412c8e0dec25e5e895acb3e73fc25855800dd /fs/xfs/xfs_inode_item.c | |
parent | 898621d5a72c6799a9a13fce20443b4b6699899c (diff) |
xfs: fix the xfs_log_iovec i_addr type
By making this member a void pointer we can get rid of a lot of pointless
casts.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_inode_item.c')
-rw-r--r-- | fs/xfs/xfs_inode_item.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index ad050c618e62..2998b2cb7466 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
@@ -217,7 +217,7 @@ xfs_inode_item_format( | |||
217 | int nrecs; | 217 | int nrecs; |
218 | xfs_mount_t *mp; | 218 | xfs_mount_t *mp; |
219 | 219 | ||
220 | vecp->i_addr = (xfs_caddr_t)&iip->ili_format; | 220 | vecp->i_addr = &iip->ili_format; |
221 | vecp->i_len = sizeof(xfs_inode_log_format_t); | 221 | vecp->i_len = sizeof(xfs_inode_log_format_t); |
222 | vecp->i_type = XLOG_REG_TYPE_IFORMAT; | 222 | vecp->i_type = XLOG_REG_TYPE_IFORMAT; |
223 | vecp++; | 223 | vecp++; |
@@ -268,7 +268,7 @@ xfs_inode_item_format( | |||
268 | */ | 268 | */ |
269 | xfs_synchronize_times(ip); | 269 | xfs_synchronize_times(ip); |
270 | 270 | ||
271 | vecp->i_addr = (xfs_caddr_t)&ip->i_d; | 271 | vecp->i_addr = &ip->i_d; |
272 | vecp->i_len = sizeof(struct xfs_icdinode); | 272 | vecp->i_len = sizeof(struct xfs_icdinode); |
273 | vecp->i_type = XLOG_REG_TYPE_ICORE; | 273 | vecp->i_type = XLOG_REG_TYPE_ICORE; |
274 | vecp++; | 274 | vecp++; |
@@ -324,8 +324,7 @@ xfs_inode_item_format( | |||
324 | * extents, so just point to the | 324 | * extents, so just point to the |
325 | * real extents array. | 325 | * real extents array. |
326 | */ | 326 | */ |
327 | vecp->i_addr = | 327 | vecp->i_addr = ip->i_df.if_u1.if_extents; |
328 | (char *)(ip->i_df.if_u1.if_extents); | ||
329 | vecp->i_len = ip->i_df.if_bytes; | 328 | vecp->i_len = ip->i_df.if_bytes; |
330 | vecp->i_type = XLOG_REG_TYPE_IEXT; | 329 | vecp->i_type = XLOG_REG_TYPE_IEXT; |
331 | } else | 330 | } else |
@@ -343,7 +342,7 @@ xfs_inode_item_format( | |||
343 | ext_buffer = kmem_alloc(ip->i_df.if_bytes, | 342 | ext_buffer = kmem_alloc(ip->i_df.if_bytes, |
344 | KM_SLEEP); | 343 | KM_SLEEP); |
345 | iip->ili_extents_buf = ext_buffer; | 344 | iip->ili_extents_buf = ext_buffer; |
346 | vecp->i_addr = (xfs_caddr_t)ext_buffer; | 345 | vecp->i_addr = ext_buffer; |
347 | vecp->i_len = xfs_iextents_copy(ip, ext_buffer, | 346 | vecp->i_len = xfs_iextents_copy(ip, ext_buffer, |
348 | XFS_DATA_FORK); | 347 | XFS_DATA_FORK); |
349 | vecp->i_type = XLOG_REG_TYPE_IEXT; | 348 | vecp->i_type = XLOG_REG_TYPE_IEXT; |
@@ -362,7 +361,7 @@ xfs_inode_item_format( | |||
362 | if (iip->ili_format.ilf_fields & XFS_ILOG_DBROOT) { | 361 | if (iip->ili_format.ilf_fields & XFS_ILOG_DBROOT) { |
363 | ASSERT(ip->i_df.if_broot_bytes > 0); | 362 | ASSERT(ip->i_df.if_broot_bytes > 0); |
364 | ASSERT(ip->i_df.if_broot != NULL); | 363 | ASSERT(ip->i_df.if_broot != NULL); |
365 | vecp->i_addr = (xfs_caddr_t)ip->i_df.if_broot; | 364 | vecp->i_addr = ip->i_df.if_broot; |
366 | vecp->i_len = ip->i_df.if_broot_bytes; | 365 | vecp->i_len = ip->i_df.if_broot_bytes; |
367 | vecp->i_type = XLOG_REG_TYPE_IBROOT; | 366 | vecp->i_type = XLOG_REG_TYPE_IBROOT; |
368 | vecp++; | 367 | vecp++; |
@@ -380,7 +379,7 @@ xfs_inode_item_format( | |||
380 | ASSERT(ip->i_df.if_u1.if_data != NULL); | 379 | ASSERT(ip->i_df.if_u1.if_data != NULL); |
381 | ASSERT(ip->i_d.di_size > 0); | 380 | ASSERT(ip->i_d.di_size > 0); |
382 | 381 | ||
383 | vecp->i_addr = (xfs_caddr_t)ip->i_df.if_u1.if_data; | 382 | vecp->i_addr = ip->i_df.if_u1.if_data; |
384 | /* | 383 | /* |
385 | * Round i_bytes up to a word boundary. | 384 | * Round i_bytes up to a word boundary. |
386 | * The underlying memory is guaranteed to | 385 | * The underlying memory is guaranteed to |
@@ -454,7 +453,7 @@ xfs_inode_item_format( | |||
454 | * There are not delayed allocation extents | 453 | * There are not delayed allocation extents |
455 | * for attributes, so just point at the array. | 454 | * for attributes, so just point at the array. |
456 | */ | 455 | */ |
457 | vecp->i_addr = (char *)(ip->i_afp->if_u1.if_extents); | 456 | vecp->i_addr = ip->i_afp->if_u1.if_extents; |
458 | vecp->i_len = ip->i_afp->if_bytes; | 457 | vecp->i_len = ip->i_afp->if_bytes; |
459 | #else | 458 | #else |
460 | ASSERT(iip->ili_aextents_buf == NULL); | 459 | ASSERT(iip->ili_aextents_buf == NULL); |
@@ -464,7 +463,7 @@ xfs_inode_item_format( | |||
464 | ext_buffer = kmem_alloc(ip->i_afp->if_bytes, | 463 | ext_buffer = kmem_alloc(ip->i_afp->if_bytes, |
465 | KM_SLEEP); | 464 | KM_SLEEP); |
466 | iip->ili_aextents_buf = ext_buffer; | 465 | iip->ili_aextents_buf = ext_buffer; |
467 | vecp->i_addr = (xfs_caddr_t)ext_buffer; | 466 | vecp->i_addr = ext_buffer; |
468 | vecp->i_len = xfs_iextents_copy(ip, ext_buffer, | 467 | vecp->i_len = xfs_iextents_copy(ip, ext_buffer, |
469 | XFS_ATTR_FORK); | 468 | XFS_ATTR_FORK); |
470 | #endif | 469 | #endif |
@@ -481,7 +480,7 @@ xfs_inode_item_format( | |||
481 | if (iip->ili_format.ilf_fields & XFS_ILOG_ABROOT) { | 480 | if (iip->ili_format.ilf_fields & XFS_ILOG_ABROOT) { |
482 | ASSERT(ip->i_afp->if_broot_bytes > 0); | 481 | ASSERT(ip->i_afp->if_broot_bytes > 0); |
483 | ASSERT(ip->i_afp->if_broot != NULL); | 482 | ASSERT(ip->i_afp->if_broot != NULL); |
484 | vecp->i_addr = (xfs_caddr_t)ip->i_afp->if_broot; | 483 | vecp->i_addr = ip->i_afp->if_broot; |
485 | vecp->i_len = ip->i_afp->if_broot_bytes; | 484 | vecp->i_len = ip->i_afp->if_broot_bytes; |
486 | vecp->i_type = XLOG_REG_TYPE_IATTR_BROOT; | 485 | vecp->i_type = XLOG_REG_TYPE_IATTR_BROOT; |
487 | vecp++; | 486 | vecp++; |
@@ -497,7 +496,7 @@ xfs_inode_item_format( | |||
497 | ASSERT(ip->i_afp->if_bytes > 0); | 496 | ASSERT(ip->i_afp->if_bytes > 0); |
498 | ASSERT(ip->i_afp->if_u1.if_data != NULL); | 497 | ASSERT(ip->i_afp->if_u1.if_data != NULL); |
499 | 498 | ||
500 | vecp->i_addr = (xfs_caddr_t)ip->i_afp->if_u1.if_data; | 499 | vecp->i_addr = ip->i_afp->if_u1.if_data; |
501 | /* | 500 | /* |
502 | * Round i_bytes up to a word boundary. | 501 | * Round i_bytes up to a word boundary. |
503 | * The underlying memory is guaranteed to | 502 | * The underlying memory is guaranteed to |
@@ -938,9 +937,8 @@ xfs_inode_item_format_convert( | |||
938 | xfs_inode_log_format_t *in_f) | 937 | xfs_inode_log_format_t *in_f) |
939 | { | 938 | { |
940 | if (buf->i_len == sizeof(xfs_inode_log_format_32_t)) { | 939 | if (buf->i_len == sizeof(xfs_inode_log_format_32_t)) { |
941 | xfs_inode_log_format_32_t *in_f32; | 940 | xfs_inode_log_format_32_t *in_f32 = buf->i_addr; |
942 | 941 | ||
943 | in_f32 = (xfs_inode_log_format_32_t *)buf->i_addr; | ||
944 | in_f->ilf_type = in_f32->ilf_type; | 942 | in_f->ilf_type = in_f32->ilf_type; |
945 | in_f->ilf_size = in_f32->ilf_size; | 943 | in_f->ilf_size = in_f32->ilf_size; |
946 | in_f->ilf_fields = in_f32->ilf_fields; | 944 | in_f->ilf_fields = in_f32->ilf_fields; |
@@ -956,9 +954,8 @@ xfs_inode_item_format_convert( | |||
956 | in_f->ilf_boffset = in_f32->ilf_boffset; | 954 | in_f->ilf_boffset = in_f32->ilf_boffset; |
957 | return 0; | 955 | return 0; |
958 | } else if (buf->i_len == sizeof(xfs_inode_log_format_64_t)){ | 956 | } else if (buf->i_len == sizeof(xfs_inode_log_format_64_t)){ |
959 | xfs_inode_log_format_64_t *in_f64; | 957 | xfs_inode_log_format_64_t *in_f64 = buf->i_addr; |
960 | 958 | ||
961 | in_f64 = (xfs_inode_log_format_64_t *)buf->i_addr; | ||
962 | in_f->ilf_type = in_f64->ilf_type; | 959 | in_f->ilf_type = in_f64->ilf_type; |
963 | in_f->ilf_size = in_f64->ilf_size; | 960 | in_f->ilf_size = in_f64->ilf_size; |
964 | in_f->ilf_fields = in_f64->ilf_fields; | 961 | in_f->ilf_fields = in_f64->ilf_fields; |