aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_dir2_data.c')
-rw-r--r--fs/xfs/xfs_dir2_data.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/fs/xfs/xfs_dir2_data.c b/fs/xfs/xfs_dir2_data.c
index 2046988e9eb2..44ffd4d6bc91 100644
--- a/fs/xfs/xfs_dir2_data.c
+++ b/fs/xfs/xfs_dir2_data.c
@@ -42,8 +42,8 @@ xfs_dir2_data_freefind(xfs_dir2_data_hdr_t *hdr, xfs_dir2_data_unused_t *dup);
42 */ 42 */
43void 43void
44xfs_dir2_data_check( 44xfs_dir2_data_check(
45 xfs_inode_t *dp, /* incore inode pointer */ 45 struct xfs_inode *dp, /* incore inode pointer */
46 xfs_dabuf_t *bp) /* data block's buffer */ 46 struct xfs_buf *bp) /* data block's buffer */
47{ 47{
48 xfs_dir2_dataptr_t addr; /* addr for leaf lookup */ 48 xfs_dir2_dataptr_t addr; /* addr for leaf lookup */
49 xfs_dir2_data_free_t *bf; /* bestfree table */ 49 xfs_dir2_data_free_t *bf; /* bestfree table */
@@ -65,7 +65,7 @@ xfs_dir2_data_check(
65 struct xfs_name name; 65 struct xfs_name name;
66 66
67 mp = dp->i_mount; 67 mp = dp->i_mount;
68 hdr = bp->data; 68 hdr = bp->b_addr;
69 bf = hdr->bestfree; 69 bf = hdr->bestfree;
70 p = (char *)(hdr + 1); 70 p = (char *)(hdr + 1);
71 71
@@ -389,9 +389,9 @@ int /* error */
389xfs_dir2_data_init( 389xfs_dir2_data_init(
390 xfs_da_args_t *args, /* directory operation args */ 390 xfs_da_args_t *args, /* directory operation args */
391 xfs_dir2_db_t blkno, /* logical dir block number */ 391 xfs_dir2_db_t blkno, /* logical dir block number */
392 xfs_dabuf_t **bpp) /* output block buffer */ 392 struct xfs_buf **bpp) /* output block buffer */
393{ 393{
394 xfs_dabuf_t *bp; /* block buffer */ 394 struct xfs_buf *bp; /* block buffer */
395 xfs_dir2_data_hdr_t *hdr; /* data block header */ 395 xfs_dir2_data_hdr_t *hdr; /* data block header */
396 xfs_inode_t *dp; /* incore directory inode */ 396 xfs_inode_t *dp; /* incore directory inode */
397 xfs_dir2_data_unused_t *dup; /* unused entry pointer */ 397 xfs_dir2_data_unused_t *dup; /* unused entry pointer */
@@ -417,7 +417,7 @@ xfs_dir2_data_init(
417 /* 417 /*
418 * Initialize the header. 418 * Initialize the header.
419 */ 419 */
420 hdr = bp->data; 420 hdr = bp->b_addr;
421 hdr->magic = cpu_to_be32(XFS_DIR2_DATA_MAGIC); 421 hdr->magic = cpu_to_be32(XFS_DIR2_DATA_MAGIC);
422 hdr->bestfree[0].offset = cpu_to_be16(sizeof(*hdr)); 422 hdr->bestfree[0].offset = cpu_to_be16(sizeof(*hdr));
423 for (i = 1; i < XFS_DIR2_DATA_FD_COUNT; i++) { 423 for (i = 1; i < XFS_DIR2_DATA_FD_COUNT; i++) {
@@ -449,16 +449,16 @@ xfs_dir2_data_init(
449 */ 449 */
450void 450void
451xfs_dir2_data_log_entry( 451xfs_dir2_data_log_entry(
452 xfs_trans_t *tp, /* transaction pointer */ 452 struct xfs_trans *tp,
453 xfs_dabuf_t *bp, /* block buffer */ 453 struct xfs_buf *bp,
454 xfs_dir2_data_entry_t *dep) /* data entry pointer */ 454 xfs_dir2_data_entry_t *dep) /* data entry pointer */
455{ 455{
456 xfs_dir2_data_hdr_t *hdr = bp->data; 456 xfs_dir2_data_hdr_t *hdr = bp->b_addr;
457 457
458 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) || 458 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) ||
459 hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC)); 459 hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC));
460 460
461 xfs_da_log_buf(tp, bp, (uint)((char *)dep - (char *)hdr), 461 xfs_trans_log_buf(tp, bp, (uint)((char *)dep - (char *)hdr),
462 (uint)((char *)(xfs_dir2_data_entry_tag_p(dep) + 1) - 462 (uint)((char *)(xfs_dir2_data_entry_tag_p(dep) + 1) -
463 (char *)hdr - 1)); 463 (char *)hdr - 1));
464} 464}
@@ -468,15 +468,15 @@ xfs_dir2_data_log_entry(
468 */ 468 */
469void 469void
470xfs_dir2_data_log_header( 470xfs_dir2_data_log_header(
471 xfs_trans_t *tp, /* transaction pointer */ 471 struct xfs_trans *tp,
472 xfs_dabuf_t *bp) /* block buffer */ 472 struct xfs_buf *bp)
473{ 473{
474 xfs_dir2_data_hdr_t *hdr = bp->data; 474 xfs_dir2_data_hdr_t *hdr = bp->b_addr;
475 475
476 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) || 476 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) ||
477 hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC)); 477 hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC));
478 478
479 xfs_da_log_buf(tp, bp, 0, sizeof(*hdr) - 1); 479 xfs_trans_log_buf(tp, bp, 0, sizeof(*hdr) - 1);
480} 480}
481 481
482/* 482/*
@@ -484,11 +484,11 @@ xfs_dir2_data_log_header(
484 */ 484 */
485void 485void
486xfs_dir2_data_log_unused( 486xfs_dir2_data_log_unused(
487 xfs_trans_t *tp, /* transaction pointer */ 487 struct xfs_trans *tp,
488 xfs_dabuf_t *bp, /* block buffer */ 488 struct xfs_buf *bp,
489 xfs_dir2_data_unused_t *dup) /* data unused pointer */ 489 xfs_dir2_data_unused_t *dup) /* data unused pointer */
490{ 490{
491 xfs_dir2_data_hdr_t *hdr = bp->data; 491 xfs_dir2_data_hdr_t *hdr = bp->b_addr;
492 492
493 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) || 493 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) ||
494 hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC)); 494 hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC));
@@ -496,13 +496,13 @@ xfs_dir2_data_log_unused(
496 /* 496 /*
497 * Log the first part of the unused entry. 497 * Log the first part of the unused entry.
498 */ 498 */
499 xfs_da_log_buf(tp, bp, (uint)((char *)dup - (char *)hdr), 499 xfs_trans_log_buf(tp, bp, (uint)((char *)dup - (char *)hdr),
500 (uint)((char *)&dup->length + sizeof(dup->length) - 500 (uint)((char *)&dup->length + sizeof(dup->length) -
501 1 - (char *)hdr)); 501 1 - (char *)hdr));
502 /* 502 /*
503 * Log the end (tag) of the unused entry. 503 * Log the end (tag) of the unused entry.
504 */ 504 */
505 xfs_da_log_buf(tp, bp, 505 xfs_trans_log_buf(tp, bp,
506 (uint)((char *)xfs_dir2_data_unused_tag_p(dup) - (char *)hdr), 506 (uint)((char *)xfs_dir2_data_unused_tag_p(dup) - (char *)hdr),
507 (uint)((char *)xfs_dir2_data_unused_tag_p(dup) - (char *)hdr + 507 (uint)((char *)xfs_dir2_data_unused_tag_p(dup) - (char *)hdr +
508 sizeof(xfs_dir2_data_off_t) - 1)); 508 sizeof(xfs_dir2_data_off_t) - 1));
@@ -514,8 +514,8 @@ xfs_dir2_data_log_unused(
514 */ 514 */
515void 515void
516xfs_dir2_data_make_free( 516xfs_dir2_data_make_free(
517 xfs_trans_t *tp, /* transaction pointer */ 517 struct xfs_trans *tp,
518 xfs_dabuf_t *bp, /* block buffer */ 518 struct xfs_buf *bp,
519 xfs_dir2_data_aoff_t offset, /* starting byte offset */ 519 xfs_dir2_data_aoff_t offset, /* starting byte offset */
520 xfs_dir2_data_aoff_t len, /* length in bytes */ 520 xfs_dir2_data_aoff_t len, /* length in bytes */
521 int *needlogp, /* out: log header */ 521 int *needlogp, /* out: log header */
@@ -531,7 +531,7 @@ xfs_dir2_data_make_free(
531 xfs_dir2_data_unused_t *prevdup; /* unused entry before us */ 531 xfs_dir2_data_unused_t *prevdup; /* unused entry before us */
532 532
533 mp = tp->t_mountp; 533 mp = tp->t_mountp;
534 hdr = bp->data; 534 hdr = bp->b_addr;
535 535
536 /* 536 /*
537 * Figure out where the end of the data area is. 537 * Figure out where the end of the data area is.
@@ -696,8 +696,8 @@ xfs_dir2_data_make_free(
696 */ 696 */
697void 697void
698xfs_dir2_data_use_free( 698xfs_dir2_data_use_free(
699 xfs_trans_t *tp, /* transaction pointer */ 699 struct xfs_trans *tp,
700 xfs_dabuf_t *bp, /* data block buffer */ 700 struct xfs_buf *bp,
701 xfs_dir2_data_unused_t *dup, /* unused entry */ 701 xfs_dir2_data_unused_t *dup, /* unused entry */
702 xfs_dir2_data_aoff_t offset, /* starting offset to use */ 702 xfs_dir2_data_aoff_t offset, /* starting offset to use */
703 xfs_dir2_data_aoff_t len, /* length to use */ 703 xfs_dir2_data_aoff_t len, /* length to use */
@@ -713,7 +713,7 @@ xfs_dir2_data_use_free(
713 xfs_dir2_data_unused_t *newdup2; /* another new unused entry */ 713 xfs_dir2_data_unused_t *newdup2; /* another new unused entry */
714 int oldlen; /* old unused entry's length */ 714 int oldlen; /* old unused entry's length */
715 715
716 hdr = bp->data; 716 hdr = bp->b_addr;
717 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) || 717 ASSERT(hdr->magic == cpu_to_be32(XFS_DIR2_DATA_MAGIC) ||
718 hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC)); 718 hdr->magic == cpu_to_be32(XFS_DIR2_BLOCK_MAGIC));
719 ASSERT(be16_to_cpu(dup->freetag) == XFS_DIR2_DATA_FREE_TAG); 719 ASSERT(be16_to_cpu(dup->freetag) == XFS_DIR2_DATA_FREE_TAG);