aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorMasatake YAMATO <yamato@redhat.com>2016-01-04 00:10:42 -0500
committerDave Chinner <david@fromorbit.com>2016-01-04 00:10:42 -0500
commitffc671f1eaa80ee5388693ad78f8332fdea71b80 (patch)
tree6ac29202b2f4b47c663e2403528928384b612449 /fs/xfs
parentf1f96c4946590616812711ac19eb7a84be160877 (diff)
xfs: send warning of project quota to userspace via netlink
Linux's quota subsystem has an ability to handle project quota. This commit just utilizes the ability from xfs side. dbus-monitor and quota_nld shipped as part of quota-tools can be used for testing. See the patch posting on the XFS list for details on testing. Signed-off-by: Masatake YAMATO <yamato@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_trans_dquot.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
index ce78534a047e..995170194df0 100644
--- a/fs/xfs/xfs_trans_dquot.c
+++ b/fs/xfs/xfs_trans_dquot.c
@@ -572,12 +572,16 @@ xfs_quota_warn(
572 struct xfs_dquot *dqp, 572 struct xfs_dquot *dqp,
573 int type) 573 int type)
574{ 574{
575 /* no warnings for project quotas - we just return ENOSPC later */ 575 enum quota_type qtype;
576
576 if (dqp->dq_flags & XFS_DQ_PROJ) 577 if (dqp->dq_flags & XFS_DQ_PROJ)
577 return; 578 qtype = PRJQUOTA;
578 quota_send_warning(make_kqid(&init_user_ns, 579 else if (dqp->dq_flags & XFS_DQ_USER)
579 (dqp->dq_flags & XFS_DQ_USER) ? 580 qtype = USRQUOTA;
580 USRQUOTA : GRPQUOTA, 581 else
582 qtype = GRPQUOTA;
583
584 quota_send_warning(make_kqid(&init_user_ns, qtype,
581 be32_to_cpu(dqp->q_core.d_id)), 585 be32_to_cpu(dqp->q_core.d_id)),
582 mp->m_super->s_dev, type); 586 mp->m_super->s_dev, type);
583} 587}