diff options
author | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:35:13 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:35:13 -0400 |
commit | ac8ba50f6be4a3ab49a2ad2cb676422af4ebaf8a (patch) | |
tree | 7f08e8da5a8ae0e39df616faff5c94f2c386b46c /fs/xfs/xfs_dir2_sf.c | |
parent | 8bc387875870c87087f138741f456983cbc54660 (diff) |
xfs: kill struct xfs_dir2_sf
The list field of it is never cactually used, so all uses can simply be
replaced with the xfs_dir2_sf_hdr_t type that it has as first member.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_sf.c')
-rw-r--r-- | fs/xfs/xfs_dir2_sf.c | 188 |
1 files changed, 94 insertions, 94 deletions
diff --git a/fs/xfs/xfs_dir2_sf.c b/fs/xfs/xfs_dir2_sf.c index 4c3ecf2c7397..806b348f496f 100644 --- a/fs/xfs/xfs_dir2_sf.c +++ b/fs/xfs/xfs_dir2_sf.c | |||
@@ -67,10 +67,10 @@ static void xfs_dir2_sf_toino8(xfs_da_args_t *args); | |||
67 | */ | 67 | */ |
68 | static xfs_ino_t | 68 | static xfs_ino_t |
69 | xfs_dir2_sf_get_ino( | 69 | xfs_dir2_sf_get_ino( |
70 | struct xfs_dir2_sf *sfp, | 70 | struct xfs_dir2_sf_hdr *hdr, |
71 | xfs_dir2_inou_t *from) | 71 | xfs_dir2_inou_t *from) |
72 | { | 72 | { |
73 | if (sfp->hdr.i8count) | 73 | if (hdr->i8count) |
74 | return XFS_GET_DIR_INO8(from->i8); | 74 | return XFS_GET_DIR_INO8(from->i8); |
75 | else | 75 | else |
76 | return XFS_GET_DIR_INO4(from->i4); | 76 | return XFS_GET_DIR_INO4(from->i4); |
@@ -78,11 +78,11 @@ xfs_dir2_sf_get_ino( | |||
78 | 78 | ||
79 | static void | 79 | static void |
80 | xfs_dir2_sf_put_ino( | 80 | xfs_dir2_sf_put_ino( |
81 | struct xfs_dir2_sf *sfp, | 81 | struct xfs_dir2_sf_hdr *hdr, |
82 | xfs_dir2_inou_t *to, | 82 | xfs_dir2_inou_t *to, |
83 | xfs_ino_t ino) | 83 | xfs_ino_t ino) |
84 | { | 84 | { |
85 | if (sfp->hdr.i8count) | 85 | if (hdr->i8count) |
86 | XFS_PUT_DIR_INO8(ino, to->i8); | 86 | XFS_PUT_DIR_INO8(ino, to->i8); |
87 | else | 87 | else |
88 | XFS_PUT_DIR_INO4(ino, to->i4); | 88 | XFS_PUT_DIR_INO4(ino, to->i4); |
@@ -90,17 +90,17 @@ xfs_dir2_sf_put_ino( | |||
90 | 90 | ||
91 | xfs_ino_t | 91 | xfs_ino_t |
92 | xfs_dir2_sf_get_parent_ino( | 92 | xfs_dir2_sf_get_parent_ino( |
93 | struct xfs_dir2_sf *sfp) | 93 | struct xfs_dir2_sf_hdr *hdr) |
94 | { | 94 | { |
95 | return xfs_dir2_sf_get_ino(sfp, &sfp->hdr.parent); | 95 | return xfs_dir2_sf_get_ino(hdr, &hdr->parent); |
96 | } | 96 | } |
97 | 97 | ||
98 | static void | 98 | static void |
99 | xfs_dir2_sf_put_parent_ino( | 99 | xfs_dir2_sf_put_parent_ino( |
100 | struct xfs_dir2_sf *sfp, | 100 | struct xfs_dir2_sf_hdr *hdr, |
101 | xfs_ino_t ino) | 101 | xfs_ino_t ino) |
102 | { | 102 | { |
103 | xfs_dir2_sf_put_ino(sfp, &sfp->hdr.parent, ino); | 103 | xfs_dir2_sf_put_ino(hdr, &hdr->parent, ino); |
104 | } | 104 | } |
105 | 105 | ||
106 | /* | 106 | /* |
@@ -117,19 +117,19 @@ xfs_dir2_sfe_inop( | |||
117 | 117 | ||
118 | xfs_ino_t | 118 | xfs_ino_t |
119 | xfs_dir2_sfe_get_ino( | 119 | xfs_dir2_sfe_get_ino( |
120 | struct xfs_dir2_sf *sfp, | 120 | struct xfs_dir2_sf_hdr *hdr, |
121 | struct xfs_dir2_sf_entry *sfep) | 121 | struct xfs_dir2_sf_entry *sfep) |
122 | { | 122 | { |
123 | return xfs_dir2_sf_get_ino(sfp, xfs_dir2_sfe_inop(sfep)); | 123 | return xfs_dir2_sf_get_ino(hdr, xfs_dir2_sfe_inop(sfep)); |
124 | } | 124 | } |
125 | 125 | ||
126 | static void | 126 | static void |
127 | xfs_dir2_sfe_put_ino( | 127 | xfs_dir2_sfe_put_ino( |
128 | struct xfs_dir2_sf *sfp, | 128 | struct xfs_dir2_sf_hdr *hdr, |
129 | struct xfs_dir2_sf_entry *sfep, | 129 | struct xfs_dir2_sf_entry *sfep, |
130 | xfs_ino_t ino) | 130 | xfs_ino_t ino) |
131 | { | 131 | { |
132 | xfs_dir2_sf_put_ino(sfp, xfs_dir2_sfe_inop(sfep), ino); | 132 | xfs_dir2_sf_put_ino(hdr, xfs_dir2_sfe_inop(sfep), ino); |
133 | } | 133 | } |
134 | 134 | ||
135 | /* | 135 | /* |
@@ -211,7 +211,7 @@ xfs_dir2_block_sfsize( | |||
211 | */ | 211 | */ |
212 | sfhp->count = count; | 212 | sfhp->count = count; |
213 | sfhp->i8count = i8count; | 213 | sfhp->i8count = i8count; |
214 | xfs_dir2_sf_put_parent_ino((xfs_dir2_sf_t *)sfhp, parent); | 214 | xfs_dir2_sf_put_parent_ino(sfhp, parent); |
215 | return size; | 215 | return size; |
216 | } | 216 | } |
217 | 217 | ||
@@ -237,7 +237,7 @@ xfs_dir2_block_to_sf( | |||
237 | xfs_mount_t *mp; /* filesystem mount point */ | 237 | xfs_mount_t *mp; /* filesystem mount point */ |
238 | char *ptr; /* current data pointer */ | 238 | char *ptr; /* current data pointer */ |
239 | xfs_dir2_sf_entry_t *sfep; /* shortform entry */ | 239 | xfs_dir2_sf_entry_t *sfep; /* shortform entry */ |
240 | xfs_dir2_sf_t *sfp; /* shortform structure */ | 240 | xfs_dir2_sf_hdr_t *sfp; /* shortform directory header */ |
241 | 241 | ||
242 | trace_xfs_dir2_block_to_sf(args); | 242 | trace_xfs_dir2_block_to_sf(args); |
243 | 243 | ||
@@ -270,7 +270,7 @@ xfs_dir2_block_to_sf( | |||
270 | /* | 270 | /* |
271 | * Copy the header into the newly allocate local space. | 271 | * Copy the header into the newly allocate local space. |
272 | */ | 272 | */ |
273 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 273 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
274 | memcpy(sfp, sfhp, xfs_dir2_sf_hdr_size(sfhp->i8count)); | 274 | memcpy(sfp, sfhp, xfs_dir2_sf_hdr_size(sfhp->i8count)); |
275 | dp->i_d.di_size = size; | 275 | dp->i_d.di_size = size; |
276 | /* | 276 | /* |
@@ -349,7 +349,7 @@ xfs_dir2_sf_addname( | |||
349 | xfs_dir2_data_aoff_t offset = 0; /* offset for new entry */ | 349 | xfs_dir2_data_aoff_t offset = 0; /* offset for new entry */ |
350 | int old_isize; /* di_size before adding name */ | 350 | int old_isize; /* di_size before adding name */ |
351 | int pick; /* which algorithm to use */ | 351 | int pick; /* which algorithm to use */ |
352 | xfs_dir2_sf_t *sfp; /* shortform structure */ | 352 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ |
353 | xfs_dir2_sf_entry_t *sfep = NULL; /* shortform entry */ | 353 | xfs_dir2_sf_entry_t *sfep = NULL; /* shortform entry */ |
354 | 354 | ||
355 | trace_xfs_dir2_sf_addname(args); | 355 | trace_xfs_dir2_sf_addname(args); |
@@ -366,8 +366,8 @@ xfs_dir2_sf_addname( | |||
366 | } | 366 | } |
367 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); | 367 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); |
368 | ASSERT(dp->i_df.if_u1.if_data != NULL); | 368 | ASSERT(dp->i_df.if_u1.if_data != NULL); |
369 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 369 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
370 | ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->hdr.i8count)); | 370 | ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->i8count)); |
371 | /* | 371 | /* |
372 | * Compute entry (and change in) size. | 372 | * Compute entry (and change in) size. |
373 | */ | 373 | */ |
@@ -378,7 +378,7 @@ xfs_dir2_sf_addname( | |||
378 | /* | 378 | /* |
379 | * Do we have to change to 8 byte inodes? | 379 | * Do we have to change to 8 byte inodes? |
380 | */ | 380 | */ |
381 | if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && sfp->hdr.i8count == 0) { | 381 | if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && sfp->i8count == 0) { |
382 | /* | 382 | /* |
383 | * Yes, adjust the entry size and the total size. | 383 | * Yes, adjust the entry size and the total size. |
384 | */ | 384 | */ |
@@ -386,7 +386,7 @@ xfs_dir2_sf_addname( | |||
386 | (uint)sizeof(xfs_dir2_ino8_t) - | 386 | (uint)sizeof(xfs_dir2_ino8_t) - |
387 | (uint)sizeof(xfs_dir2_ino4_t); | 387 | (uint)sizeof(xfs_dir2_ino4_t); |
388 | incr_isize += | 388 | incr_isize += |
389 | (sfp->hdr.count + 2) * | 389 | (sfp->count + 2) * |
390 | ((uint)sizeof(xfs_dir2_ino8_t) - | 390 | ((uint)sizeof(xfs_dir2_ino8_t) - |
391 | (uint)sizeof(xfs_dir2_ino4_t)); | 391 | (uint)sizeof(xfs_dir2_ino4_t)); |
392 | objchange = 1; | 392 | objchange = 1; |
@@ -456,11 +456,11 @@ xfs_dir2_sf_addname_easy( | |||
456 | { | 456 | { |
457 | int byteoff; /* byte offset in sf dir */ | 457 | int byteoff; /* byte offset in sf dir */ |
458 | xfs_inode_t *dp; /* incore directory inode */ | 458 | xfs_inode_t *dp; /* incore directory inode */ |
459 | xfs_dir2_sf_t *sfp; /* shortform structure */ | 459 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ |
460 | 460 | ||
461 | dp = args->dp; | 461 | dp = args->dp; |
462 | 462 | ||
463 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 463 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
464 | byteoff = (int)((char *)sfep - (char *)sfp); | 464 | byteoff = (int)((char *)sfep - (char *)sfp); |
465 | /* | 465 | /* |
466 | * Grow the in-inode space. | 466 | * Grow the in-inode space. |
@@ -470,7 +470,7 @@ xfs_dir2_sf_addname_easy( | |||
470 | /* | 470 | /* |
471 | * Need to set up again due to realloc of the inode data. | 471 | * Need to set up again due to realloc of the inode data. |
472 | */ | 472 | */ |
473 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 473 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
474 | sfep = (xfs_dir2_sf_entry_t *)((char *)sfp + byteoff); | 474 | sfep = (xfs_dir2_sf_entry_t *)((char *)sfp + byteoff); |
475 | /* | 475 | /* |
476 | * Fill in the new entry. | 476 | * Fill in the new entry. |
@@ -482,10 +482,10 @@ xfs_dir2_sf_addname_easy( | |||
482 | /* | 482 | /* |
483 | * Update the header and inode. | 483 | * Update the header and inode. |
484 | */ | 484 | */ |
485 | sfp->hdr.count++; | 485 | sfp->count++; |
486 | #if XFS_BIG_INUMS | 486 | #if XFS_BIG_INUMS |
487 | if (args->inumber > XFS_DIR2_MAX_SHORT_INUM) | 487 | if (args->inumber > XFS_DIR2_MAX_SHORT_INUM) |
488 | sfp->hdr.i8count++; | 488 | sfp->i8count++; |
489 | #endif | 489 | #endif |
490 | dp->i_d.di_size = new_isize; | 490 | dp->i_d.di_size = new_isize; |
491 | xfs_dir2_sf_check(args); | 491 | xfs_dir2_sf_check(args); |
@@ -515,19 +515,19 @@ xfs_dir2_sf_addname_hard( | |||
515 | xfs_dir2_data_aoff_t offset; /* current offset value */ | 515 | xfs_dir2_data_aoff_t offset; /* current offset value */ |
516 | int old_isize; /* previous di_size */ | 516 | int old_isize; /* previous di_size */ |
517 | xfs_dir2_sf_entry_t *oldsfep; /* entry in original dir */ | 517 | xfs_dir2_sf_entry_t *oldsfep; /* entry in original dir */ |
518 | xfs_dir2_sf_t *oldsfp; /* original shortform dir */ | 518 | xfs_dir2_sf_hdr_t *oldsfp; /* original shortform dir */ |
519 | xfs_dir2_sf_entry_t *sfep; /* entry in new dir */ | 519 | xfs_dir2_sf_entry_t *sfep; /* entry in new dir */ |
520 | xfs_dir2_sf_t *sfp; /* new shortform dir */ | 520 | xfs_dir2_sf_hdr_t *sfp; /* new shortform dir */ |
521 | 521 | ||
522 | /* | 522 | /* |
523 | * Copy the old directory to the stack buffer. | 523 | * Copy the old directory to the stack buffer. |
524 | */ | 524 | */ |
525 | dp = args->dp; | 525 | dp = args->dp; |
526 | 526 | ||
527 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 527 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
528 | old_isize = (int)dp->i_d.di_size; | 528 | old_isize = (int)dp->i_d.di_size; |
529 | buf = kmem_alloc(old_isize, KM_SLEEP); | 529 | buf = kmem_alloc(old_isize, KM_SLEEP); |
530 | oldsfp = (xfs_dir2_sf_t *)buf; | 530 | oldsfp = (xfs_dir2_sf_hdr_t *)buf; |
531 | memcpy(oldsfp, sfp, old_isize); | 531 | memcpy(oldsfp, sfp, old_isize); |
532 | /* | 532 | /* |
533 | * Loop over the old directory finding the place we're going | 533 | * Loop over the old directory finding the place we're going |
@@ -556,7 +556,7 @@ xfs_dir2_sf_addname_hard( | |||
556 | /* | 556 | /* |
557 | * Reset the pointer since the buffer was reallocated. | 557 | * Reset the pointer since the buffer was reallocated. |
558 | */ | 558 | */ |
559 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 559 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
560 | /* | 560 | /* |
561 | * Copy the first part of the directory, including the header. | 561 | * Copy the first part of the directory, including the header. |
562 | */ | 562 | */ |
@@ -570,10 +570,10 @@ xfs_dir2_sf_addname_hard( | |||
570 | xfs_dir2_sf_put_offset(sfep, offset); | 570 | xfs_dir2_sf_put_offset(sfep, offset); |
571 | memcpy(sfep->name, args->name, sfep->namelen); | 571 | memcpy(sfep->name, args->name, sfep->namelen); |
572 | xfs_dir2_sfe_put_ino(sfp, sfep, args->inumber); | 572 | xfs_dir2_sfe_put_ino(sfp, sfep, args->inumber); |
573 | sfp->hdr.count++; | 573 | sfp->count++; |
574 | #if XFS_BIG_INUMS | 574 | #if XFS_BIG_INUMS |
575 | if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && !objchange) | 575 | if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && !objchange) |
576 | sfp->hdr.i8count++; | 576 | sfp->i8count++; |
577 | #endif | 577 | #endif |
578 | /* | 578 | /* |
579 | * If there's more left to copy, do that. | 579 | * If there's more left to copy, do that. |
@@ -607,14 +607,14 @@ xfs_dir2_sf_addname_pick( | |||
607 | xfs_mount_t *mp; /* filesystem mount point */ | 607 | xfs_mount_t *mp; /* filesystem mount point */ |
608 | xfs_dir2_data_aoff_t offset; /* data block offset */ | 608 | xfs_dir2_data_aoff_t offset; /* data block offset */ |
609 | xfs_dir2_sf_entry_t *sfep; /* shortform entry */ | 609 | xfs_dir2_sf_entry_t *sfep; /* shortform entry */ |
610 | xfs_dir2_sf_t *sfp; /* shortform structure */ | 610 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ |
611 | int size; /* entry's data size */ | 611 | int size; /* entry's data size */ |
612 | int used; /* data bytes used */ | 612 | int used; /* data bytes used */ |
613 | 613 | ||
614 | dp = args->dp; | 614 | dp = args->dp; |
615 | mp = dp->i_mount; | 615 | mp = dp->i_mount; |
616 | 616 | ||
617 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 617 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
618 | size = xfs_dir2_data_entsize(args->namelen); | 618 | size = xfs_dir2_data_entsize(args->namelen); |
619 | offset = XFS_DIR2_DATA_FIRST_OFFSET; | 619 | offset = XFS_DIR2_DATA_FIRST_OFFSET; |
620 | sfep = xfs_dir2_sf_firstentry(sfp); | 620 | sfep = xfs_dir2_sf_firstentry(sfp); |
@@ -624,7 +624,7 @@ xfs_dir2_sf_addname_pick( | |||
624 | * Keep track of data offset and whether we've seen a place | 624 | * Keep track of data offset and whether we've seen a place |
625 | * to insert the new entry. | 625 | * to insert the new entry. |
626 | */ | 626 | */ |
627 | for (i = 0; i < sfp->hdr.count; i++) { | 627 | for (i = 0; i < sfp->count; i++) { |
628 | if (!holefit) | 628 | if (!holefit) |
629 | holefit = offset + size <= xfs_dir2_sf_get_offset(sfep); | 629 | holefit = offset + size <= xfs_dir2_sf_get_offset(sfep); |
630 | offset = xfs_dir2_sf_get_offset(sfep) + | 630 | offset = xfs_dir2_sf_get_offset(sfep) + |
@@ -636,7 +636,7 @@ xfs_dir2_sf_addname_pick( | |||
636 | * was a data block (block form directory). | 636 | * was a data block (block form directory). |
637 | */ | 637 | */ |
638 | used = offset + | 638 | used = offset + |
639 | (sfp->hdr.count + 3) * (uint)sizeof(xfs_dir2_leaf_entry_t) + | 639 | (sfp->count + 3) * (uint)sizeof(xfs_dir2_leaf_entry_t) + |
640 | (uint)sizeof(xfs_dir2_block_tail_t); | 640 | (uint)sizeof(xfs_dir2_block_tail_t); |
641 | /* | 641 | /* |
642 | * If it won't fit in a block form then we can't insert it, | 642 | * If it won't fit in a block form then we can't insert it, |
@@ -682,17 +682,17 @@ xfs_dir2_sf_check( | |||
682 | xfs_ino_t ino; /* entry inode number */ | 682 | xfs_ino_t ino; /* entry inode number */ |
683 | int offset; /* data offset */ | 683 | int offset; /* data offset */ |
684 | xfs_dir2_sf_entry_t *sfep; /* shortform dir entry */ | 684 | xfs_dir2_sf_entry_t *sfep; /* shortform dir entry */ |
685 | xfs_dir2_sf_t *sfp; /* shortform structure */ | 685 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ |
686 | 686 | ||
687 | dp = args->dp; | 687 | dp = args->dp; |
688 | 688 | ||
689 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 689 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
690 | offset = XFS_DIR2_DATA_FIRST_OFFSET; | 690 | offset = XFS_DIR2_DATA_FIRST_OFFSET; |
691 | ino = xfs_dir2_sf_get_parent_ino(sfp); | 691 | ino = xfs_dir2_sf_get_parent_ino(sfp); |
692 | i8count = ino > XFS_DIR2_MAX_SHORT_INUM; | 692 | i8count = ino > XFS_DIR2_MAX_SHORT_INUM; |
693 | 693 | ||
694 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); | 694 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); |
695 | i < sfp->hdr.count; | 695 | i < sfp->count; |
696 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) { | 696 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) { |
697 | ASSERT(xfs_dir2_sf_get_offset(sfep) >= offset); | 697 | ASSERT(xfs_dir2_sf_get_offset(sfep) >= offset); |
698 | ino = xfs_dir2_sfe_get_ino(sfp, sfep); | 698 | ino = xfs_dir2_sfe_get_ino(sfp, sfep); |
@@ -701,11 +701,11 @@ xfs_dir2_sf_check( | |||
701 | xfs_dir2_sf_get_offset(sfep) + | 701 | xfs_dir2_sf_get_offset(sfep) + |
702 | xfs_dir2_data_entsize(sfep->namelen); | 702 | xfs_dir2_data_entsize(sfep->namelen); |
703 | } | 703 | } |
704 | ASSERT(i8count == sfp->hdr.i8count); | 704 | ASSERT(i8count == sfp->i8count); |
705 | ASSERT(XFS_BIG_INUMS || i8count == 0); | 705 | ASSERT(XFS_BIG_INUMS || i8count == 0); |
706 | ASSERT((char *)sfep - (char *)sfp == dp->i_d.di_size); | 706 | ASSERT((char *)sfep - (char *)sfp == dp->i_d.di_size); |
707 | ASSERT(offset + | 707 | ASSERT(offset + |
708 | (sfp->hdr.count + 2) * (uint)sizeof(xfs_dir2_leaf_entry_t) + | 708 | (sfp->count + 2) * (uint)sizeof(xfs_dir2_leaf_entry_t) + |
709 | (uint)sizeof(xfs_dir2_block_tail_t) <= | 709 | (uint)sizeof(xfs_dir2_block_tail_t) <= |
710 | dp->i_mount->m_dirblksize); | 710 | dp->i_mount->m_dirblksize); |
711 | } | 711 | } |
@@ -721,7 +721,7 @@ xfs_dir2_sf_create( | |||
721 | { | 721 | { |
722 | xfs_inode_t *dp; /* incore directory inode */ | 722 | xfs_inode_t *dp; /* incore directory inode */ |
723 | int i8count; /* parent inode is an 8-byte number */ | 723 | int i8count; /* parent inode is an 8-byte number */ |
724 | xfs_dir2_sf_t *sfp; /* shortform structure */ | 724 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ |
725 | int size; /* directory size */ | 725 | int size; /* directory size */ |
726 | 726 | ||
727 | trace_xfs_dir2_sf_create(args); | 727 | trace_xfs_dir2_sf_create(args); |
@@ -751,13 +751,13 @@ xfs_dir2_sf_create( | |||
751 | /* | 751 | /* |
752 | * Fill in the header, | 752 | * Fill in the header, |
753 | */ | 753 | */ |
754 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 754 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
755 | sfp->hdr.i8count = i8count; | 755 | sfp->i8count = i8count; |
756 | /* | 756 | /* |
757 | * Now can put in the inode number, since i8count is set. | 757 | * Now can put in the inode number, since i8count is set. |
758 | */ | 758 | */ |
759 | xfs_dir2_sf_put_parent_ino(sfp, pino); | 759 | xfs_dir2_sf_put_parent_ino(sfp, pino); |
760 | sfp->hdr.count = 0; | 760 | sfp->count = 0; |
761 | dp->i_d.di_size = size; | 761 | dp->i_d.di_size = size; |
762 | xfs_dir2_sf_check(args); | 762 | xfs_dir2_sf_check(args); |
763 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); | 763 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); |
@@ -775,7 +775,7 @@ xfs_dir2_sf_getdents( | |||
775 | xfs_mount_t *mp; /* filesystem mount point */ | 775 | xfs_mount_t *mp; /* filesystem mount point */ |
776 | xfs_dir2_dataptr_t off; /* current entry's offset */ | 776 | xfs_dir2_dataptr_t off; /* current entry's offset */ |
777 | xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ | 777 | xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ |
778 | xfs_dir2_sf_t *sfp; /* shortform structure */ | 778 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ |
779 | xfs_dir2_dataptr_t dot_offset; | 779 | xfs_dir2_dataptr_t dot_offset; |
780 | xfs_dir2_dataptr_t dotdot_offset; | 780 | xfs_dir2_dataptr_t dotdot_offset; |
781 | xfs_ino_t ino; | 781 | xfs_ino_t ino; |
@@ -794,9 +794,9 @@ xfs_dir2_sf_getdents( | |||
794 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); | 794 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); |
795 | ASSERT(dp->i_df.if_u1.if_data != NULL); | 795 | ASSERT(dp->i_df.if_u1.if_data != NULL); |
796 | 796 | ||
797 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 797 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
798 | 798 | ||
799 | ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->hdr.i8count)); | 799 | ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->i8count)); |
800 | 800 | ||
801 | /* | 801 | /* |
802 | * If the block number in the offset is out of range, we're done. | 802 | * If the block number in the offset is out of range, we're done. |
@@ -840,7 +840,7 @@ xfs_dir2_sf_getdents( | |||
840 | * Loop while there are more entries and put'ing works. | 840 | * Loop while there are more entries and put'ing works. |
841 | */ | 841 | */ |
842 | sfep = xfs_dir2_sf_firstentry(sfp); | 842 | sfep = xfs_dir2_sf_firstentry(sfp); |
843 | for (i = 0; i < sfp->hdr.count; i++) { | 843 | for (i = 0; i < sfp->count; i++) { |
844 | off = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk, | 844 | off = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk, |
845 | xfs_dir2_sf_get_offset(sfep)); | 845 | xfs_dir2_sf_get_offset(sfep)); |
846 | 846 | ||
@@ -875,7 +875,7 @@ xfs_dir2_sf_lookup( | |||
875 | int i; /* entry index */ | 875 | int i; /* entry index */ |
876 | int error; | 876 | int error; |
877 | xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ | 877 | xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ |
878 | xfs_dir2_sf_t *sfp; /* shortform structure */ | 878 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ |
879 | enum xfs_dacmp cmp; /* comparison result */ | 879 | enum xfs_dacmp cmp; /* comparison result */ |
880 | xfs_dir2_sf_entry_t *ci_sfep; /* case-insens. entry */ | 880 | xfs_dir2_sf_entry_t *ci_sfep; /* case-insens. entry */ |
881 | 881 | ||
@@ -894,8 +894,8 @@ xfs_dir2_sf_lookup( | |||
894 | } | 894 | } |
895 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); | 895 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); |
896 | ASSERT(dp->i_df.if_u1.if_data != NULL); | 896 | ASSERT(dp->i_df.if_u1.if_data != NULL); |
897 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 897 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
898 | ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->hdr.i8count)); | 898 | ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->i8count)); |
899 | /* | 899 | /* |
900 | * Special case for . | 900 | * Special case for . |
901 | */ | 901 | */ |
@@ -917,7 +917,7 @@ xfs_dir2_sf_lookup( | |||
917 | * Loop over all the entries trying to match ours. | 917 | * Loop over all the entries trying to match ours. |
918 | */ | 918 | */ |
919 | ci_sfep = NULL; | 919 | ci_sfep = NULL; |
920 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); i < sfp->hdr.count; | 920 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); i < sfp->count; |
921 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) { | 921 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) { |
922 | /* | 922 | /* |
923 | * Compare name and if it's an exact match, return the inode | 923 | * Compare name and if it's an exact match, return the inode |
@@ -960,7 +960,7 @@ xfs_dir2_sf_removename( | |||
960 | int newsize; /* new inode size */ | 960 | int newsize; /* new inode size */ |
961 | int oldsize; /* old inode size */ | 961 | int oldsize; /* old inode size */ |
962 | xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ | 962 | xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ |
963 | xfs_dir2_sf_t *sfp; /* shortform structure */ | 963 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ |
964 | 964 | ||
965 | trace_xfs_dir2_sf_removename(args); | 965 | trace_xfs_dir2_sf_removename(args); |
966 | 966 | ||
@@ -977,13 +977,13 @@ xfs_dir2_sf_removename( | |||
977 | } | 977 | } |
978 | ASSERT(dp->i_df.if_bytes == oldsize); | 978 | ASSERT(dp->i_df.if_bytes == oldsize); |
979 | ASSERT(dp->i_df.if_u1.if_data != NULL); | 979 | ASSERT(dp->i_df.if_u1.if_data != NULL); |
980 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 980 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
981 | ASSERT(oldsize >= xfs_dir2_sf_hdr_size(sfp->hdr.i8count)); | 981 | ASSERT(oldsize >= xfs_dir2_sf_hdr_size(sfp->i8count)); |
982 | /* | 982 | /* |
983 | * Loop over the old directory entries. | 983 | * Loop over the old directory entries. |
984 | * Find the one we're deleting. | 984 | * Find the one we're deleting. |
985 | */ | 985 | */ |
986 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); i < sfp->hdr.count; | 986 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); i < sfp->count; |
987 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) { | 987 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) { |
988 | if (xfs_da_compname(args, sfep->name, sfep->namelen) == | 988 | if (xfs_da_compname(args, sfep->name, sfep->namelen) == |
989 | XFS_CMP_EXACT) { | 989 | XFS_CMP_EXACT) { |
@@ -995,7 +995,7 @@ xfs_dir2_sf_removename( | |||
995 | /* | 995 | /* |
996 | * Didn't find it. | 996 | * Didn't find it. |
997 | */ | 997 | */ |
998 | if (i == sfp->hdr.count) | 998 | if (i == sfp->count) |
999 | return XFS_ERROR(ENOENT); | 999 | return XFS_ERROR(ENOENT); |
1000 | /* | 1000 | /* |
1001 | * Calculate sizes. | 1001 | * Calculate sizes. |
@@ -1012,22 +1012,22 @@ xfs_dir2_sf_removename( | |||
1012 | /* | 1012 | /* |
1013 | * Fix up the header and file size. | 1013 | * Fix up the header and file size. |
1014 | */ | 1014 | */ |
1015 | sfp->hdr.count--; | 1015 | sfp->count--; |
1016 | dp->i_d.di_size = newsize; | 1016 | dp->i_d.di_size = newsize; |
1017 | /* | 1017 | /* |
1018 | * Reallocate, making it smaller. | 1018 | * Reallocate, making it smaller. |
1019 | */ | 1019 | */ |
1020 | xfs_idata_realloc(dp, newsize - oldsize, XFS_DATA_FORK); | 1020 | xfs_idata_realloc(dp, newsize - oldsize, XFS_DATA_FORK); |
1021 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 1021 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
1022 | #if XFS_BIG_INUMS | 1022 | #if XFS_BIG_INUMS |
1023 | /* | 1023 | /* |
1024 | * Are we changing inode number size? | 1024 | * Are we changing inode number size? |
1025 | */ | 1025 | */ |
1026 | if (args->inumber > XFS_DIR2_MAX_SHORT_INUM) { | 1026 | if (args->inumber > XFS_DIR2_MAX_SHORT_INUM) { |
1027 | if (sfp->hdr.i8count == 1) | 1027 | if (sfp->i8count == 1) |
1028 | xfs_dir2_sf_toino4(args); | 1028 | xfs_dir2_sf_toino4(args); |
1029 | else | 1029 | else |
1030 | sfp->hdr.i8count--; | 1030 | sfp->i8count--; |
1031 | } | 1031 | } |
1032 | #endif | 1032 | #endif |
1033 | xfs_dir2_sf_check(args); | 1033 | xfs_dir2_sf_check(args); |
@@ -1051,7 +1051,7 @@ xfs_dir2_sf_replace( | |||
1051 | int i8elevated; /* sf_toino8 set i8count=1 */ | 1051 | int i8elevated; /* sf_toino8 set i8count=1 */ |
1052 | #endif | 1052 | #endif |
1053 | xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ | 1053 | xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ |
1054 | xfs_dir2_sf_t *sfp; /* shortform structure */ | 1054 | xfs_dir2_sf_hdr_t *sfp; /* shortform structure */ |
1055 | 1055 | ||
1056 | trace_xfs_dir2_sf_replace(args); | 1056 | trace_xfs_dir2_sf_replace(args); |
1057 | 1057 | ||
@@ -1067,19 +1067,19 @@ xfs_dir2_sf_replace( | |||
1067 | } | 1067 | } |
1068 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); | 1068 | ASSERT(dp->i_df.if_bytes == dp->i_d.di_size); |
1069 | ASSERT(dp->i_df.if_u1.if_data != NULL); | 1069 | ASSERT(dp->i_df.if_u1.if_data != NULL); |
1070 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 1070 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
1071 | ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->hdr.i8count)); | 1071 | ASSERT(dp->i_d.di_size >= xfs_dir2_sf_hdr_size(sfp->i8count)); |
1072 | #if XFS_BIG_INUMS | 1072 | #if XFS_BIG_INUMS |
1073 | /* | 1073 | /* |
1074 | * New inode number is large, and need to convert to 8-byte inodes. | 1074 | * New inode number is large, and need to convert to 8-byte inodes. |
1075 | */ | 1075 | */ |
1076 | if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && sfp->hdr.i8count == 0) { | 1076 | if (args->inumber > XFS_DIR2_MAX_SHORT_INUM && sfp->i8count == 0) { |
1077 | int error; /* error return value */ | 1077 | int error; /* error return value */ |
1078 | int newsize; /* new inode size */ | 1078 | int newsize; /* new inode size */ |
1079 | 1079 | ||
1080 | newsize = | 1080 | newsize = |
1081 | dp->i_df.if_bytes + | 1081 | dp->i_df.if_bytes + |
1082 | (sfp->hdr.count + 1) * | 1082 | (sfp->count + 1) * |
1083 | ((uint)sizeof(xfs_dir2_ino8_t) - | 1083 | ((uint)sizeof(xfs_dir2_ino8_t) - |
1084 | (uint)sizeof(xfs_dir2_ino4_t)); | 1084 | (uint)sizeof(xfs_dir2_ino4_t)); |
1085 | /* | 1085 | /* |
@@ -1097,7 +1097,7 @@ xfs_dir2_sf_replace( | |||
1097 | */ | 1097 | */ |
1098 | xfs_dir2_sf_toino8(args); | 1098 | xfs_dir2_sf_toino8(args); |
1099 | i8elevated = 1; | 1099 | i8elevated = 1; |
1100 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 1100 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
1101 | } else | 1101 | } else |
1102 | i8elevated = 0; | 1102 | i8elevated = 0; |
1103 | #endif | 1103 | #endif |
@@ -1118,7 +1118,7 @@ xfs_dir2_sf_replace( | |||
1118 | */ | 1118 | */ |
1119 | else { | 1119 | else { |
1120 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); | 1120 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); |
1121 | i < sfp->hdr.count; | 1121 | i < sfp->count; |
1122 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) { | 1122 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) { |
1123 | if (xfs_da_compname(args, sfep->name, sfep->namelen) == | 1123 | if (xfs_da_compname(args, sfep->name, sfep->namelen) == |
1124 | XFS_CMP_EXACT) { | 1124 | XFS_CMP_EXACT) { |
@@ -1133,7 +1133,7 @@ xfs_dir2_sf_replace( | |||
1133 | /* | 1133 | /* |
1134 | * Didn't find it. | 1134 | * Didn't find it. |
1135 | */ | 1135 | */ |
1136 | if (i == sfp->hdr.count) { | 1136 | if (i == sfp->count) { |
1137 | ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); | 1137 | ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); |
1138 | #if XFS_BIG_INUMS | 1138 | #if XFS_BIG_INUMS |
1139 | if (i8elevated) | 1139 | if (i8elevated) |
@@ -1151,10 +1151,10 @@ xfs_dir2_sf_replace( | |||
1151 | /* | 1151 | /* |
1152 | * And the old count was one, so need to convert to small. | 1152 | * And the old count was one, so need to convert to small. |
1153 | */ | 1153 | */ |
1154 | if (sfp->hdr.i8count == 1) | 1154 | if (sfp->i8count == 1) |
1155 | xfs_dir2_sf_toino4(args); | 1155 | xfs_dir2_sf_toino4(args); |
1156 | else | 1156 | else |
1157 | sfp->hdr.i8count--; | 1157 | sfp->i8count--; |
1158 | } | 1158 | } |
1159 | /* | 1159 | /* |
1160 | * See if the old number was small, the new number is large. | 1160 | * See if the old number was small, the new number is large. |
@@ -1165,9 +1165,9 @@ xfs_dir2_sf_replace( | |||
1165 | * add to the i8count unless we just converted to 8-byte | 1165 | * add to the i8count unless we just converted to 8-byte |
1166 | * inodes (which does an implied i8count = 1) | 1166 | * inodes (which does an implied i8count = 1) |
1167 | */ | 1167 | */ |
1168 | ASSERT(sfp->hdr.i8count != 0); | 1168 | ASSERT(sfp->i8count != 0); |
1169 | if (!i8elevated) | 1169 | if (!i8elevated) |
1170 | sfp->hdr.i8count++; | 1170 | sfp->i8count++; |
1171 | } | 1171 | } |
1172 | #endif | 1172 | #endif |
1173 | xfs_dir2_sf_check(args); | 1173 | xfs_dir2_sf_check(args); |
@@ -1189,10 +1189,10 @@ xfs_dir2_sf_toino4( | |||
1189 | int i; /* entry index */ | 1189 | int i; /* entry index */ |
1190 | int newsize; /* new inode size */ | 1190 | int newsize; /* new inode size */ |
1191 | xfs_dir2_sf_entry_t *oldsfep; /* old sf entry */ | 1191 | xfs_dir2_sf_entry_t *oldsfep; /* old sf entry */ |
1192 | xfs_dir2_sf_t *oldsfp; /* old sf directory */ | 1192 | xfs_dir2_sf_hdr_t *oldsfp; /* old sf directory */ |
1193 | int oldsize; /* old inode size */ | 1193 | int oldsize; /* old inode size */ |
1194 | xfs_dir2_sf_entry_t *sfep; /* new sf entry */ | 1194 | xfs_dir2_sf_entry_t *sfep; /* new sf entry */ |
1195 | xfs_dir2_sf_t *sfp; /* new sf directory */ | 1195 | xfs_dir2_sf_hdr_t *sfp; /* new sf directory */ |
1196 | 1196 | ||
1197 | trace_xfs_dir2_sf_toino4(args); | 1197 | trace_xfs_dir2_sf_toino4(args); |
1198 | 1198 | ||
@@ -1205,35 +1205,35 @@ xfs_dir2_sf_toino4( | |||
1205 | */ | 1205 | */ |
1206 | oldsize = dp->i_df.if_bytes; | 1206 | oldsize = dp->i_df.if_bytes; |
1207 | buf = kmem_alloc(oldsize, KM_SLEEP); | 1207 | buf = kmem_alloc(oldsize, KM_SLEEP); |
1208 | oldsfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 1208 | oldsfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
1209 | ASSERT(oldsfp->hdr.i8count == 1); | 1209 | ASSERT(oldsfp->i8count == 1); |
1210 | memcpy(buf, oldsfp, oldsize); | 1210 | memcpy(buf, oldsfp, oldsize); |
1211 | /* | 1211 | /* |
1212 | * Compute the new inode size. | 1212 | * Compute the new inode size. |
1213 | */ | 1213 | */ |
1214 | newsize = | 1214 | newsize = |
1215 | oldsize - | 1215 | oldsize - |
1216 | (oldsfp->hdr.count + 1) * | 1216 | (oldsfp->count + 1) * |
1217 | ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t)); | 1217 | ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t)); |
1218 | xfs_idata_realloc(dp, -oldsize, XFS_DATA_FORK); | 1218 | xfs_idata_realloc(dp, -oldsize, XFS_DATA_FORK); |
1219 | xfs_idata_realloc(dp, newsize, XFS_DATA_FORK); | 1219 | xfs_idata_realloc(dp, newsize, XFS_DATA_FORK); |
1220 | /* | 1220 | /* |
1221 | * Reset our pointers, the data has moved. | 1221 | * Reset our pointers, the data has moved. |
1222 | */ | 1222 | */ |
1223 | oldsfp = (xfs_dir2_sf_t *)buf; | 1223 | oldsfp = (xfs_dir2_sf_hdr_t *)buf; |
1224 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 1224 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
1225 | /* | 1225 | /* |
1226 | * Fill in the new header. | 1226 | * Fill in the new header. |
1227 | */ | 1227 | */ |
1228 | sfp->hdr.count = oldsfp->hdr.count; | 1228 | sfp->count = oldsfp->count; |
1229 | sfp->hdr.i8count = 0; | 1229 | sfp->i8count = 0; |
1230 | xfs_dir2_sf_put_parent_ino(sfp, xfs_dir2_sf_get_parent_ino(oldsfp)); | 1230 | xfs_dir2_sf_put_parent_ino(sfp, xfs_dir2_sf_get_parent_ino(oldsfp)); |
1231 | /* | 1231 | /* |
1232 | * Copy the entries field by field. | 1232 | * Copy the entries field by field. |
1233 | */ | 1233 | */ |
1234 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp), | 1234 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp), |
1235 | oldsfep = xfs_dir2_sf_firstentry(oldsfp); | 1235 | oldsfep = xfs_dir2_sf_firstentry(oldsfp); |
1236 | i < sfp->hdr.count; | 1236 | i < sfp->count; |
1237 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep), | 1237 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep), |
1238 | oldsfep = xfs_dir2_sf_nextentry(oldsfp, oldsfep)) { | 1238 | oldsfep = xfs_dir2_sf_nextentry(oldsfp, oldsfep)) { |
1239 | sfep->namelen = oldsfep->namelen; | 1239 | sfep->namelen = oldsfep->namelen; |
@@ -1264,10 +1264,10 @@ xfs_dir2_sf_toino8( | |||
1264 | int i; /* entry index */ | 1264 | int i; /* entry index */ |
1265 | int newsize; /* new inode size */ | 1265 | int newsize; /* new inode size */ |
1266 | xfs_dir2_sf_entry_t *oldsfep; /* old sf entry */ | 1266 | xfs_dir2_sf_entry_t *oldsfep; /* old sf entry */ |
1267 | xfs_dir2_sf_t *oldsfp; /* old sf directory */ | 1267 | xfs_dir2_sf_hdr_t *oldsfp; /* old sf directory */ |
1268 | int oldsize; /* old inode size */ | 1268 | int oldsize; /* old inode size */ |
1269 | xfs_dir2_sf_entry_t *sfep; /* new sf entry */ | 1269 | xfs_dir2_sf_entry_t *sfep; /* new sf entry */ |
1270 | xfs_dir2_sf_t *sfp; /* new sf directory */ | 1270 | xfs_dir2_sf_hdr_t *sfp; /* new sf directory */ |
1271 | 1271 | ||
1272 | trace_xfs_dir2_sf_toino8(args); | 1272 | trace_xfs_dir2_sf_toino8(args); |
1273 | 1273 | ||
@@ -1280,35 +1280,35 @@ xfs_dir2_sf_toino8( | |||
1280 | */ | 1280 | */ |
1281 | oldsize = dp->i_df.if_bytes; | 1281 | oldsize = dp->i_df.if_bytes; |
1282 | buf = kmem_alloc(oldsize, KM_SLEEP); | 1282 | buf = kmem_alloc(oldsize, KM_SLEEP); |
1283 | oldsfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 1283 | oldsfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
1284 | ASSERT(oldsfp->hdr.i8count == 0); | 1284 | ASSERT(oldsfp->i8count == 0); |
1285 | memcpy(buf, oldsfp, oldsize); | 1285 | memcpy(buf, oldsfp, oldsize); |
1286 | /* | 1286 | /* |
1287 | * Compute the new inode size. | 1287 | * Compute the new inode size. |
1288 | */ | 1288 | */ |
1289 | newsize = | 1289 | newsize = |
1290 | oldsize + | 1290 | oldsize + |
1291 | (oldsfp->hdr.count + 1) * | 1291 | (oldsfp->count + 1) * |
1292 | ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t)); | 1292 | ((uint)sizeof(xfs_dir2_ino8_t) - (uint)sizeof(xfs_dir2_ino4_t)); |
1293 | xfs_idata_realloc(dp, -oldsize, XFS_DATA_FORK); | 1293 | xfs_idata_realloc(dp, -oldsize, XFS_DATA_FORK); |
1294 | xfs_idata_realloc(dp, newsize, XFS_DATA_FORK); | 1294 | xfs_idata_realloc(dp, newsize, XFS_DATA_FORK); |
1295 | /* | 1295 | /* |
1296 | * Reset our pointers, the data has moved. | 1296 | * Reset our pointers, the data has moved. |
1297 | */ | 1297 | */ |
1298 | oldsfp = (xfs_dir2_sf_t *)buf; | 1298 | oldsfp = (xfs_dir2_sf_hdr_t *)buf; |
1299 | sfp = (xfs_dir2_sf_t *)dp->i_df.if_u1.if_data; | 1299 | sfp = (xfs_dir2_sf_hdr_t *)dp->i_df.if_u1.if_data; |
1300 | /* | 1300 | /* |
1301 | * Fill in the new header. | 1301 | * Fill in the new header. |
1302 | */ | 1302 | */ |
1303 | sfp->hdr.count = oldsfp->hdr.count; | 1303 | sfp->count = oldsfp->count; |
1304 | sfp->hdr.i8count = 1; | 1304 | sfp->i8count = 1; |
1305 | xfs_dir2_sf_put_parent_ino(sfp, xfs_dir2_sf_get_parent_ino(oldsfp)); | 1305 | xfs_dir2_sf_put_parent_ino(sfp, xfs_dir2_sf_get_parent_ino(oldsfp)); |
1306 | /* | 1306 | /* |
1307 | * Copy the entries field by field. | 1307 | * Copy the entries field by field. |
1308 | */ | 1308 | */ |
1309 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp), | 1309 | for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp), |
1310 | oldsfep = xfs_dir2_sf_firstentry(oldsfp); | 1310 | oldsfep = xfs_dir2_sf_firstentry(oldsfp); |
1311 | i < sfp->hdr.count; | 1311 | i < sfp->count; |
1312 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep), | 1312 | i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep), |
1313 | oldsfep = xfs_dir2_sf_nextentry(oldsfp, oldsfep)) { | 1313 | oldsfep = xfs_dir2_sf_nextentry(oldsfp, oldsfep)) { |
1314 | sfep->namelen = oldsfep->namelen; | 1314 | sfep->namelen = oldsfep->namelen; |