aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-03-17 01:29:31 -0500
committerNathan Scott <nathans@sgi.com>2006-03-17 01:29:31 -0500
commit984a081a7c89ea7e1b6f47cbc0e5c8ef67ad6e09 (patch)
tree3f2a268952942567ccb43e1386644aa22a2cf5b2 /fs/xfs
parent3b244aa81ecb06859e0c16abf4c26404c1d86591 (diff)
[XFS] store xfs_attr_sf_sort in native endian
SGI-PV: 943272 SGI-Modid: xfs-linux-melb:xfs-kern:25502a Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_attr_leaf.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index 37d2e10f874c..e4071eb1e6cf 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -513,11 +513,9 @@ xfs_attr_shortform_compare(const void *a, const void *b)
513 513
514 sa = (xfs_attr_sf_sort_t *)a; 514 sa = (xfs_attr_sf_sort_t *)a;
515 sb = (xfs_attr_sf_sort_t *)b; 515 sb = (xfs_attr_sf_sort_t *)b;
516 if (INT_GET(sa->hash, ARCH_CONVERT) 516 if (sa->hash < sb->hash) {
517 < INT_GET(sb->hash, ARCH_CONVERT)) {
518 return(-1); 517 return(-1);
519 } else if (INT_GET(sa->hash, ARCH_CONVERT) 518 } else if (sa->hash > sb->hash) {
520 > INT_GET(sb->hash, ARCH_CONVERT)) {
521 return(1); 519 return(1);
522 } else { 520 } else {
523 return(sa->entno - sb->entno); 521 return(sa->entno - sb->entno);
@@ -631,8 +629,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
631 continue; 629 continue;
632 } 630 }
633 sbp->entno = i; 631 sbp->entno = i;
634 INT_SET(sbp->hash, ARCH_CONVERT, 632 sbp->hash = xfs_da_hashname((char *)sfe->nameval, sfe->namelen);
635 xfs_da_hashname((char *)sfe->nameval, sfe->namelen));
636 sbp->name = (char *)sfe->nameval; 633 sbp->name = (char *)sfe->nameval;
637 sbp->namelen = sfe->namelen; 634 sbp->namelen = sfe->namelen;
638 /* These are bytes, and both on-disk, don't endian-flip */ 635 /* These are bytes, and both on-disk, don't endian-flip */
@@ -655,12 +652,12 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
655 cursor->initted = 1; 652 cursor->initted = 1;
656 cursor->blkno = 0; 653 cursor->blkno = 0;
657 for (sbp = sbuf, i = 0; i < nsbuf; i++, sbp++) { 654 for (sbp = sbuf, i = 0; i < nsbuf; i++, sbp++) {
658 if (INT_GET(sbp->hash, ARCH_CONVERT) == cursor->hashval) { 655 if (sbp->hash == cursor->hashval) {
659 if (cursor->offset == count) { 656 if (cursor->offset == count) {
660 break; 657 break;
661 } 658 }
662 count++; 659 count++;
663 } else if (INT_GET(sbp->hash, ARCH_CONVERT) > cursor->hashval) { 660 } else if (sbp->hash > cursor->hashval) {
664 break; 661 break;
665 } 662 }
666 } 663 }
@@ -680,8 +677,8 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
680 ((sbp->flags & XFS_ATTR_ROOT) ? &attr_trusted : 677 ((sbp->flags & XFS_ATTR_ROOT) ? &attr_trusted :
681 &attr_user); 678 &attr_user);
682 679
683 if (cursor->hashval != INT_GET(sbp->hash, ARCH_CONVERT)) { 680 if (cursor->hashval != sbp->hash) {
684 cursor->hashval = INT_GET(sbp->hash, ARCH_CONVERT); 681 cursor->hashval = sbp->hash;
685 cursor->offset = 0; 682 cursor->offset = 0;
686 } 683 }
687 if (context->flags & ATTR_KERNOVAL) { 684 if (context->flags & ATTR_KERNOVAL) {