Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xfs: Replace function declaration by actual definition

Signed-off-by: Pavel Reichl <preichl@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: fix typo in subject line]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

authored by

Pavel Reichl and committed by
Darrick J. Wong
1cc95e6f d0bdfb10

+66 -74
+66 -74
fs/xfs/xfs_qm_syscalls.c
··· 19 19 #include "xfs_qm.h" 20 20 #include "xfs_icache.h" 21 21 22 - STATIC int xfs_qm_log_quotaoff(struct xfs_mount *mp, 23 - struct xfs_qoff_logitem **qoffstartp, 24 - uint flags); 25 - STATIC int xfs_qm_log_quotaoff_end(struct xfs_mount *mp, 26 - struct xfs_qoff_logitem *startqoff, 27 - uint flags); 22 + STATIC int 23 + xfs_qm_log_quotaoff( 24 + struct xfs_mount *mp, 25 + struct xfs_qoff_logitem **qoffstartp, 26 + uint flags) 27 + { 28 + struct xfs_trans *tp; 29 + int error; 30 + struct xfs_qoff_logitem *qoffi; 31 + 32 + *qoffstartp = NULL; 33 + 34 + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_quotaoff, 0, 0, 0, &tp); 35 + if (error) 36 + goto out; 37 + 38 + qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT); 39 + xfs_trans_log_quotaoff_item(tp, qoffi); 40 + 41 + spin_lock(&mp->m_sb_lock); 42 + mp->m_sb.sb_qflags = (mp->m_qflags & ~(flags)) & XFS_MOUNT_QUOTA_ALL; 43 + spin_unlock(&mp->m_sb_lock); 44 + 45 + xfs_log_sb(tp); 46 + 47 + /* 48 + * We have to make sure that the transaction is secure on disk before we 49 + * return and actually stop quota accounting. So, make it synchronous. 50 + * We don't care about quotoff's performance. 51 + */ 52 + xfs_trans_set_sync(tp); 53 + error = xfs_trans_commit(tp); 54 + if (error) 55 + goto out; 56 + 57 + *qoffstartp = qoffi; 58 + out: 59 + return error; 60 + } 61 + 62 + STATIC int 63 + xfs_qm_log_quotaoff_end( 64 + struct xfs_mount *mp, 65 + struct xfs_qoff_logitem *startqoff, 66 + uint flags) 67 + { 68 + struct xfs_trans *tp; 69 + int error; 70 + struct xfs_qoff_logitem *qoffi; 71 + 72 + error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_equotaoff, 0, 0, 0, &tp); 73 + if (error) 74 + return error; 75 + 76 + qoffi = xfs_trans_get_qoff_item(tp, startqoff, 77 + flags & XFS_ALL_QUOTA_ACCT); 78 + xfs_trans_log_quotaoff_item(tp, qoffi); 79 + 80 + /* 81 + * We have to make sure that the transaction is secure on disk before we 82 + * return and actually stop quota accounting. So, make it synchronous. 83 + * We don't care about quotoff's performance. 84 + */ 85 + xfs_trans_set_sync(tp); 86 + return xfs_trans_commit(tp); 87 + } 28 88 29 89 /* 30 90 * Turn off quota accounting and/or enforcement for all udquots and/or ··· 598 538 xfs_qm_dqrele(dqp); 599 539 out_unlock: 600 540 mutex_unlock(&q->qi_quotaofflock); 601 - return error; 602 - } 603 - 604 - STATIC int 605 - xfs_qm_log_quotaoff_end( 606 - struct xfs_mount *mp, 607 - struct xfs_qoff_logitem *startqoff, 608 - uint flags) 609 - { 610 - struct xfs_trans *tp; 611 - int error; 612 - struct xfs_qoff_logitem *qoffi; 613 - 614 - error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_equotaoff, 0, 0, 0, &tp); 615 - if (error) 616 - return error; 617 - 618 - qoffi = xfs_trans_get_qoff_item(tp, startqoff, 619 - flags & XFS_ALL_QUOTA_ACCT); 620 - xfs_trans_log_quotaoff_item(tp, qoffi); 621 - 622 - /* 623 - * We have to make sure that the transaction is secure on disk before we 624 - * return and actually stop quota accounting. So, make it synchronous. 625 - * We don't care about quotoff's performance. 626 - */ 627 - xfs_trans_set_sync(tp); 628 - return xfs_trans_commit(tp); 629 - } 630 - 631 - 632 - STATIC int 633 - xfs_qm_log_quotaoff( 634 - struct xfs_mount *mp, 635 - struct xfs_qoff_logitem **qoffstartp, 636 - uint flags) 637 - { 638 - struct xfs_trans *tp; 639 - int error; 640 - struct xfs_qoff_logitem *qoffi; 641 - 642 - *qoffstartp = NULL; 643 - 644 - error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_quotaoff, 0, 0, 0, &tp); 645 - if (error) 646 - goto out; 647 - 648 - qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT); 649 - xfs_trans_log_quotaoff_item(tp, qoffi); 650 - 651 - spin_lock(&mp->m_sb_lock); 652 - mp->m_sb.sb_qflags = (mp->m_qflags & ~(flags)) & XFS_MOUNT_QUOTA_ALL; 653 - spin_unlock(&mp->m_sb_lock); 654 - 655 - xfs_log_sb(tp); 656 - 657 - /* 658 - * We have to make sure that the transaction is secure on disk before we 659 - * return and actually stop quota accounting. So, make it synchronous. 660 - * We don't care about quotoff's performance. 661 - */ 662 - xfs_trans_set_sync(tp); 663 - error = xfs_trans_commit(tp); 664 - if (error) 665 - goto out; 666 - 667 - *qoffstartp = qoffi; 668 - out: 669 541 return error; 670 542 } 671 543