aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_attr.c46
-rw-r--r--fs/xfs/xfs_attr_inactive.c14
-rw-r--r--fs/xfs/xfs_attr_leaf.c48
-rw-r--r--fs/xfs/xfs_attr_list.c20
-rw-r--r--fs/xfs/xfs_attr_remote.c12
-rw-r--r--fs/xfs/xfs_da_btree.c68
-rw-r--r--fs/xfs/xfs_dquot.c12
-rw-r--r--fs/xfs/xfs_inode_fork.c2
-rw-r--r--fs/xfs/xfs_linux.h2
-rw-r--r--fs/xfs/xfs_log_recover.c14
-rw-r--r--fs/xfs/xfs_qm.c4
-rw-r--r--fs/xfs/xfs_qm_syscalls.c22
-rw-r--r--fs/xfs/xfs_trans.c4
-rw-r--r--fs/xfs/xfs_trans_buf.c13
14 files changed, 140 insertions, 141 deletions
diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c
index bfe36fc2cdc2..4cd541891a60 100644
--- a/fs/xfs/xfs_attr.c
+++ b/fs/xfs/xfs_attr.c
@@ -535,27 +535,27 @@ xfs_attr_shortform_addname(xfs_da_args_t *args)
535 535
536 retval = xfs_attr_shortform_lookup(args); 536 retval = xfs_attr_shortform_lookup(args);
537 if ((args->flags & ATTR_REPLACE) && (retval == ENOATTR)) { 537 if ((args->flags & ATTR_REPLACE) && (retval == ENOATTR)) {
538 return(retval); 538 return retval;
539 } else if (retval == EEXIST) { 539 } else if (retval == EEXIST) {
540 if (args->flags & ATTR_CREATE) 540 if (args->flags & ATTR_CREATE)
541 return(retval); 541 return retval;
542 retval = xfs_attr_shortform_remove(args); 542 retval = xfs_attr_shortform_remove(args);
543 ASSERT(retval == 0); 543 ASSERT(retval == 0);
544 } 544 }
545 545
546 if (args->namelen >= XFS_ATTR_SF_ENTSIZE_MAX || 546 if (args->namelen >= XFS_ATTR_SF_ENTSIZE_MAX ||
547 args->valuelen >= XFS_ATTR_SF_ENTSIZE_MAX) 547 args->valuelen >= XFS_ATTR_SF_ENTSIZE_MAX)
548 return(XFS_ERROR(ENOSPC)); 548 return XFS_ERROR(ENOSPC);
549 549
550 newsize = XFS_ATTR_SF_TOTSIZE(args->dp); 550 newsize = XFS_ATTR_SF_TOTSIZE(args->dp);
551 newsize += XFS_ATTR_SF_ENTSIZE_BYNAME(args->namelen, args->valuelen); 551 newsize += XFS_ATTR_SF_ENTSIZE_BYNAME(args->namelen, args->valuelen);
552 552
553 forkoff = xfs_attr_shortform_bytesfit(args->dp, newsize); 553 forkoff = xfs_attr_shortform_bytesfit(args->dp, newsize);
554 if (!forkoff) 554 if (!forkoff)
555 return(XFS_ERROR(ENOSPC)); 555 return XFS_ERROR(ENOSPC);
556 556
557 xfs_attr_shortform_add(args, forkoff); 557 xfs_attr_shortform_add(args, forkoff);
558 return(0); 558 return 0;
559} 559}
560 560
561 561
@@ -642,7 +642,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
642 ASSERT(committed); 642 ASSERT(committed);
643 args->trans = NULL; 643 args->trans = NULL;
644 xfs_bmap_cancel(args->flist); 644 xfs_bmap_cancel(args->flist);
645 return(error); 645 return error;
646 } 646 }
647 647
648 /* 648 /*
@@ -658,13 +658,13 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
658 */ 658 */
659 error = xfs_trans_roll(&args->trans, dp); 659 error = xfs_trans_roll(&args->trans, dp);
660 if (error) 660 if (error)
661 return (error); 661 return error;
662 662
663 /* 663 /*
664 * Fob the whole rest of the problem off on the Btree code. 664 * Fob the whole rest of the problem off on the Btree code.
665 */ 665 */
666 error = xfs_attr_node_addname(args); 666 error = xfs_attr_node_addname(args);
667 return(error); 667 return error;
668 } 668 }
669 669
670 /* 670 /*
@@ -673,7 +673,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
673 */ 673 */
674 error = xfs_trans_roll(&args->trans, dp); 674 error = xfs_trans_roll(&args->trans, dp);
675 if (error) 675 if (error)
676 return (error); 676 return error;
677 677
678 /* 678 /*
679 * If there was an out-of-line value, allocate the blocks we 679 * If there was an out-of-line value, allocate the blocks we
@@ -684,7 +684,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
684 if (args->rmtblkno > 0) { 684 if (args->rmtblkno > 0) {
685 error = xfs_attr_rmtval_set(args); 685 error = xfs_attr_rmtval_set(args);
686 if (error) 686 if (error)
687 return(error); 687 return error;
688 } 688 }
689 689
690 /* 690 /*
@@ -700,7 +700,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
700 */ 700 */
701 error = xfs_attr3_leaf_flipflags(args); 701 error = xfs_attr3_leaf_flipflags(args);
702 if (error) 702 if (error)
703 return(error); 703 return error;
704 704
705 /* 705 /*
706 * Dismantle the "old" attribute/value pair by removing 706 * Dismantle the "old" attribute/value pair by removing
@@ -714,7 +714,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
714 if (args->rmtblkno) { 714 if (args->rmtblkno) {
715 error = xfs_attr_rmtval_remove(args); 715 error = xfs_attr_rmtval_remove(args);
716 if (error) 716 if (error)
717 return(error); 717 return error;
718 } 718 }
719 719
720 /* 720 /*
@@ -744,7 +744,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args)
744 ASSERT(committed); 744 ASSERT(committed);
745 args->trans = NULL; 745 args->trans = NULL;
746 xfs_bmap_cancel(args->flist); 746 xfs_bmap_cancel(args->flist);
747 return(error); 747 return error;
748 } 748 }
749 749
750 /* 750 /*
@@ -1031,7 +1031,7 @@ restart:
1031 if (args->rmtblkno > 0) { 1031 if (args->rmtblkno > 0) {
1032 error = xfs_attr_rmtval_set(args); 1032 error = xfs_attr_rmtval_set(args);
1033 if (error) 1033 if (error)
1034 return(error); 1034 return error;
1035 } 1035 }
1036 1036
1037 /* 1037 /*
@@ -1061,7 +1061,7 @@ restart:
1061 if (args->rmtblkno) { 1061 if (args->rmtblkno) {
1062 error = xfs_attr_rmtval_remove(args); 1062 error = xfs_attr_rmtval_remove(args);
1063 if (error) 1063 if (error)
1064 return(error); 1064 return error;
1065 } 1065 }
1066 1066
1067 /* 1067 /*
@@ -1134,8 +1134,8 @@ out:
1134 if (state) 1134 if (state)
1135 xfs_da_state_free(state); 1135 xfs_da_state_free(state);
1136 if (error) 1136 if (error)
1137 return(error); 1137 return error;
1138 return(retval); 1138 return retval;
1139} 1139}
1140 1140
1141/* 1141/*
@@ -1297,7 +1297,7 @@ xfs_attr_node_removename(xfs_da_args_t *args)
1297 1297
1298out: 1298out:
1299 xfs_da_state_free(state); 1299 xfs_da_state_free(state);
1300 return(error); 1300 return error;
1301} 1301}
1302 1302
1303/* 1303/*
@@ -1345,7 +1345,7 @@ xfs_attr_fillstate(xfs_da_state_t *state)
1345 } 1345 }
1346 } 1346 }
1347 1347
1348 return(0); 1348 return 0;
1349} 1349}
1350 1350
1351/* 1351/*
@@ -1376,7 +1376,7 @@ xfs_attr_refillstate(xfs_da_state_t *state)
1376 blk->blkno, blk->disk_blkno, 1376 blk->blkno, blk->disk_blkno,
1377 &blk->bp, XFS_ATTR_FORK); 1377 &blk->bp, XFS_ATTR_FORK);
1378 if (error) 1378 if (error)
1379 return(error); 1379 return error;
1380 } else { 1380 } else {
1381 blk->bp = NULL; 1381 blk->bp = NULL;
1382 } 1382 }
@@ -1395,13 +1395,13 @@ xfs_attr_refillstate(xfs_da_state_t *state)
1395 blk->blkno, blk->disk_blkno, 1395 blk->blkno, blk->disk_blkno,
1396 &blk->bp, XFS_ATTR_FORK); 1396 &blk->bp, XFS_ATTR_FORK);
1397 if (error) 1397 if (error)
1398 return(error); 1398 return error;
1399 } else { 1399 } else {
1400 blk->bp = NULL; 1400 blk->bp = NULL;
1401 } 1401 }
1402 } 1402 }
1403 1403
1404 return(0); 1404 return 0;
1405} 1405}
1406 1406
1407/* 1407/*
@@ -1455,5 +1455,5 @@ xfs_attr_node_get(xfs_da_args_t *args)
1455 } 1455 }
1456 1456
1457 xfs_da_state_free(state); 1457 xfs_da_state_free(state);
1458 return(retval); 1458 return retval;
1459} 1459}
diff --git a/fs/xfs/xfs_attr_inactive.c b/fs/xfs/xfs_attr_inactive.c
index 09480c57f069..b39e58823085 100644
--- a/fs/xfs/xfs_attr_inactive.c
+++ b/fs/xfs/xfs_attr_inactive.c
@@ -76,7 +76,7 @@ xfs_attr3_leaf_freextent(
76 error = xfs_bmapi_read(dp, (xfs_fileoff_t)tblkno, tblkcnt, 76 error = xfs_bmapi_read(dp, (xfs_fileoff_t)tblkno, tblkcnt,
77 &map, &nmap, XFS_BMAPI_ATTRFORK); 77 &map, &nmap, XFS_BMAPI_ATTRFORK);
78 if (error) { 78 if (error) {
79 return(error); 79 return error;
80 } 80 }
81 ASSERT(nmap == 1); 81 ASSERT(nmap == 1);
82 ASSERT(map.br_startblock != DELAYSTARTBLOCK); 82 ASSERT(map.br_startblock != DELAYSTARTBLOCK);
@@ -102,14 +102,14 @@ xfs_attr3_leaf_freextent(
102 */ 102 */
103 error = xfs_trans_roll(trans, dp); 103 error = xfs_trans_roll(trans, dp);
104 if (error) 104 if (error)
105 return (error); 105 return error;
106 } 106 }
107 107
108 tblkno += map.br_blockcount; 108 tblkno += map.br_blockcount;
109 tblkcnt -= map.br_blockcount; 109 tblkcnt -= map.br_blockcount;
110 } 110 }
111 111
112 return(0); 112 return 0;
113} 113}
114 114
115/* 115/*
@@ -256,7 +256,7 @@ xfs_attr3_node_inactive(
256 error = xfs_da3_node_read(*trans, dp, child_fsb, -2, &child_bp, 256 error = xfs_da3_node_read(*trans, dp, child_fsb, -2, &child_bp,
257 XFS_ATTR_FORK); 257 XFS_ATTR_FORK);
258 if (error) 258 if (error)
259 return(error); 259 return error;
260 if (child_bp) { 260 if (child_bp) {
261 /* save for re-read later */ 261 /* save for re-read later */
262 child_blkno = XFS_BUF_ADDR(child_bp); 262 child_blkno = XFS_BUF_ADDR(child_bp);
@@ -414,7 +414,7 @@ xfs_attr_inactive(xfs_inode_t *dp)
414 error = xfs_trans_reserve(trans, &M_RES(mp)->tr_attrinval, 0, 0); 414 error = xfs_trans_reserve(trans, &M_RES(mp)->tr_attrinval, 0, 0);
415 if (error) { 415 if (error) {
416 xfs_trans_cancel(trans, 0); 416 xfs_trans_cancel(trans, 0);
417 return(error); 417 return error;
418 } 418 }
419 xfs_ilock(dp, XFS_ILOCK_EXCL); 419 xfs_ilock(dp, XFS_ILOCK_EXCL);
420 420
@@ -443,10 +443,10 @@ xfs_attr_inactive(xfs_inode_t *dp)
443 error = xfs_trans_commit(trans, XFS_TRANS_RELEASE_LOG_RES); 443 error = xfs_trans_commit(trans, XFS_TRANS_RELEASE_LOG_RES);
444 xfs_iunlock(dp, XFS_ILOCK_EXCL); 444 xfs_iunlock(dp, XFS_ILOCK_EXCL);
445 445
446 return(error); 446 return error;
447 447
448out: 448out:
449 xfs_trans_cancel(trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); 449 xfs_trans_cancel(trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT);
450 xfs_iunlock(dp, XFS_ILOCK_EXCL); 450 xfs_iunlock(dp, XFS_ILOCK_EXCL);
451 return(error); 451 return error;
452} 452}
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c
index 28712d29e43c..d2ce4013084c 100644
--- a/fs/xfs/xfs_attr_leaf.c
+++ b/fs/xfs/xfs_attr_leaf.c
@@ -547,7 +547,7 @@ xfs_attr_shortform_remove(xfs_da_args_t *args)
547 break; 547 break;
548 } 548 }
549 if (i == end) 549 if (i == end)
550 return(XFS_ERROR(ENOATTR)); 550 return XFS_ERROR(ENOATTR);
551 551
552 /* 552 /*
553 * Fix up the attribute fork data, covering the hole 553 * Fix up the attribute fork data, covering the hole
@@ -582,7 +582,7 @@ xfs_attr_shortform_remove(xfs_da_args_t *args)
582 582
583 xfs_sbversion_add_attr2(mp, args->trans); 583 xfs_sbversion_add_attr2(mp, args->trans);
584 584
585 return(0); 585 return 0;
586} 586}
587 587
588/* 588/*
@@ -611,9 +611,9 @@ xfs_attr_shortform_lookup(xfs_da_args_t *args)
611 continue; 611 continue;
612 if (!xfs_attr_namesp_match(args->flags, sfe->flags)) 612 if (!xfs_attr_namesp_match(args->flags, sfe->flags))
613 continue; 613 continue;
614 return(XFS_ERROR(EEXIST)); 614 return XFS_ERROR(EEXIST);
615 } 615 }
616 return(XFS_ERROR(ENOATTR)); 616 return XFS_ERROR(ENOATTR);
617} 617}
618 618
619/* 619/*
@@ -640,18 +640,18 @@ xfs_attr_shortform_getvalue(xfs_da_args_t *args)
640 continue; 640 continue;
641 if (args->flags & ATTR_KERNOVAL) { 641 if (args->flags & ATTR_KERNOVAL) {
642 args->valuelen = sfe->valuelen; 642 args->valuelen = sfe->valuelen;
643 return(XFS_ERROR(EEXIST)); 643 return XFS_ERROR(EEXIST);
644 } 644 }
645 if (args->valuelen < sfe->valuelen) { 645 if (args->valuelen < sfe->valuelen) {
646 args->valuelen = sfe->valuelen; 646 args->valuelen = sfe->valuelen;
647 return(XFS_ERROR(ERANGE)); 647 return XFS_ERROR(ERANGE);
648 } 648 }
649 args->valuelen = sfe->valuelen; 649 args->valuelen = sfe->valuelen;
650 memcpy(args->value, &sfe->nameval[args->namelen], 650 memcpy(args->value, &sfe->nameval[args->namelen],
651 args->valuelen); 651 args->valuelen);
652 return(XFS_ERROR(EEXIST)); 652 return XFS_ERROR(EEXIST);
653 } 653 }
654 return(XFS_ERROR(ENOATTR)); 654 return XFS_ERROR(ENOATTR);
655} 655}
656 656
657/* 657/*
@@ -741,7 +741,7 @@ xfs_attr_shortform_to_leaf(xfs_da_args_t *args)
741 741
742out: 742out:
743 kmem_free(tmpbuffer); 743 kmem_free(tmpbuffer);
744 return(error); 744 return error;
745} 745}
746 746
747/* 747/*
@@ -769,12 +769,12 @@ xfs_attr_shortform_allfit(
769 if (entry->flags & XFS_ATTR_INCOMPLETE) 769 if (entry->flags & XFS_ATTR_INCOMPLETE)
770 continue; /* don't copy partial entries */ 770 continue; /* don't copy partial entries */
771 if (!(entry->flags & XFS_ATTR_LOCAL)) 771 if (!(entry->flags & XFS_ATTR_LOCAL))
772 return(0); 772 return 0;
773 name_loc = xfs_attr3_leaf_name_local(leaf, i); 773 name_loc = xfs_attr3_leaf_name_local(leaf, i);
774 if (name_loc->namelen >= XFS_ATTR_SF_ENTSIZE_MAX) 774 if (name_loc->namelen >= XFS_ATTR_SF_ENTSIZE_MAX)
775 return(0); 775 return 0;
776 if (be16_to_cpu(name_loc->valuelen) >= XFS_ATTR_SF_ENTSIZE_MAX) 776 if (be16_to_cpu(name_loc->valuelen) >= XFS_ATTR_SF_ENTSIZE_MAX)
777 return(0); 777 return 0;
778 bytes += sizeof(struct xfs_attr_sf_entry) - 1 778 bytes += sizeof(struct xfs_attr_sf_entry) - 1
779 + name_loc->namelen 779 + name_loc->namelen
780 + be16_to_cpu(name_loc->valuelen); 780 + be16_to_cpu(name_loc->valuelen);
@@ -1017,10 +1017,10 @@ xfs_attr3_leaf_split(
1017 ASSERT(oldblk->magic == XFS_ATTR_LEAF_MAGIC); 1017 ASSERT(oldblk->magic == XFS_ATTR_LEAF_MAGIC);
1018 error = xfs_da_grow_inode(state->args, &blkno); 1018 error = xfs_da_grow_inode(state->args, &blkno);
1019 if (error) 1019 if (error)
1020 return(error); 1020 return error;
1021 error = xfs_attr3_leaf_create(state->args, blkno, &newblk->bp); 1021 error = xfs_attr3_leaf_create(state->args, blkno, &newblk->bp);
1022 if (error) 1022 if (error)
1023 return(error); 1023 return error;
1024 newblk->blkno = blkno; 1024 newblk->blkno = blkno;
1025 newblk->magic = XFS_ATTR_LEAF_MAGIC; 1025 newblk->magic = XFS_ATTR_LEAF_MAGIC;
1026 1026
@@ -1031,7 +1031,7 @@ xfs_attr3_leaf_split(
1031 xfs_attr3_leaf_rebalance(state, oldblk, newblk); 1031 xfs_attr3_leaf_rebalance(state, oldblk, newblk);
1032 error = xfs_da3_blk_link(state, oldblk, newblk); 1032 error = xfs_da3_blk_link(state, oldblk, newblk);
1033 if (error) 1033 if (error)
1034 return(error); 1034 return error;
1035 1035
1036 /* 1036 /*
1037 * Save info on "old" attribute for "atomic rename" ops, leaf_add() 1037 * Save info on "old" attribute for "atomic rename" ops, leaf_add()
@@ -1053,7 +1053,7 @@ xfs_attr3_leaf_split(
1053 */ 1053 */
1054 oldblk->hashval = xfs_attr_leaf_lasthash(oldblk->bp, NULL); 1054 oldblk->hashval = xfs_attr_leaf_lasthash(oldblk->bp, NULL);
1055 newblk->hashval = xfs_attr_leaf_lasthash(newblk->bp, NULL); 1055 newblk->hashval = xfs_attr_leaf_lasthash(newblk->bp, NULL);
1056 return(error); 1056 return error;
1057} 1057}
1058 1058
1059/* 1059/*
@@ -1692,7 +1692,7 @@ xfs_attr3_leaf_toosmall(
1692 ichdr.usedbytes; 1692 ichdr.usedbytes;
1693 if (bytes > (state->args->geo->blksize >> 1)) { 1693 if (bytes > (state->args->geo->blksize >> 1)) {
1694 *action = 0; /* blk over 50%, don't try to join */ 1694 *action = 0; /* blk over 50%, don't try to join */
1695 return(0); 1695 return 0;
1696 } 1696 }
1697 1697
1698 /* 1698 /*
@@ -1711,7 +1711,7 @@ xfs_attr3_leaf_toosmall(
1711 error = xfs_da3_path_shift(state, &state->altpath, forward, 1711 error = xfs_da3_path_shift(state, &state->altpath, forward,
1712 0, &retval); 1712 0, &retval);
1713 if (error) 1713 if (error)
1714 return(error); 1714 return error;
1715 if (retval) { 1715 if (retval) {
1716 *action = 0; 1716 *action = 0;
1717 } else { 1717 } else {
@@ -1740,7 +1740,7 @@ xfs_attr3_leaf_toosmall(
1740 error = xfs_attr3_leaf_read(state->args->trans, state->args->dp, 1740 error = xfs_attr3_leaf_read(state->args->trans, state->args->dp,
1741 blkno, -1, &bp); 1741 blkno, -1, &bp);
1742 if (error) 1742 if (error)
1743 return(error); 1743 return error;
1744 1744
1745 xfs_attr3_leaf_hdr_from_disk(&ichdr2, bp->b_addr); 1745 xfs_attr3_leaf_hdr_from_disk(&ichdr2, bp->b_addr);
1746 1746
@@ -1757,7 +1757,7 @@ xfs_attr3_leaf_toosmall(
1757 } 1757 }
1758 if (i >= 2) { 1758 if (i >= 2) {
1759 *action = 0; 1759 *action = 0;
1760 return(0); 1760 return 0;
1761 } 1761 }
1762 1762
1763 /* 1763 /*
@@ -1773,13 +1773,13 @@ xfs_attr3_leaf_toosmall(
1773 0, &retval); 1773 0, &retval);
1774 } 1774 }
1775 if (error) 1775 if (error)
1776 return(error); 1776 return error;
1777 if (retval) { 1777 if (retval) {
1778 *action = 0; 1778 *action = 0;
1779 } else { 1779 } else {
1780 *action = 1; 1780 *action = 1;
1781 } 1781 }
1782 return(0); 1782 return 0;
1783} 1783}
1784 1784
1785/* 1785/*
@@ -2481,7 +2481,7 @@ xfs_attr3_leaf_clearflag(
2481 */ 2481 */
2482 error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, -1, &bp); 2482 error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, -1, &bp);
2483 if (error) 2483 if (error)
2484 return(error); 2484 return error;
2485 2485
2486 leaf = bp->b_addr; 2486 leaf = bp->b_addr;
2487 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; 2487 entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
@@ -2548,7 +2548,7 @@ xfs_attr3_leaf_setflag(
2548 */ 2548 */
2549 error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, -1, &bp); 2549 error = xfs_attr3_leaf_read(args->trans, args->dp, args->blkno, -1, &bp);
2550 if (error) 2550 if (error)
2551 return(error); 2551 return error;
2552 2552
2553 leaf = bp->b_addr; 2553 leaf = bp->b_addr;
2554#ifdef DEBUG 2554#ifdef DEBUG
diff --git a/fs/xfs/xfs_attr_list.c b/fs/xfs/xfs_attr_list.c
index 90e2eeb21207..2d5487b6194c 100644
--- a/fs/xfs/xfs_attr_list.c
+++ b/fs/xfs/xfs_attr_list.c
@@ -50,11 +50,11 @@ xfs_attr_shortform_compare(const void *a, const void *b)
50 sa = (xfs_attr_sf_sort_t *)a; 50 sa = (xfs_attr_sf_sort_t *)a;
51 sb = (xfs_attr_sf_sort_t *)b; 51 sb = (xfs_attr_sf_sort_t *)b;
52 if (sa->hash < sb->hash) { 52 if (sa->hash < sb->hash) {
53 return(-1); 53 return -1;
54 } else if (sa->hash > sb->hash) { 54 } else if (sa->hash > sb->hash) {
55 return(1); 55 return 1;
56 } else { 56 } else {
57 return(sa->entno - sb->entno); 57 return sa->entno - sb->entno;
58 } 58 }
59} 59}
60 60
@@ -86,7 +86,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
86 sf = (xfs_attr_shortform_t *)dp->i_afp->if_u1.if_data; 86 sf = (xfs_attr_shortform_t *)dp->i_afp->if_u1.if_data;
87 ASSERT(sf != NULL); 87 ASSERT(sf != NULL);
88 if (!sf->hdr.count) 88 if (!sf->hdr.count)
89 return(0); 89 return 0;
90 cursor = context->cursor; 90 cursor = context->cursor;
91 ASSERT(cursor != NULL); 91 ASSERT(cursor != NULL);
92 92
@@ -124,7 +124,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
124 sfe = XFS_ATTR_SF_NEXTENTRY(sfe); 124 sfe = XFS_ATTR_SF_NEXTENTRY(sfe);
125 } 125 }
126 trace_xfs_attr_list_sf_all(context); 126 trace_xfs_attr_list_sf_all(context);
127 return(0); 127 return 0;
128 } 128 }
129 129
130 /* do no more for a search callback */ 130 /* do no more for a search callback */
@@ -188,7 +188,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
188 } 188 }
189 if (i == nsbuf) { 189 if (i == nsbuf) {
190 kmem_free(sbuf); 190 kmem_free(sbuf);
191 return(0); 191 return 0;
192 } 192 }
193 193
194 /* 194 /*
@@ -213,7 +213,7 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
213 } 213 }
214 214
215 kmem_free(sbuf); 215 kmem_free(sbuf);
216 return(0); 216 return 0;
217} 217}
218 218
219STATIC int 219STATIC int
@@ -244,7 +244,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
244 error = xfs_da3_node_read(NULL, dp, cursor->blkno, -1, 244 error = xfs_da3_node_read(NULL, dp, cursor->blkno, -1,
245 &bp, XFS_ATTR_FORK); 245 &bp, XFS_ATTR_FORK);
246 if ((error != 0) && (error != EFSCORRUPTED)) 246 if ((error != 0) && (error != EFSCORRUPTED))
247 return(error); 247 return error;
248 if (bp) { 248 if (bp) {
249 struct xfs_attr_leaf_entry *entries; 249 struct xfs_attr_leaf_entry *entries;
250 250
@@ -295,7 +295,7 @@ xfs_attr_node_list(xfs_attr_list_context_t *context)
295 cursor->blkno, -1, &bp, 295 cursor->blkno, -1, &bp,
296 XFS_ATTR_FORK); 296 XFS_ATTR_FORK);
297 if (error) 297 if (error)
298 return(error); 298 return error;
299 node = bp->b_addr; 299 node = bp->b_addr;
300 magic = be16_to_cpu(node->hdr.info.magic); 300 magic = be16_to_cpu(node->hdr.info.magic);
301 if (magic == XFS_ATTR_LEAF_MAGIC || 301 if (magic == XFS_ATTR_LEAF_MAGIC ||
@@ -616,7 +616,7 @@ xfs_attr_list(
616 * Validate the cursor. 616 * Validate the cursor.
617 */ 617 */
618 if (cursor->pad1 || cursor->pad2) 618 if (cursor->pad1 || cursor->pad2)
619 return(XFS_ERROR(EINVAL)); 619 return XFS_ERROR(EINVAL);
620 if ((cursor->initted == 0) && 620 if ((cursor->initted == 0) &&
621 (cursor->hashval || cursor->blkno || cursor->offset)) 621 (cursor->hashval || cursor->blkno || cursor->offset))
622 return XFS_ERROR(EINVAL); 622 return XFS_ERROR(EINVAL);
diff --git a/fs/xfs/xfs_attr_remote.c b/fs/xfs/xfs_attr_remote.c
index b5adfecbb8ee..a8bbc562ff35 100644
--- a/fs/xfs/xfs_attr_remote.c
+++ b/fs/xfs/xfs_attr_remote.c
@@ -452,7 +452,7 @@ xfs_attr_rmtval_set(
452 ASSERT(committed); 452 ASSERT(committed);
453 args->trans = NULL; 453 args->trans = NULL;
454 xfs_bmap_cancel(args->flist); 454 xfs_bmap_cancel(args->flist);
455 return(error); 455 return error;
456 } 456 }
457 457
458 /* 458 /*
@@ -473,7 +473,7 @@ xfs_attr_rmtval_set(
473 */ 473 */
474 error = xfs_trans_roll(&args->trans, dp); 474 error = xfs_trans_roll(&args->trans, dp);
475 if (error) 475 if (error)
476 return (error); 476 return error;
477 } 477 }
478 478
479 /* 479 /*
@@ -498,7 +498,7 @@ xfs_attr_rmtval_set(
498 blkcnt, &map, &nmap, 498 blkcnt, &map, &nmap,
499 XFS_BMAPI_ATTRFORK); 499 XFS_BMAPI_ATTRFORK);
500 if (error) 500 if (error)
501 return(error); 501 return error;
502 ASSERT(nmap == 1); 502 ASSERT(nmap == 1);
503 ASSERT((map.br_startblock != DELAYSTARTBLOCK) && 503 ASSERT((map.br_startblock != DELAYSTARTBLOCK) &&
504 (map.br_startblock != HOLESTARTBLOCK)); 504 (map.br_startblock != HOLESTARTBLOCK));
@@ -563,7 +563,7 @@ xfs_attr_rmtval_remove(
563 error = xfs_bmapi_read(args->dp, (xfs_fileoff_t)lblkno, 563 error = xfs_bmapi_read(args->dp, (xfs_fileoff_t)lblkno,
564 blkcnt, &map, &nmap, XFS_BMAPI_ATTRFORK); 564 blkcnt, &map, &nmap, XFS_BMAPI_ATTRFORK);
565 if (error) 565 if (error)
566 return(error); 566 return error;
567 ASSERT(nmap == 1); 567 ASSERT(nmap == 1);
568 ASSERT((map.br_startblock != DELAYSTARTBLOCK) && 568 ASSERT((map.br_startblock != DELAYSTARTBLOCK) &&
569 (map.br_startblock != HOLESTARTBLOCK)); 569 (map.br_startblock != HOLESTARTBLOCK));
@@ -622,7 +622,7 @@ xfs_attr_rmtval_remove(
622 */ 622 */
623 error = xfs_trans_roll(&args->trans, args->dp); 623 error = xfs_trans_roll(&args->trans, args->dp);
624 if (error) 624 if (error)
625 return (error); 625 return error;
626 } 626 }
627 return(0); 627 return 0;
628} 628}
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c
index a514ab616650..7f2711f309a1 100644
--- a/fs/xfs/xfs_da_btree.c
+++ b/fs/xfs/xfs_da_btree.c
@@ -315,7 +315,7 @@ xfs_da3_node_create(
315 315
316 error = xfs_da_get_buf(tp, dp, blkno, -1, &bp, whichfork); 316 error = xfs_da_get_buf(tp, dp, blkno, -1, &bp, whichfork);
317 if (error) 317 if (error)
318 return(error); 318 return error;
319 bp->b_ops = &xfs_da3_node_buf_ops; 319 bp->b_ops = &xfs_da3_node_buf_ops;
320 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DA_NODE_BUF); 320 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DA_NODE_BUF);
321 node = bp->b_addr; 321 node = bp->b_addr;
@@ -337,7 +337,7 @@ xfs_da3_node_create(
337 XFS_DA_LOGRANGE(node, &node->hdr, dp->d_ops->node_hdr_size)); 337 XFS_DA_LOGRANGE(node, &node->hdr, dp->d_ops->node_hdr_size));
338 338
339 *bpp = bp; 339 *bpp = bp;
340 return(0); 340 return 0;
341} 341}
342 342
343/* 343/*
@@ -386,7 +386,7 @@ xfs_da3_split(
386 case XFS_ATTR_LEAF_MAGIC: 386 case XFS_ATTR_LEAF_MAGIC:
387 error = xfs_attr3_leaf_split(state, oldblk, newblk); 387 error = xfs_attr3_leaf_split(state, oldblk, newblk);
388 if ((error != 0) && (error != ENOSPC)) { 388 if ((error != 0) && (error != ENOSPC)) {
389 return(error); /* GROT: attr is inconsistent */ 389 return error; /* GROT: attr is inconsistent */
390 } 390 }
391 if (!error) { 391 if (!error) {
392 addblk = newblk; 392 addblk = newblk;
@@ -408,7 +408,7 @@ xfs_da3_split(
408 &state->extrablk); 408 &state->extrablk);
409 } 409 }
410 if (error) 410 if (error)
411 return(error); /* GROT: attr inconsistent */ 411 return error; /* GROT: attr inconsistent */
412 addblk = newblk; 412 addblk = newblk;
413 break; 413 break;
414 case XFS_DIR2_LEAFN_MAGIC: 414 case XFS_DIR2_LEAFN_MAGIC:
@@ -422,7 +422,7 @@ xfs_da3_split(
422 max - i, &action); 422 max - i, &action);
423 addblk->bp = NULL; 423 addblk->bp = NULL;
424 if (error) 424 if (error)
425 return(error); /* GROT: dir is inconsistent */ 425 return error; /* GROT: dir is inconsistent */
426 /* 426 /*
427 * Record the newly split block for the next time thru? 427 * Record the newly split block for the next time thru?
428 */ 428 */
@@ -439,7 +439,7 @@ xfs_da3_split(
439 xfs_da3_fixhashpath(state, &state->path); 439 xfs_da3_fixhashpath(state, &state->path);
440 } 440 }
441 if (!addblk) 441 if (!addblk)
442 return(0); 442 return 0;
443 443
444 /* 444 /*
445 * Split the root node. 445 * Split the root node.
@@ -449,7 +449,7 @@ xfs_da3_split(
449 error = xfs_da3_root_split(state, oldblk, addblk); 449 error = xfs_da3_root_split(state, oldblk, addblk);
450 if (error) { 450 if (error) {
451 addblk->bp = NULL; 451 addblk->bp = NULL;
452 return(error); /* GROT: dir is inconsistent */ 452 return error; /* GROT: dir is inconsistent */
453 } 453 }
454 454
455 /* 455 /*
@@ -492,7 +492,7 @@ xfs_da3_split(
492 sizeof(node->hdr.info))); 492 sizeof(node->hdr.info)));
493 } 493 }
494 addblk->bp = NULL; 494 addblk->bp = NULL;
495 return(0); 495 return 0;
496} 496}
497 497
498/* 498/*
@@ -670,18 +670,18 @@ xfs_da3_node_split(
670 */ 670 */
671 error = xfs_da_grow_inode(state->args, &blkno); 671 error = xfs_da_grow_inode(state->args, &blkno);
672 if (error) 672 if (error)
673 return(error); /* GROT: dir is inconsistent */ 673 return error; /* GROT: dir is inconsistent */
674 674
675 error = xfs_da3_node_create(state->args, blkno, treelevel, 675 error = xfs_da3_node_create(state->args, blkno, treelevel,
676 &newblk->bp, state->args->whichfork); 676 &newblk->bp, state->args->whichfork);
677 if (error) 677 if (error)
678 return(error); /* GROT: dir is inconsistent */ 678 return error; /* GROT: dir is inconsistent */
679 newblk->blkno = blkno; 679 newblk->blkno = blkno;
680 newblk->magic = XFS_DA_NODE_MAGIC; 680 newblk->magic = XFS_DA_NODE_MAGIC;
681 xfs_da3_node_rebalance(state, oldblk, newblk); 681 xfs_da3_node_rebalance(state, oldblk, newblk);
682 error = xfs_da3_blk_link(state, oldblk, newblk); 682 error = xfs_da3_blk_link(state, oldblk, newblk);
683 if (error) 683 if (error)
684 return(error); 684 return error;
685 *result = 1; 685 *result = 1;
686 } else { 686 } else {
687 *result = 0; 687 *result = 0;
@@ -721,7 +721,7 @@ xfs_da3_node_split(
721 } 721 }
722 } 722 }
723 723
724 return(0); 724 return 0;
725} 725}
726 726
727/* 727/*
@@ -963,9 +963,9 @@ xfs_da3_join(
963 case XFS_ATTR_LEAF_MAGIC: 963 case XFS_ATTR_LEAF_MAGIC:
964 error = xfs_attr3_leaf_toosmall(state, &action); 964 error = xfs_attr3_leaf_toosmall(state, &action);
965 if (error) 965 if (error)
966 return(error); 966 return error;
967 if (action == 0) 967 if (action == 0)
968 return(0); 968 return 0;
969 xfs_attr3_leaf_unbalance(state, drop_blk, save_blk); 969 xfs_attr3_leaf_unbalance(state, drop_blk, save_blk);
970 break; 970 break;
971 case XFS_DIR2_LEAFN_MAGIC: 971 case XFS_DIR2_LEAFN_MAGIC:
@@ -985,7 +985,7 @@ xfs_da3_join(
985 xfs_da3_fixhashpath(state, &state->path); 985 xfs_da3_fixhashpath(state, &state->path);
986 error = xfs_da3_node_toosmall(state, &action); 986 error = xfs_da3_node_toosmall(state, &action);
987 if (error) 987 if (error)
988 return(error); 988 return error;
989 if (action == 0) 989 if (action == 0)
990 return 0; 990 return 0;
991 xfs_da3_node_unbalance(state, drop_blk, save_blk); 991 xfs_da3_node_unbalance(state, drop_blk, save_blk);
@@ -995,12 +995,12 @@ xfs_da3_join(
995 error = xfs_da3_blk_unlink(state, drop_blk, save_blk); 995 error = xfs_da3_blk_unlink(state, drop_blk, save_blk);
996 xfs_da_state_kill_altpath(state); 996 xfs_da_state_kill_altpath(state);
997 if (error) 997 if (error)
998 return(error); 998 return error;
999 error = xfs_da_shrink_inode(state->args, drop_blk->blkno, 999 error = xfs_da_shrink_inode(state->args, drop_blk->blkno,
1000 drop_blk->bp); 1000 drop_blk->bp);
1001 drop_blk->bp = NULL; 1001 drop_blk->bp = NULL;
1002 if (error) 1002 if (error)
1003 return(error); 1003 return error;
1004 } 1004 }
1005 /* 1005 /*
1006 * We joined all the way to the top. If it turns out that 1006 * We joined all the way to the top. If it turns out that
@@ -1010,7 +1010,7 @@ xfs_da3_join(
1010 xfs_da3_node_remove(state, drop_blk); 1010 xfs_da3_node_remove(state, drop_blk);
1011 xfs_da3_fixhashpath(state, &state->path); 1011 xfs_da3_fixhashpath(state, &state->path);
1012 error = xfs_da3_root_join(state, &state->path.blk[0]); 1012 error = xfs_da3_root_join(state, &state->path.blk[0]);
1013 return(error); 1013 return error;
1014} 1014}
1015 1015
1016#ifdef DEBUG 1016#ifdef DEBUG
@@ -1099,7 +1099,7 @@ xfs_da3_root_join(
1099 xfs_trans_log_buf(args->trans, root_blk->bp, 0, 1099 xfs_trans_log_buf(args->trans, root_blk->bp, 0,
1100 args->geo->blksize - 1); 1100 args->geo->blksize - 1);
1101 error = xfs_da_shrink_inode(args, child, bp); 1101 error = xfs_da_shrink_inode(args, child, bp);
1102 return(error); 1102 return error;
1103} 1103}
1104 1104
1105/* 1105/*
@@ -1142,7 +1142,7 @@ xfs_da3_node_toosmall(
1142 dp->d_ops->node_hdr_from_disk(&nodehdr, node); 1142 dp->d_ops->node_hdr_from_disk(&nodehdr, node);
1143 if (nodehdr.count > (state->args->geo->node_ents >> 1)) { 1143 if (nodehdr.count > (state->args->geo->node_ents >> 1)) {
1144 *action = 0; /* blk over 50%, don't try to join */ 1144 *action = 0; /* blk over 50%, don't try to join */
1145 return(0); /* blk over 50%, don't try to join */ 1145 return 0; /* blk over 50%, don't try to join */
1146 } 1146 }
1147 1147
1148 /* 1148 /*
@@ -1161,13 +1161,13 @@ xfs_da3_node_toosmall(
1161 error = xfs_da3_path_shift(state, &state->altpath, forward, 1161 error = xfs_da3_path_shift(state, &state->altpath, forward,
1162 0, &retval); 1162 0, &retval);
1163 if (error) 1163 if (error)
1164 return(error); 1164 return error;
1165 if (retval) { 1165 if (retval) {
1166 *action = 0; 1166 *action = 0;
1167 } else { 1167 } else {
1168 *action = 2; 1168 *action = 2;
1169 } 1169 }
1170 return(0); 1170 return 0;
1171 } 1171 }
1172 1172
1173 /* 1173 /*
@@ -1194,7 +1194,7 @@ xfs_da3_node_toosmall(
1194 error = xfs_da3_node_read(state->args->trans, dp, 1194 error = xfs_da3_node_read(state->args->trans, dp,
1195 blkno, -1, &bp, state->args->whichfork); 1195 blkno, -1, &bp, state->args->whichfork);
1196 if (error) 1196 if (error)
1197 return(error); 1197 return error;
1198 1198
1199 node = bp->b_addr; 1199 node = bp->b_addr;
1200 dp->d_ops->node_hdr_from_disk(&thdr, node); 1200 dp->d_ops->node_hdr_from_disk(&thdr, node);
@@ -1486,7 +1486,7 @@ xfs_da3_node_lookup_int(
1486 if (error) { 1486 if (error) {
1487 blk->blkno = 0; 1487 blk->blkno = 0;
1488 state->path.active--; 1488 state->path.active--;
1489 return(error); 1489 return error;
1490 } 1490 }
1491 curr = blk->bp->b_addr; 1491 curr = blk->bp->b_addr;
1492 blk->magic = be16_to_cpu(curr->magic); 1492 blk->magic = be16_to_cpu(curr->magic);
@@ -1586,7 +1586,7 @@ xfs_da3_node_lookup_int(
1586 error = xfs_da3_path_shift(state, &state->path, 1, 1, 1586 error = xfs_da3_path_shift(state, &state->path, 1, 1,
1587 &retval); 1587 &retval);
1588 if (error) 1588 if (error)
1589 return(error); 1589 return error;
1590 if (retval == 0) { 1590 if (retval == 0) {
1591 continue; 1591 continue;
1592 } else if (blk->magic == XFS_ATTR_LEAF_MAGIC) { 1592 } else if (blk->magic == XFS_ATTR_LEAF_MAGIC) {
@@ -1597,7 +1597,7 @@ xfs_da3_node_lookup_int(
1597 break; 1597 break;
1598 } 1598 }
1599 *result = retval; 1599 *result = retval;
1600 return(0); 1600 return 0;
1601} 1601}
1602 1602
1603/*======================================================================== 1603/*========================================================================
@@ -1692,7 +1692,7 @@ xfs_da3_blk_link(
1692 be32_to_cpu(old_info->back), 1692 be32_to_cpu(old_info->back),
1693 -1, &bp, args->whichfork); 1693 -1, &bp, args->whichfork);
1694 if (error) 1694 if (error)
1695 return(error); 1695 return error;
1696 ASSERT(bp != NULL); 1696 ASSERT(bp != NULL);
1697 tmp_info = bp->b_addr; 1697 tmp_info = bp->b_addr;
1698 ASSERT(tmp_info->magic == old_info->magic); 1698 ASSERT(tmp_info->magic == old_info->magic);
@@ -1713,7 +1713,7 @@ xfs_da3_blk_link(
1713 be32_to_cpu(old_info->forw), 1713 be32_to_cpu(old_info->forw),
1714 -1, &bp, args->whichfork); 1714 -1, &bp, args->whichfork);
1715 if (error) 1715 if (error)
1716 return(error); 1716 return error;
1717 ASSERT(bp != NULL); 1717 ASSERT(bp != NULL);
1718 tmp_info = bp->b_addr; 1718 tmp_info = bp->b_addr;
1719 ASSERT(tmp_info->magic == old_info->magic); 1719 ASSERT(tmp_info->magic == old_info->magic);
@@ -1726,7 +1726,7 @@ xfs_da3_blk_link(
1726 1726
1727 xfs_trans_log_buf(args->trans, old_blk->bp, 0, sizeof(*tmp_info) - 1); 1727 xfs_trans_log_buf(args->trans, old_blk->bp, 0, sizeof(*tmp_info) - 1);
1728 xfs_trans_log_buf(args->trans, new_blk->bp, 0, sizeof(*tmp_info) - 1); 1728 xfs_trans_log_buf(args->trans, new_blk->bp, 0, sizeof(*tmp_info) - 1);
1729 return(0); 1729 return 0;
1730} 1730}
1731 1731
1732/* 1732/*
@@ -1772,7 +1772,7 @@ xfs_da3_blk_unlink(
1772 be32_to_cpu(drop_info->back), 1772 be32_to_cpu(drop_info->back),
1773 -1, &bp, args->whichfork); 1773 -1, &bp, args->whichfork);
1774 if (error) 1774 if (error)
1775 return(error); 1775 return error;
1776 ASSERT(bp != NULL); 1776 ASSERT(bp != NULL);
1777 tmp_info = bp->b_addr; 1777 tmp_info = bp->b_addr;
1778 ASSERT(tmp_info->magic == save_info->magic); 1778 ASSERT(tmp_info->magic == save_info->magic);
@@ -1789,7 +1789,7 @@ xfs_da3_blk_unlink(
1789 be32_to_cpu(drop_info->forw), 1789 be32_to_cpu(drop_info->forw),
1790 -1, &bp, args->whichfork); 1790 -1, &bp, args->whichfork);
1791 if (error) 1791 if (error)
1792 return(error); 1792 return error;
1793 ASSERT(bp != NULL); 1793 ASSERT(bp != NULL);
1794 tmp_info = bp->b_addr; 1794 tmp_info = bp->b_addr;
1795 ASSERT(tmp_info->magic == save_info->magic); 1795 ASSERT(tmp_info->magic == save_info->magic);
@@ -1801,7 +1801,7 @@ xfs_da3_blk_unlink(
1801 } 1801 }
1802 1802
1803 xfs_trans_log_buf(args->trans, save_blk->bp, 0, sizeof(*save_info) - 1); 1803 xfs_trans_log_buf(args->trans, save_blk->bp, 0, sizeof(*save_info) - 1);
1804 return(0); 1804 return 0;
1805} 1805}
1806 1806
1807/* 1807/*
@@ -1861,7 +1861,7 @@ xfs_da3_path_shift(
1861 if (level < 0) { 1861 if (level < 0) {
1862 *result = XFS_ERROR(ENOENT); /* we're out of our tree */ 1862 *result = XFS_ERROR(ENOENT); /* we're out of our tree */
1863 ASSERT(args->op_flags & XFS_DA_OP_OKNOENT); 1863 ASSERT(args->op_flags & XFS_DA_OP_OKNOENT);
1864 return(0); 1864 return 0;
1865 } 1865 }
1866 1866
1867 /* 1867 /*
@@ -1883,7 +1883,7 @@ xfs_da3_path_shift(
1883 error = xfs_da3_node_read(args->trans, dp, blkno, -1, 1883 error = xfs_da3_node_read(args->trans, dp, blkno, -1,
1884 &blk->bp, args->whichfork); 1884 &blk->bp, args->whichfork);
1885 if (error) 1885 if (error)
1886 return(error); 1886 return error;
1887 info = blk->bp->b_addr; 1887 info = blk->bp->b_addr;
1888 ASSERT(info->magic == cpu_to_be16(XFS_DA_NODE_MAGIC) || 1888 ASSERT(info->magic == cpu_to_be16(XFS_DA_NODE_MAGIC) ||
1889 info->magic == cpu_to_be16(XFS_DA3_NODE_MAGIC) || 1889 info->magic == cpu_to_be16(XFS_DA3_NODE_MAGIC) ||
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 3ee0cd43edc0..9dc5d3954cf7 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -327,7 +327,7 @@ xfs_qm_dqalloc(
327 */ 327 */
328 if (!xfs_this_quota_on(dqp->q_mount, dqp->dq_flags)) { 328 if (!xfs_this_quota_on(dqp->q_mount, dqp->dq_flags)) {
329 xfs_iunlock(quotip, XFS_ILOCK_EXCL); 329 xfs_iunlock(quotip, XFS_ILOCK_EXCL);
330 return (ESRCH); 330 return ESRCH;
331 } 331 }
332 332
333 xfs_trans_ijoin(tp, quotip, XFS_ILOCK_EXCL); 333 xfs_trans_ijoin(tp, quotip, XFS_ILOCK_EXCL);
@@ -400,7 +400,7 @@ xfs_qm_dqalloc(
400 error0: 400 error0:
401 xfs_iunlock(quotip, XFS_ILOCK_EXCL); 401 xfs_iunlock(quotip, XFS_ILOCK_EXCL);
402 402
403 return (error); 403 return error;
404} 404}
405 405
406STATIC int 406STATIC int
@@ -547,7 +547,7 @@ xfs_qm_dqtobp(
547 *O_bpp = bp; 547 *O_bpp = bp;
548 *O_ddpp = bp->b_addr + dqp->q_bufoffset; 548 *O_ddpp = bp->b_addr + dqp->q_bufoffset;
549 549
550 return (0); 550 return 0;
551} 551}
552 552
553 553
@@ -715,7 +715,7 @@ xfs_qm_dqget(
715 if ((! XFS_IS_UQUOTA_ON(mp) && type == XFS_DQ_USER) || 715 if ((! XFS_IS_UQUOTA_ON(mp) && type == XFS_DQ_USER) ||
716 (! XFS_IS_PQUOTA_ON(mp) && type == XFS_DQ_PROJ) || 716 (! XFS_IS_PQUOTA_ON(mp) && type == XFS_DQ_PROJ) ||
717 (! XFS_IS_GQUOTA_ON(mp) && type == XFS_DQ_GROUP)) { 717 (! XFS_IS_GQUOTA_ON(mp) && type == XFS_DQ_GROUP)) {
718 return (ESRCH); 718 return ESRCH;
719 } 719 }
720 720
721#ifdef DEBUG 721#ifdef DEBUG
@@ -723,7 +723,7 @@ xfs_qm_dqget(
723 if ((xfs_dqerror_target == mp->m_ddev_targp) && 723 if ((xfs_dqerror_target == mp->m_ddev_targp) &&
724 (xfs_dqreq_num++ % xfs_dqerror_mod) == 0) { 724 (xfs_dqreq_num++ % xfs_dqerror_mod) == 0) {
725 xfs_debug(mp, "Returning error in dqget"); 725 xfs_debug(mp, "Returning error in dqget");
726 return (EIO); 726 return EIO;
727 } 727 }
728 } 728 }
729 729
@@ -829,7 +829,7 @@ restart:
829 ASSERT((ip == NULL) || xfs_isilocked(ip, XFS_ILOCK_EXCL)); 829 ASSERT((ip == NULL) || xfs_isilocked(ip, XFS_ILOCK_EXCL));
830 trace_xfs_dqget_miss(dqp); 830 trace_xfs_dqget_miss(dqp);
831 *O_dqpp = dqp; 831 *O_dqpp = dqp;
832 return (0); 832 return 0;
833} 833}
834 834
835/* 835/*
diff --git a/fs/xfs/xfs_inode_fork.c b/fs/xfs/xfs_inode_fork.c
index b031e8d0d928..5fc5495400bb 100644
--- a/fs/xfs/xfs_inode_fork.c
+++ b/fs/xfs/xfs_inode_fork.c
@@ -1692,7 +1692,7 @@ xfs_iext_idx_to_irec(
1692 } 1692 }
1693 *idxp = page_idx; 1693 *idxp = page_idx;
1694 *erp_idxp = erp_idx; 1694 *erp_idxp = erp_idx;
1695 return(erp); 1695 return erp;
1696} 1696}
1697 1697
1698/* 1698/*
diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h
index 825249d2dfc1..f59b966bf903 100644
--- a/fs/xfs/xfs_linux.h
+++ b/fs/xfs/xfs_linux.h
@@ -331,7 +331,7 @@ static inline __uint64_t roundup_64(__uint64_t x, __uint32_t y)
331{ 331{
332 x += y - 1; 332 x += y - 1;
333 do_div(x, y); 333 do_div(x, y);
334 return(x * y); 334 return x * y;
335} 335}
336 336
337static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y) 337static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y)
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 981af0f6504b..4c60f118595b 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2946,7 +2946,7 @@ xlog_recover_quotaoff_pass1(
2946 if (qoff_f->qf_flags & XFS_GQUOTA_ACCT) 2946 if (qoff_f->qf_flags & XFS_GQUOTA_ACCT)
2947 log->l_quotaoffs_flag |= XFS_DQ_GROUP; 2947 log->l_quotaoffs_flag |= XFS_DQ_GROUP;
2948 2948
2949 return (0); 2949 return 0;
2950} 2950}
2951 2951
2952/* 2952/*
@@ -2971,7 +2971,7 @@ xlog_recover_dquot_pass2(
2971 * Filesystems are required to send in quota flags at mount time. 2971 * Filesystems are required to send in quota flags at mount time.
2972 */ 2972 */
2973 if (mp->m_qflags == 0) 2973 if (mp->m_qflags == 0)
2974 return (0); 2974 return 0;
2975 2975
2976 recddq = item->ri_buf[1].i_addr; 2976 recddq = item->ri_buf[1].i_addr;
2977 if (recddq == NULL) { 2977 if (recddq == NULL) {
@@ -2990,7 +2990,7 @@ xlog_recover_dquot_pass2(
2990 type = recddq->d_flags & (XFS_DQ_USER | XFS_DQ_PROJ | XFS_DQ_GROUP); 2990 type = recddq->d_flags & (XFS_DQ_USER | XFS_DQ_PROJ | XFS_DQ_GROUP);
2991 ASSERT(type); 2991 ASSERT(type);
2992 if (log->l_quotaoffs_flag & type) 2992 if (log->l_quotaoffs_flag & type)
2993 return (0); 2993 return 0;
2994 2994
2995 /* 2995 /*
2996 * At this point we know that quota was _not_ turned off. 2996 * At this point we know that quota was _not_ turned off.
@@ -3560,7 +3560,7 @@ xlog_recover_process_data(
3560 3560
3561 /* check the log format matches our own - else we can't recover */ 3561 /* check the log format matches our own - else we can't recover */
3562 if (xlog_header_check_recover(log->l_mp, rhead)) 3562 if (xlog_header_check_recover(log->l_mp, rhead))
3563 return (XFS_ERROR(EIO)); 3563 return XFS_ERROR(EIO);
3564 3564
3565 while ((dp < lp) && num_logops) { 3565 while ((dp < lp) && num_logops) {
3566 ASSERT(dp + sizeof(xlog_op_header_t) <= lp); 3566 ASSERT(dp + sizeof(xlog_op_header_t) <= lp);
@@ -3571,7 +3571,7 @@ xlog_recover_process_data(
3571 xfs_warn(log->l_mp, "%s: bad clientid 0x%x", 3571 xfs_warn(log->l_mp, "%s: bad clientid 0x%x",
3572 __func__, ohead->oh_clientid); 3572 __func__, ohead->oh_clientid);
3573 ASSERT(0); 3573 ASSERT(0);
3574 return (XFS_ERROR(EIO)); 3574 return XFS_ERROR(EIO);
3575 } 3575 }
3576 tid = be32_to_cpu(ohead->oh_tid); 3576 tid = be32_to_cpu(ohead->oh_tid);
3577 hash = XLOG_RHASH(tid); 3577 hash = XLOG_RHASH(tid);
@@ -3585,7 +3585,7 @@ xlog_recover_process_data(
3585 xfs_warn(log->l_mp, "%s: bad length 0x%x", 3585 xfs_warn(log->l_mp, "%s: bad length 0x%x",
3586 __func__, be32_to_cpu(ohead->oh_len)); 3586 __func__, be32_to_cpu(ohead->oh_len));
3587 WARN_ON(1); 3587 WARN_ON(1);
3588 return (XFS_ERROR(EIO)); 3588 return XFS_ERROR(EIO);
3589 } 3589 }
3590 flags = ohead->oh_flags & ~XLOG_END_TRANS; 3590 flags = ohead->oh_flags & ~XLOG_END_TRANS;
3591 if (flags & XLOG_WAS_CONT_TRANS) 3591 if (flags & XLOG_WAS_CONT_TRANS)
@@ -4388,7 +4388,7 @@ xlog_do_recover(
4388 * If IO errors happened during recovery, bail out. 4388 * If IO errors happened during recovery, bail out.
4389 */ 4389 */
4390 if (XFS_FORCED_SHUTDOWN(log->l_mp)) { 4390 if (XFS_FORCED_SHUTDOWN(log->l_mp)) {
4391 return (EIO); 4391 return EIO;
4392 } 4392 }
4393 4393
4394 /* 4394 /*
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 6d26759c779a..882440ff964f 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -1463,7 +1463,7 @@ xfs_qm_quotacheck(
1463 } 1463 }
1464 } else 1464 } else
1465 xfs_notice(mp, "Quotacheck: Done."); 1465 xfs_notice(mp, "Quotacheck: Done.");
1466 return (error); 1466 return error;
1467} 1467}
1468 1468
1469/* 1469/*
@@ -1895,7 +1895,7 @@ xfs_qm_vop_chown_reserve(
1895 -((xfs_qcnt_t)delblks), 0, blkflags); 1895 -((xfs_qcnt_t)delblks), 0, blkflags);
1896 } 1896 }
1897 1897
1898 return (0); 1898 return 0;
1899} 1899}
1900 1900
1901int 1901int
diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index bbc813caba4c..e6c26d564b17 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -94,7 +94,7 @@ xfs_qm_scall_quotaoff(
94 94
95 /* XXX what to do if error ? Revert back to old vals incore ? */ 95 /* XXX what to do if error ? Revert back to old vals incore ? */
96 error = xfs_qm_write_sb_changes(mp, XFS_SB_QFLAGS); 96 error = xfs_qm_write_sb_changes(mp, XFS_SB_QFLAGS);
97 return (error); 97 return error;
98 } 98 }
99 99
100 dqtype = 0; 100 dqtype = 0;
@@ -198,7 +198,7 @@ xfs_qm_scall_quotaoff(
198 if (mp->m_qflags == 0) { 198 if (mp->m_qflags == 0) {
199 mutex_unlock(&q->qi_quotaofflock); 199 mutex_unlock(&q->qi_quotaofflock);
200 xfs_qm_destroy_quotainfo(mp); 200 xfs_qm_destroy_quotainfo(mp);
201 return (0); 201 return 0;
202 } 202 }
203 203
204 /* 204 /*
@@ -376,7 +376,7 @@ xfs_qm_scall_quotaon(
376 sbflags |= XFS_SB_QFLAGS; 376 sbflags |= XFS_SB_QFLAGS;
377 377
378 if ((error = xfs_qm_write_sb_changes(mp, sbflags))) 378 if ((error = xfs_qm_write_sb_changes(mp, sbflags)))
379 return (error); 379 return error;
380 /* 380 /*
381 * If we aren't trying to switch on quota enforcement, we are done. 381 * If we aren't trying to switch on quota enforcement, we are done.
382 */ 382 */
@@ -387,7 +387,7 @@ xfs_qm_scall_quotaon(
387 ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) != 387 ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) !=
388 (mp->m_qflags & XFS_GQUOTA_ACCT)) || 388 (mp->m_qflags & XFS_GQUOTA_ACCT)) ||
389 (flags & XFS_ALL_QUOTA_ENFD) == 0) 389 (flags & XFS_ALL_QUOTA_ENFD) == 0)
390 return (0); 390 return 0;
391 391
392 if (! XFS_IS_QUOTA_RUNNING(mp)) 392 if (! XFS_IS_QUOTA_RUNNING(mp))
393 return XFS_ERROR(ESRCH); 393 return XFS_ERROR(ESRCH);
@@ -399,7 +399,7 @@ xfs_qm_scall_quotaon(
399 mp->m_qflags |= (flags & XFS_ALL_QUOTA_ENFD); 399 mp->m_qflags |= (flags & XFS_ALL_QUOTA_ENFD);
400 mutex_unlock(&mp->m_quotainfo->qi_quotaofflock); 400 mutex_unlock(&mp->m_quotainfo->qi_quotaofflock);
401 401
402 return (0); 402 return 0;
403} 403}
404 404
405 405
@@ -426,7 +426,7 @@ xfs_qm_scall_getqstat(
426 if (!xfs_sb_version_hasquota(&mp->m_sb)) { 426 if (!xfs_sb_version_hasquota(&mp->m_sb)) {
427 out->qs_uquota.qfs_ino = NULLFSINO; 427 out->qs_uquota.qfs_ino = NULLFSINO;
428 out->qs_gquota.qfs_ino = NULLFSINO; 428 out->qs_gquota.qfs_ino = NULLFSINO;
429 return (0); 429 return 0;
430 } 430 }
431 431
432 out->qs_flags = (__uint16_t) xfs_qm_export_flags(mp->m_qflags & 432 out->qs_flags = (__uint16_t) xfs_qm_export_flags(mp->m_qflags &
@@ -514,7 +514,7 @@ xfs_qm_scall_getqstatv(
514 out->qs_uquota.qfs_ino = NULLFSINO; 514 out->qs_uquota.qfs_ino = NULLFSINO;
515 out->qs_gquota.qfs_ino = NULLFSINO; 515 out->qs_gquota.qfs_ino = NULLFSINO;
516 out->qs_pquota.qfs_ino = NULLFSINO; 516 out->qs_pquota.qfs_ino = NULLFSINO;
517 return (0); 517 return 0;
518 } 518 }
519 519
520 out->qs_flags = (__uint16_t) xfs_qm_export_flags(mp->m_qflags & 520 out->qs_flags = (__uint16_t) xfs_qm_export_flags(mp->m_qflags &
@@ -758,7 +758,7 @@ xfs_qm_log_quotaoff_end(
758 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_equotaoff, 0, 0); 758 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_equotaoff, 0, 0);
759 if (error) { 759 if (error) {
760 xfs_trans_cancel(tp, 0); 760 xfs_trans_cancel(tp, 0);
761 return (error); 761 return error;
762 } 762 }
763 763
764 qoffi = xfs_trans_get_qoff_item(tp, startqoff, 764 qoffi = xfs_trans_get_qoff_item(tp, startqoff,
@@ -772,7 +772,7 @@ xfs_qm_log_quotaoff_end(
772 */ 772 */
773 xfs_trans_set_sync(tp); 773 xfs_trans_set_sync(tp);
774 error = xfs_trans_commit(tp, 0); 774 error = xfs_trans_commit(tp, 0);
775 return (error); 775 return error;
776} 776}
777 777
778 778
@@ -822,7 +822,7 @@ error0:
822 spin_unlock(&mp->m_sb_lock); 822 spin_unlock(&mp->m_sb_lock);
823 } 823 }
824 *qoffstartp = qoffi; 824 *qoffstartp = qoffi;
825 return (error); 825 return error;
826} 826}
827 827
828 828
@@ -953,7 +953,7 @@ xfs_qm_export_flags(
953 uflags |= FS_QUOTA_GDQ_ENFD; 953 uflags |= FS_QUOTA_GDQ_ENFD;
954 if (flags & XFS_PQUOTA_ENFD) 954 if (flags & XFS_PQUOTA_ENFD)
955 uflags |= FS_QUOTA_PDQ_ENFD; 955 uflags |= FS_QUOTA_PDQ_ENFD;
956 return (uflags); 956 return uflags;
957} 957}
958 958
959 959
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index d03932564ccb..e15fe67baa7b 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -190,7 +190,7 @@ xfs_trans_reserve(
190 -((int64_t)blocks), rsvd); 190 -((int64_t)blocks), rsvd);
191 if (error != 0) { 191 if (error != 0) {
192 current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS); 192 current_restore_flags_nested(&tp->t_pflags, PF_FSTRANS);
193 return (XFS_ERROR(ENOSPC)); 193 return XFS_ERROR(ENOSPC);
194 } 194 }
195 tp->t_blk_res += blocks; 195 tp->t_blk_res += blocks;
196 } 196 }
@@ -1024,7 +1024,7 @@ xfs_trans_roll(
1024 */ 1024 */
1025 error = xfs_trans_commit(trans, 0); 1025 error = xfs_trans_commit(trans, 0);
1026 if (error) 1026 if (error)
1027 return (error); 1027 return error;
1028 1028
1029 trans = *tpp; 1029 trans = *tpp;
1030 1030
diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c
index b8eef0549f3f..fe41e8efbe96 100644
--- a/fs/xfs/xfs_trans_buf.c
+++ b/fs/xfs/xfs_trans_buf.c
@@ -166,7 +166,7 @@ xfs_trans_get_buf_map(
166 ASSERT(atomic_read(&bip->bli_refcount) > 0); 166 ASSERT(atomic_read(&bip->bli_refcount) > 0);
167 bip->bli_recur++; 167 bip->bli_recur++;
168 trace_xfs_trans_get_buf_recur(bip); 168 trace_xfs_trans_get_buf_recur(bip);
169 return (bp); 169 return bp;
170 } 170 }
171 171
172 bp = xfs_buf_get_map(target, map, nmaps, flags); 172 bp = xfs_buf_get_map(target, map, nmaps, flags);
@@ -178,7 +178,7 @@ xfs_trans_get_buf_map(
178 178
179 _xfs_trans_bjoin(tp, bp, 1); 179 _xfs_trans_bjoin(tp, bp, 1);
180 trace_xfs_trans_get_buf(bp->b_fspriv); 180 trace_xfs_trans_get_buf(bp->b_fspriv);
181 return (bp); 181 return bp;
182} 182}
183 183
184/* 184/*
@@ -201,9 +201,8 @@ xfs_trans_getsb(xfs_trans_t *tp,
201 * Default to just trying to lock the superblock buffer 201 * Default to just trying to lock the superblock buffer
202 * if tp is NULL. 202 * if tp is NULL.
203 */ 203 */
204 if (tp == NULL) { 204 if (tp == NULL)
205 return (xfs_getsb(mp, flags)); 205 return xfs_getsb(mp, flags);
206 }
207 206
208 /* 207 /*
209 * If the superblock buffer already has this transaction 208 * If the superblock buffer already has this transaction
@@ -218,7 +217,7 @@ xfs_trans_getsb(xfs_trans_t *tp,
218 ASSERT(atomic_read(&bip->bli_refcount) > 0); 217 ASSERT(atomic_read(&bip->bli_refcount) > 0);
219 bip->bli_recur++; 218 bip->bli_recur++;
220 trace_xfs_trans_getsb_recur(bip); 219 trace_xfs_trans_getsb_recur(bip);
221 return (bp); 220 return bp;
222 } 221 }
223 222
224 bp = xfs_getsb(mp, flags); 223 bp = xfs_getsb(mp, flags);
@@ -227,7 +226,7 @@ xfs_trans_getsb(xfs_trans_t *tp,
227 226
228 _xfs_trans_bjoin(tp, bp, 1); 227 _xfs_trans_bjoin(tp, bp, 1);
229 trace_xfs_trans_getsb(bp->b_fspriv); 228 trace_xfs_trans_getsb(bp->b_fspriv);
230 return (bp); 229 return bp;
231} 230}
232 231
233#ifdef DEBUG 232#ifdef DEBUG