diff options
Diffstat (limited to 'fs/xfs/xfs_dir_leaf.c')
-rw-r--r-- | fs/xfs/xfs_dir_leaf.c | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/fs/xfs/xfs_dir_leaf.c b/fs/xfs/xfs_dir_leaf.c index 950df31efc46..e83074016abb 100644 --- a/fs/xfs/xfs_dir_leaf.c +++ b/fs/xfs/xfs_dir_leaf.c | |||
@@ -147,7 +147,7 @@ xfs_dir_shortform_create(xfs_da_args_t *args, xfs_ino_t parent) | |||
147 | hdr->count = 0; | 147 | hdr->count = 0; |
148 | dp->i_d.di_size = sizeof(*hdr); | 148 | dp->i_d.di_size = sizeof(*hdr); |
149 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); | 149 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); |
150 | return(0); | 150 | return 0; |
151 | } | 151 | } |
152 | 152 | ||
153 | /* | 153 | /* |
@@ -180,7 +180,7 @@ xfs_dir_shortform_addname(xfs_da_args_t *args) | |||
180 | if (sfe->namelen == args->namelen && | 180 | if (sfe->namelen == args->namelen && |
181 | args->name[0] == sfe->name[0] && | 181 | args->name[0] == sfe->name[0] && |
182 | memcmp(args->name, sfe->name, args->namelen) == 0) | 182 | memcmp(args->name, sfe->name, args->namelen) == 0) |
183 | return(XFS_ERROR(EEXIST)); | 183 | return XFS_ERROR(EEXIST); |
184 | sfe = XFS_DIR_SF_NEXTENTRY(sfe); | 184 | sfe = XFS_DIR_SF_NEXTENTRY(sfe); |
185 | } | 185 | } |
186 | 186 | ||
@@ -198,7 +198,7 @@ xfs_dir_shortform_addname(xfs_da_args_t *args) | |||
198 | dp->i_d.di_size += size; | 198 | dp->i_d.di_size += size; |
199 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); | 199 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); |
200 | 200 | ||
201 | return(0); | 201 | return 0; |
202 | } | 202 | } |
203 | 203 | ||
204 | /* | 204 | /* |
@@ -238,7 +238,7 @@ xfs_dir_shortform_removename(xfs_da_args_t *args) | |||
238 | } | 238 | } |
239 | if (i < 0) { | 239 | if (i < 0) { |
240 | ASSERT(args->oknoent); | 240 | ASSERT(args->oknoent); |
241 | return(XFS_ERROR(ENOENT)); | 241 | return XFS_ERROR(ENOENT); |
242 | } | 242 | } |
243 | 243 | ||
244 | if ((base + size) != dp->i_d.di_size) { | 244 | if ((base + size) != dp->i_d.di_size) { |
@@ -251,7 +251,7 @@ xfs_dir_shortform_removename(xfs_da_args_t *args) | |||
251 | dp->i_d.di_size -= size; | 251 | dp->i_d.di_size -= size; |
252 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); | 252 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_DDATA); |
253 | 253 | ||
254 | return(0); | 254 | return 0; |
255 | } | 255 | } |
256 | 256 | ||
257 | /* | 257 | /* |
@@ -390,7 +390,7 @@ xfs_dir_shortform_to_leaf(xfs_da_args_t *iargs) | |||
390 | 390 | ||
391 | out: | 391 | out: |
392 | kmem_free(tmpbuffer, size); | 392 | kmem_free(tmpbuffer, size); |
393 | return(retval); | 393 | return retval; |
394 | } | 394 | } |
395 | 395 | ||
396 | STATIC int | 396 | STATIC int |
@@ -596,7 +596,7 @@ xfs_dir_shortform_replace(xfs_da_args_t *args) | |||
596 | /* XXX - replace assert? */ | 596 | /* XXX - replace assert? */ |
597 | XFS_DIR_SF_PUT_DIRINO(&args->inumber, &sf->hdr.parent); | 597 | XFS_DIR_SF_PUT_DIRINO(&args->inumber, &sf->hdr.parent); |
598 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA); | 598 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA); |
599 | return(0); | 599 | return 0; |
600 | } | 600 | } |
601 | ASSERT(args->namelen != 1 || args->name[0] != '.'); | 601 | ASSERT(args->namelen != 1 || args->name[0] != '.'); |
602 | sfe = &sf->list[0]; | 602 | sfe = &sf->list[0]; |
@@ -608,12 +608,12 @@ xfs_dir_shortform_replace(xfs_da_args_t *args) | |||
608 | (char *)&sfe->inumber, sizeof(xfs_ino_t))); | 608 | (char *)&sfe->inumber, sizeof(xfs_ino_t))); |
609 | XFS_DIR_SF_PUT_DIRINO(&args->inumber, &sfe->inumber); | 609 | XFS_DIR_SF_PUT_DIRINO(&args->inumber, &sfe->inumber); |
610 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA); | 610 | xfs_trans_log_inode(args->trans, dp, XFS_ILOG_DDATA); |
611 | return(0); | 611 | return 0; |
612 | } | 612 | } |
613 | sfe = XFS_DIR_SF_NEXTENTRY(sfe); | 613 | sfe = XFS_DIR_SF_NEXTENTRY(sfe); |
614 | } | 614 | } |
615 | ASSERT(args->oknoent); | 615 | ASSERT(args->oknoent); |
616 | return(XFS_ERROR(ENOENT)); | 616 | return XFS_ERROR(ENOENT); |
617 | } | 617 | } |
618 | 618 | ||
619 | /* | 619 | /* |
@@ -695,7 +695,7 @@ xfs_dir_leaf_to_shortform(xfs_da_args_t *iargs) | |||
695 | 695 | ||
696 | out: | 696 | out: |
697 | kmem_free(tmpbuffer, XFS_LBSIZE(dp->i_mount)); | 697 | kmem_free(tmpbuffer, XFS_LBSIZE(dp->i_mount)); |
698 | return(retval); | 698 | return retval; |
699 | } | 699 | } |
700 | 700 | ||
701 | /* | 701 | /* |
@@ -715,17 +715,17 @@ xfs_dir_leaf_to_node(xfs_da_args_t *args) | |||
715 | retval = xfs_da_grow_inode(args, &blkno); | 715 | retval = xfs_da_grow_inode(args, &blkno); |
716 | ASSERT(blkno == 1); | 716 | ASSERT(blkno == 1); |
717 | if (retval) | 717 | if (retval) |
718 | return(retval); | 718 | return retval; |
719 | retval = xfs_da_read_buf(args->trans, args->dp, 0, -1, &bp1, | 719 | retval = xfs_da_read_buf(args->trans, args->dp, 0, -1, &bp1, |
720 | XFS_DATA_FORK); | 720 | XFS_DATA_FORK); |
721 | if (retval) | 721 | if (retval) |
722 | return(retval); | 722 | return retval; |
723 | ASSERT(bp1 != NULL); | 723 | ASSERT(bp1 != NULL); |
724 | retval = xfs_da_get_buf(args->trans, args->dp, 1, -1, &bp2, | 724 | retval = xfs_da_get_buf(args->trans, args->dp, 1, -1, &bp2, |
725 | XFS_DATA_FORK); | 725 | XFS_DATA_FORK); |
726 | if (retval) { | 726 | if (retval) { |
727 | xfs_da_buf_done(bp1); | 727 | xfs_da_buf_done(bp1); |
728 | return(retval); | 728 | return retval; |
729 | } | 729 | } |
730 | ASSERT(bp2 != NULL); | 730 | ASSERT(bp2 != NULL); |
731 | memcpy(bp2->data, bp1->data, XFS_LBSIZE(dp->i_mount)); | 731 | memcpy(bp2->data, bp1->data, XFS_LBSIZE(dp->i_mount)); |
@@ -738,7 +738,7 @@ xfs_dir_leaf_to_node(xfs_da_args_t *args) | |||
738 | retval = xfs_da_node_create(args, 0, 1, &bp1, XFS_DATA_FORK); | 738 | retval = xfs_da_node_create(args, 0, 1, &bp1, XFS_DATA_FORK); |
739 | if (retval) { | 739 | if (retval) { |
740 | xfs_da_buf_done(bp2); | 740 | xfs_da_buf_done(bp2); |
741 | return(retval); | 741 | return retval; |
742 | } | 742 | } |
743 | node = bp1->data; | 743 | node = bp1->data; |
744 | leaf = bp2->data; | 744 | leaf = bp2->data; |
@@ -751,7 +751,7 @@ xfs_dir_leaf_to_node(xfs_da_args_t *args) | |||
751 | XFS_DA_LOGRANGE(node, &node->btree[0], sizeof(node->btree[0]))); | 751 | XFS_DA_LOGRANGE(node, &node->btree[0], sizeof(node->btree[0]))); |
752 | xfs_da_buf_done(bp1); | 752 | xfs_da_buf_done(bp1); |
753 | 753 | ||
754 | return(retval); | 754 | return retval; |
755 | } | 755 | } |
756 | 756 | ||
757 | 757 | ||
@@ -776,7 +776,7 @@ xfs_dir_leaf_create(xfs_da_args_t *args, xfs_dablk_t blkno, xfs_dabuf_t **bpp) | |||
776 | ASSERT(dp != NULL); | 776 | ASSERT(dp != NULL); |
777 | retval = xfs_da_get_buf(args->trans, dp, blkno, -1, &bp, XFS_DATA_FORK); | 777 | retval = xfs_da_get_buf(args->trans, dp, blkno, -1, &bp, XFS_DATA_FORK); |
778 | if (retval) | 778 | if (retval) |
779 | return(retval); | 779 | return retval; |
780 | ASSERT(bp != NULL); | 780 | ASSERT(bp != NULL); |
781 | leaf = bp->data; | 781 | leaf = bp->data; |
782 | memset((char *)leaf, 0, XFS_LBSIZE(dp->i_mount)); | 782 | memset((char *)leaf, 0, XFS_LBSIZE(dp->i_mount)); |
@@ -791,7 +791,7 @@ xfs_dir_leaf_create(xfs_da_args_t *args, xfs_dablk_t blkno, xfs_dabuf_t **bpp) | |||
791 | xfs_da_log_buf(args->trans, bp, 0, XFS_LBSIZE(dp->i_mount) - 1); | 791 | xfs_da_log_buf(args->trans, bp, 0, XFS_LBSIZE(dp->i_mount) - 1); |
792 | 792 | ||
793 | *bpp = bp; | 793 | *bpp = bp; |
794 | return(0); | 794 | return 0; |
795 | } | 795 | } |
796 | 796 | ||
797 | /* | 797 | /* |
@@ -813,10 +813,10 @@ xfs_dir_leaf_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk, | |||
813 | ASSERT(oldblk->magic == XFS_DIR_LEAF_MAGIC); | 813 | ASSERT(oldblk->magic == XFS_DIR_LEAF_MAGIC); |
814 | error = xfs_da_grow_inode(args, &blkno); | 814 | error = xfs_da_grow_inode(args, &blkno); |
815 | if (error) | 815 | if (error) |
816 | return(error); | 816 | return error; |
817 | error = xfs_dir_leaf_create(args, blkno, &newblk->bp); | 817 | error = xfs_dir_leaf_create(args, blkno, &newblk->bp); |
818 | if (error) | 818 | if (error) |
819 | return(error); | 819 | return error; |
820 | newblk->blkno = blkno; | 820 | newblk->blkno = blkno; |
821 | newblk->magic = XFS_DIR_LEAF_MAGIC; | 821 | newblk->magic = XFS_DIR_LEAF_MAGIC; |
822 | 822 | ||
@@ -826,7 +826,7 @@ xfs_dir_leaf_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk, | |||
826 | xfs_dir_leaf_rebalance(state, oldblk, newblk); | 826 | xfs_dir_leaf_rebalance(state, oldblk, newblk); |
827 | error = xfs_da_blk_link(state, oldblk, newblk); | 827 | error = xfs_da_blk_link(state, oldblk, newblk); |
828 | if (error) | 828 | if (error) |
829 | return(error); | 829 | return error; |
830 | 830 | ||
831 | /* | 831 | /* |
832 | * Insert the new entry in the correct block. | 832 | * Insert the new entry in the correct block. |
@@ -842,7 +842,7 @@ xfs_dir_leaf_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk, | |||
842 | */ | 842 | */ |
843 | oldblk->hashval = xfs_dir_leaf_lasthash(oldblk->bp, NULL); | 843 | oldblk->hashval = xfs_dir_leaf_lasthash(oldblk->bp, NULL); |
844 | newblk->hashval = xfs_dir_leaf_lasthash(newblk->bp, NULL); | 844 | newblk->hashval = xfs_dir_leaf_lasthash(newblk->bp, NULL); |
845 | return(error); | 845 | return error; |
846 | } | 846 | } |
847 | 847 | ||
848 | /* | 848 | /* |
@@ -885,7 +885,7 @@ xfs_dir_leaf_add(xfs_dabuf_t *bp, xfs_da_args_t *args, int index) | |||
885 | if (INT_GET(map->size, ARCH_CONVERT) >= tmp) { | 885 | if (INT_GET(map->size, ARCH_CONVERT) >= tmp) { |
886 | if (!args->justcheck) | 886 | if (!args->justcheck) |
887 | xfs_dir_leaf_add_work(bp, args, index, i); | 887 | xfs_dir_leaf_add_work(bp, args, index, i); |
888 | return(0); | 888 | return 0; |
889 | } | 889 | } |
890 | sum += INT_GET(map->size, ARCH_CONVERT); | 890 | sum += INT_GET(map->size, ARCH_CONVERT); |
891 | } | 891 | } |
@@ -896,7 +896,7 @@ xfs_dir_leaf_add(xfs_dabuf_t *bp, xfs_da_args_t *args, int index) | |||
896 | * no good and we should just give up. | 896 | * no good and we should just give up. |
897 | */ | 897 | */ |
898 | if (!hdr->holes && (sum < entsize)) | 898 | if (!hdr->holes && (sum < entsize)) |
899 | return(XFS_ERROR(ENOSPC)); | 899 | return XFS_ERROR(ENOSPC); |
900 | 900 | ||
901 | /* | 901 | /* |
902 | * Compact the entries to coalesce free space. | 902 | * Compact the entries to coalesce free space. |
@@ -909,18 +909,18 @@ xfs_dir_leaf_add(xfs_dabuf_t *bp, xfs_da_args_t *args, int index) | |||
909 | (uint)sizeof(xfs_dir_leaf_entry_t) : 0, | 909 | (uint)sizeof(xfs_dir_leaf_entry_t) : 0, |
910 | args->justcheck); | 910 | args->justcheck); |
911 | if (error) | 911 | if (error) |
912 | return(error); | 912 | return error; |
913 | /* | 913 | /* |
914 | * After compaction, the block is guaranteed to have only one | 914 | * After compaction, the block is guaranteed to have only one |
915 | * free region, in freemap[0]. If it is not big enough, give up. | 915 | * free region, in freemap[0]. If it is not big enough, give up. |
916 | */ | 916 | */ |
917 | if (INT_GET(hdr->freemap[0].size, ARCH_CONVERT) < | 917 | if (INT_GET(hdr->freemap[0].size, ARCH_CONVERT) < |
918 | (entsize + (uint)sizeof(xfs_dir_leaf_entry_t))) | 918 | (entsize + (uint)sizeof(xfs_dir_leaf_entry_t))) |
919 | return(XFS_ERROR(ENOSPC)); | 919 | return XFS_ERROR(ENOSPC); |
920 | 920 | ||
921 | if (!args->justcheck) | 921 | if (!args->justcheck) |
922 | xfs_dir_leaf_add_work(bp, args, index, 0); | 922 | xfs_dir_leaf_add_work(bp, args, index, 0); |
923 | return(0); | 923 | return 0; |
924 | } | 924 | } |
925 | 925 | ||
926 | /* | 926 | /* |
@@ -1072,7 +1072,7 @@ xfs_dir_leaf_compact(xfs_trans_t *trans, xfs_dabuf_t *bp, int musthave, | |||
1072 | kmem_free(tmpbuffer, lbsize); | 1072 | kmem_free(tmpbuffer, lbsize); |
1073 | if (musthave || justcheck) | 1073 | if (musthave || justcheck) |
1074 | kmem_free(tmpbuffer2, lbsize); | 1074 | kmem_free(tmpbuffer2, lbsize); |
1075 | return(rval); | 1075 | return rval; |
1076 | } | 1076 | } |
1077 | 1077 | ||
1078 | /* | 1078 | /* |
@@ -1292,7 +1292,7 @@ xfs_dir_leaf_figure_balance(xfs_da_state_t *state, | |||
1292 | 1292 | ||
1293 | *countarg = count; | 1293 | *countarg = count; |
1294 | *namebytesarg = totallen; | 1294 | *namebytesarg = totallen; |
1295 | return(foundit); | 1295 | return foundit; |
1296 | } | 1296 | } |
1297 | 1297 | ||
1298 | /*======================================================================== | 1298 | /*======================================================================== |
@@ -1334,7 +1334,7 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action) | |||
1334 | INT_GET(leaf->hdr.namebytes, ARCH_CONVERT); | 1334 | INT_GET(leaf->hdr.namebytes, ARCH_CONVERT); |
1335 | if (bytes > (state->blocksize >> 1)) { | 1335 | if (bytes > (state->blocksize >> 1)) { |
1336 | *action = 0; /* blk over 50%, don't try to join */ | 1336 | *action = 0; /* blk over 50%, don't try to join */ |
1337 | return(0); | 1337 | return 0; |
1338 | } | 1338 | } |
1339 | 1339 | ||
1340 | /* | 1340 | /* |
@@ -1353,13 +1353,13 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action) | |||
1353 | error = xfs_da_path_shift(state, &state->altpath, forward, | 1353 | error = xfs_da_path_shift(state, &state->altpath, forward, |
1354 | 0, &retval); | 1354 | 0, &retval); |
1355 | if (error) | 1355 | if (error) |
1356 | return(error); | 1356 | return error; |
1357 | if (retval) { | 1357 | if (retval) { |
1358 | *action = 0; | 1358 | *action = 0; |
1359 | } else { | 1359 | } else { |
1360 | *action = 2; | 1360 | *action = 2; |
1361 | } | 1361 | } |
1362 | return(0); | 1362 | return 0; |
1363 | } | 1363 | } |
1364 | 1364 | ||
1365 | /* | 1365 | /* |
@@ -1381,7 +1381,7 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action) | |||
1381 | blkno, -1, &bp, | 1381 | blkno, -1, &bp, |
1382 | XFS_DATA_FORK); | 1382 | XFS_DATA_FORK); |
1383 | if (error) | 1383 | if (error) |
1384 | return(error); | 1384 | return error; |
1385 | ASSERT(bp != NULL); | 1385 | ASSERT(bp != NULL); |
1386 | 1386 | ||
1387 | leaf = (xfs_dir_leafblock_t *)info; | 1387 | leaf = (xfs_dir_leafblock_t *)info; |
@@ -1402,7 +1402,7 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action) | |||
1402 | } | 1402 | } |
1403 | if (i >= 2) { | 1403 | if (i >= 2) { |
1404 | *action = 0; | 1404 | *action = 0; |
1405 | return(0); | 1405 | return 0; |
1406 | } | 1406 | } |
1407 | xfs_da_buf_done(bp); | 1407 | xfs_da_buf_done(bp); |
1408 | 1408 | ||
@@ -1419,13 +1419,13 @@ xfs_dir_leaf_toosmall(xfs_da_state_t *state, int *action) | |||
1419 | 0, &retval); | 1419 | 0, &retval); |
1420 | } | 1420 | } |
1421 | if (error) | 1421 | if (error) |
1422 | return(error); | 1422 | return error; |
1423 | if (retval) { | 1423 | if (retval) { |
1424 | *action = 0; | 1424 | *action = 0; |
1425 | } else { | 1425 | } else { |
1426 | *action = 1; | 1426 | *action = 1; |
1427 | } | 1427 | } |
1428 | return(0); | 1428 | return 0; |
1429 | } | 1429 | } |
1430 | 1430 | ||
1431 | /* | 1431 | /* |
@@ -1575,8 +1575,8 @@ xfs_dir_leaf_remove(xfs_trans_t *trans, xfs_dabuf_t *bp, int index) | |||
1575 | tmp += INT_GET(leaf->hdr.count, ARCH_CONVERT) * ((uint)sizeof(xfs_dir_leaf_name_t) - 1); | 1575 | tmp += INT_GET(leaf->hdr.count, ARCH_CONVERT) * ((uint)sizeof(xfs_dir_leaf_name_t) - 1); |
1576 | tmp += INT_GET(leaf->hdr.namebytes, ARCH_CONVERT); | 1576 | tmp += INT_GET(leaf->hdr.namebytes, ARCH_CONVERT); |
1577 | if (tmp < mp->m_dir_magicpct) | 1577 | if (tmp < mp->m_dir_magicpct) |
1578 | return(1); /* leaf is < 37% full */ | 1578 | return 1; /* leaf is < 37% full */ |
1579 | return(0); | 1579 | return 0; |
1580 | } | 1580 | } |
1581 | 1581 | ||
1582 | /* | 1582 | /* |
@@ -1732,7 +1732,7 @@ xfs_dir_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args, int *index) | |||
1732 | if ((probe == INT_GET(leaf->hdr.count, ARCH_CONVERT)) || (INT_GET(entry->hashval, ARCH_CONVERT) != hashval)) { | 1732 | if ((probe == INT_GET(leaf->hdr.count, ARCH_CONVERT)) || (INT_GET(entry->hashval, ARCH_CONVERT) != hashval)) { |
1733 | *index = probe; | 1733 | *index = probe; |
1734 | ASSERT(args->oknoent); | 1734 | ASSERT(args->oknoent); |
1735 | return(XFS_ERROR(ENOENT)); | 1735 | return XFS_ERROR(ENOENT); |
1736 | } | 1736 | } |
1737 | 1737 | ||
1738 | /* | 1738 | /* |
@@ -1745,14 +1745,14 @@ xfs_dir_leaf_lookup_int(xfs_dabuf_t *bp, xfs_da_args_t *args, int *index) | |||
1745 | memcmp(args->name, namest->name, args->namelen) == 0) { | 1745 | memcmp(args->name, namest->name, args->namelen) == 0) { |
1746 | XFS_DIR_SF_GET_DIRINO(&namest->inumber, &args->inumber); | 1746 | XFS_DIR_SF_GET_DIRINO(&namest->inumber, &args->inumber); |
1747 | *index = probe; | 1747 | *index = probe; |
1748 | return(XFS_ERROR(EEXIST)); | 1748 | return XFS_ERROR(EEXIST); |
1749 | } | 1749 | } |
1750 | entry++; | 1750 | entry++; |
1751 | probe++; | 1751 | probe++; |
1752 | } | 1752 | } |
1753 | *index = probe; | 1753 | *index = probe; |
1754 | ASSERT(probe == INT_GET(leaf->hdr.count, ARCH_CONVERT) || args->oknoent); | 1754 | ASSERT(probe == INT_GET(leaf->hdr.count, ARCH_CONVERT) || args->oknoent); |
1755 | return(XFS_ERROR(ENOENT)); | 1755 | return XFS_ERROR(ENOENT); |
1756 | } | 1756 | } |
1757 | 1757 | ||
1758 | /*======================================================================== | 1758 | /*======================================================================== |
@@ -1890,9 +1890,9 @@ xfs_dir_leaf_order(xfs_dabuf_t *leaf1_bp, xfs_dabuf_t *leaf2_bp) | |||
1890 | INT_GET(leaf1->entries[ 0 ].hashval, ARCH_CONVERT)) || | 1890 | INT_GET(leaf1->entries[ 0 ].hashval, ARCH_CONVERT)) || |
1891 | (INT_GET(leaf2->entries[ INT_GET(leaf2->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT) < | 1891 | (INT_GET(leaf2->entries[ INT_GET(leaf2->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT) < |
1892 | INT_GET(leaf1->entries[ INT_GET(leaf1->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT)))) { | 1892 | INT_GET(leaf1->entries[ INT_GET(leaf1->hdr.count, ARCH_CONVERT)-1 ].hashval, ARCH_CONVERT)))) { |
1893 | return(1); | 1893 | return 1; |
1894 | } | 1894 | } |
1895 | return(0); | 1895 | return 0; |
1896 | } | 1896 | } |
1897 | 1897 | ||
1898 | /* | 1898 | /* |
@@ -1942,7 +1942,7 @@ xfs_dir_leaf_getdents_int( | |||
1942 | leaf = bp->data; | 1942 | leaf = bp->data; |
1943 | if (INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) != XFS_DIR_LEAF_MAGIC) { | 1943 | if (INT_GET(leaf->hdr.info.magic, ARCH_CONVERT) != XFS_DIR_LEAF_MAGIC) { |
1944 | *eobp = 1; | 1944 | *eobp = 1; |
1945 | return(XFS_ERROR(ENOENT)); /* XXX wrong code */ | 1945 | return XFS_ERROR(ENOENT); /* XXX wrong code */ |
1946 | } | 1946 | } |
1947 | 1947 | ||
1948 | want_entno = XFS_DA_COOKIE_ENTRY(mp, uio->uio_offset); | 1948 | want_entno = XFS_DA_COOKIE_ENTRY(mp, uio->uio_offset); |
@@ -2000,7 +2000,7 @@ xfs_dir_leaf_getdents_int( | |||
2000 | * the node code will be setting uio_offset anyway. | 2000 | * the node code will be setting uio_offset anyway. |
2001 | */ | 2001 | */ |
2002 | *eobp = 0; | 2002 | *eobp = 0; |
2003 | return(0); | 2003 | return 0; |
2004 | } | 2004 | } |
2005 | xfs_dir_trace_g_due("leaf: hash found", dp, uio, entry); | 2005 | xfs_dir_trace_g_due("leaf: hash found", dp, uio, entry); |
2006 | 2006 | ||
@@ -2057,7 +2057,7 @@ xfs_dir_leaf_getdents_int( | |||
2057 | retval = xfs_da_read_buf(dp->i_transp, dp, thishash, | 2057 | retval = xfs_da_read_buf(dp->i_transp, dp, thishash, |
2058 | nextda, &bp2, XFS_DATA_FORK); | 2058 | nextda, &bp2, XFS_DATA_FORK); |
2059 | if (retval) | 2059 | if (retval) |
2060 | return(retval); | 2060 | return retval; |
2061 | 2061 | ||
2062 | ASSERT(bp2 != NULL); | 2062 | ASSERT(bp2 != NULL); |
2063 | 2063 | ||
@@ -2073,7 +2073,7 @@ xfs_dir_leaf_getdents_int( | |||
2073 | leaf2); | 2073 | leaf2); |
2074 | xfs_da_brelse(dp->i_transp, bp2); | 2074 | xfs_da_brelse(dp->i_transp, bp2); |
2075 | 2075 | ||
2076 | return(XFS_ERROR(EFSCORRUPTED)); | 2076 | return XFS_ERROR(EFSCORRUPTED); |
2077 | } | 2077 | } |
2078 | 2078 | ||
2079 | nexthash = INT_GET(leaf2->entries[0].hashval, | 2079 | nexthash = INT_GET(leaf2->entries[0].hashval, |
@@ -2139,7 +2139,7 @@ xfs_dir_leaf_getdents_int( | |||
2139 | 2139 | ||
2140 | xfs_dir_trace_g_du("leaf: E-O-B", dp, uio); | 2140 | xfs_dir_trace_g_du("leaf: E-O-B", dp, uio); |
2141 | 2141 | ||
2142 | return(retval); | 2142 | return retval; |
2143 | } | 2143 | } |
2144 | } | 2144 | } |
2145 | 2145 | ||
@@ -2149,7 +2149,7 @@ xfs_dir_leaf_getdents_int( | |||
2149 | 2149 | ||
2150 | xfs_dir_trace_g_du("leaf: E-O-F", dp, uio); | 2150 | xfs_dir_trace_g_du("leaf: E-O-F", dp, uio); |
2151 | 2151 | ||
2152 | return(0); | 2152 | return 0; |
2153 | } | 2153 | } |
2154 | 2154 | ||
2155 | /* | 2155 | /* |