xfs: use generic Posix ACL code
[deliverable/linux.git] / fs / xfs / quota / xfs_qm_bhv.c
index eea2e60b456b6e962bd30872383e9ce07a0bfe31..a5346630dfae05d639a0cee2a24cadbaac057cad 100644 (file)
@@ -20,7 +20,6 @@
 #include "xfs_bit.h"
 #include "xfs_log.h"
 #include "xfs_inum.h"
-#include "xfs_clnt.h"
 #include "xfs_trans.h"
 #include "xfs_sb.h"
 #include "xfs_ag.h"
@@ -43,7 +42,6 @@
 #include "xfs_rtalloc.h"
 #include "xfs_error.h"
 #include "xfs_rw.h"
-#include "xfs_acl.h"
 #include "xfs_attr.h"
 #include "xfs_buf_item.h"
 #include "xfs_qm.h"
@@ -51,7 +49,7 @@
 
 STATIC void
 xfs_fill_statvfs_from_dquot(
-       bhv_statvfs_t           *statp,
+       struct kstatfs          *statp,
        xfs_disk_dquot_t        *dp)
 {
        __uint64_t              limit;
@@ -85,28 +83,21 @@ xfs_fill_statvfs_from_dquot(
  * return a statvfs of the project, not the entire filesystem.
  * This makes such trees appear as if they are filesystems in themselves.
  */
-STATIC void
+void
 xfs_qm_statvfs(
        xfs_inode_t             *ip,
-       bhv_statvfs_t           *statp)
+       struct kstatfs          *statp)
 {
        xfs_mount_t             *mp = ip->i_mount;
        xfs_dquot_t             *dqp;
 
-       if (!(ip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) ||
-           !((mp->m_qflags & (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD))) ==
-                             (XFS_PQUOTA_ACCT|XFS_OQUOTA_ENFD))
-               return;
-
        if (!xfs_qm_dqget(mp, NULL, ip->i_d.di_projid, XFS_DQ_PROJ, 0, &dqp)) {
-               xfs_disk_dquot_t        *dp = &dqp->q_core;
-
-               xfs_fill_statvfs_from_dquot(statp, dp);
+               xfs_fill_statvfs_from_dquot(statp, &dqp->q_core);
                xfs_qm_dqput(dqp);
        }
 }
 
-STATIC int
+int
 xfs_qm_newmount(
        xfs_mount_t     *mp,
        uint            *needquotamount,
@@ -115,9 +106,6 @@ xfs_qm_newmount(
        uint            quotaondisk;
        uint            uquotaondisk = 0, gquotaondisk = 0, pquotaondisk = 0;
 
-       *quotaflags = 0;
-       *needquotamount = B_FALSE;
-
        quotaondisk = xfs_sb_version_hasquota(&mp->m_sb) &&
                                (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_ACCT);
 
@@ -180,67 +168,6 @@ xfs_qm_newmount(
        return 0;
 }
 
-STATIC int
-xfs_qm_endmount(
-       xfs_mount_t     *mp,
-       uint            needquotamount,
-       uint            quotaflags)
-{
-       if (needquotamount) {
-               ASSERT(mp->m_qflags == 0);
-               mp->m_qflags = quotaflags;
-               xfs_qm_mount_quotas(mp);
-       }
-
-#if defined(DEBUG) && defined(XFS_LOUD_RECOVERY)
-       if (! (XFS_IS_QUOTA_ON(mp)))
-               xfs_fs_cmn_err(CE_NOTE, mp, "Disk quotas not turned on");
-       else
-               xfs_fs_cmn_err(CE_NOTE, mp, "Disk quotas turned on");
-#endif
-
-#ifdef QUOTADEBUG
-       if (XFS_IS_QUOTA_ON(mp) && xfs_qm_internalqcheck(mp))
-               cmn_err(CE_WARN, "XFS: mount internalqcheck failed");
-#endif
-
-       return 0;
-}
-
-STATIC void
-xfs_qm_dqrele_null(
-       xfs_dquot_t     *dq)
-{
-       /*
-        * Called from XFS, where we always check first for a NULL dquot.
-        */
-       if (!dq)
-               return;
-       xfs_qm_dqrele(dq);
-}
-
-
-struct xfs_qmops xfs_qmcore_xfs = {
-       .xfs_qminit             = xfs_qm_newmount,
-       .xfs_qmdone             = xfs_qm_unmount_quotadestroy,
-       .xfs_qmmount            = xfs_qm_endmount,
-       .xfs_qmunmount          = xfs_qm_unmount_quotas,
-       .xfs_dqrele             = xfs_qm_dqrele_null,
-       .xfs_dqattach           = xfs_qm_dqattach,
-       .xfs_dqdetach           = xfs_qm_dqdetach,
-       .xfs_dqpurgeall         = xfs_qm_dqpurge_all,
-       .xfs_dqvopalloc         = xfs_qm_vop_dqalloc,
-       .xfs_dqvopcreate        = xfs_qm_vop_dqattach_and_dqmod_newinode,
-       .xfs_dqvoprename        = xfs_qm_vop_rename_dqattach,
-       .xfs_dqvopchown         = xfs_qm_vop_chown,
-       .xfs_dqvopchownresv     = xfs_qm_vop_chown_reserve,
-       .xfs_dqstatvfs          = xfs_qm_statvfs,
-       .xfs_dqsync             = xfs_qm_sync,
-       .xfs_quotactl           = xfs_qm_quotactl,
-       .xfs_dqtrxops           = &xfs_trans_dquot_ops,
-};
-EXPORT_SYMBOL(xfs_qmcore_xfs);
-
 void __init
 xfs_qm_init(void)
 {
This page took 0.026988 seconds and 5 git commands to generate.