Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1e03f16 authored by Pavel Reichl's avatar Pavel Reichl Committed by Greg Kroah-Hartman
Browse files

xfs: Replace function declaration by actual definition



commit 1cc95e6f0d7cfd61c9d3c5cdd4e7345b173f764f upstream.

Signed-off-by: default avatarPavel Reichl <preichl@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
[darrick: fix typo in subject line]
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Acked-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarChandan Babu R <chandan.babu@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fdce40c8
Loading
Loading
Loading
Loading
+66 −74
Original line number Diff line number Diff line
@@ -19,12 +19,72 @@
#include "xfs_qm.h"
#include "xfs_icache.h"

STATIC int xfs_qm_log_quotaoff(struct xfs_mount *mp,
STATIC int
xfs_qm_log_quotaoff(
	struct xfs_mount	*mp,
	struct xfs_qoff_logitem	**qoffstartp,
					uint flags);
STATIC int xfs_qm_log_quotaoff_end(struct xfs_mount *mp,
	uint			flags)
{
	struct xfs_trans	*tp;
	int			error;
	struct xfs_qoff_logitem	*qoffi;

	*qoffstartp = NULL;

	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_quotaoff, 0, 0, 0, &tp);
	if (error)
		goto out;

	qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT);
	xfs_trans_log_quotaoff_item(tp, qoffi);

	spin_lock(&mp->m_sb_lock);
	mp->m_sb.sb_qflags = (mp->m_qflags & ~(flags)) & XFS_MOUNT_QUOTA_ALL;
	spin_unlock(&mp->m_sb_lock);

	xfs_log_sb(tp);

	/*
	 * We have to make sure that the transaction is secure on disk before we
	 * return and actually stop quota accounting. So, make it synchronous.
	 * We don't care about quotoff's performance.
	 */
	xfs_trans_set_sync(tp);
	error = xfs_trans_commit(tp);
	if (error)
		goto out;

	*qoffstartp = qoffi;
out:
	return error;
}

STATIC int
xfs_qm_log_quotaoff_end(
	struct xfs_mount	*mp,
	struct xfs_qoff_logitem	*startqoff,
					uint flags);
	uint			flags)
{
	struct xfs_trans	*tp;
	int			error;
	struct xfs_qoff_logitem	*qoffi;

	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_equotaoff, 0, 0, 0, &tp);
	if (error)
		return error;

	qoffi = xfs_trans_get_qoff_item(tp, startqoff,
					flags & XFS_ALL_QUOTA_ACCT);
	xfs_trans_log_quotaoff_item(tp, qoffi);

	/*
	 * We have to make sure that the transaction is secure on disk before we
	 * return and actually stop quota accounting. So, make it synchronous.
	 * We don't care about quotoff's performance.
	 */
	xfs_trans_set_sync(tp);
	return xfs_trans_commit(tp);
}

/*
 * Turn off quota accounting and/or enforcement for all udquots and/or
@@ -541,74 +601,6 @@ xfs_qm_scall_setqlim(
	return error;
}

STATIC int
xfs_qm_log_quotaoff_end(
	struct xfs_mount	*mp,
	struct xfs_qoff_logitem	*startqoff,
	uint			flags)
{
	struct xfs_trans	*tp;
	int			error;
	struct xfs_qoff_logitem	*qoffi;

	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_equotaoff, 0, 0, 0, &tp);
	if (error)
		return error;

	qoffi = xfs_trans_get_qoff_item(tp, startqoff,
					flags & XFS_ALL_QUOTA_ACCT);
	xfs_trans_log_quotaoff_item(tp, qoffi);

	/*
	 * We have to make sure that the transaction is secure on disk before we
	 * return and actually stop quota accounting. So, make it synchronous.
	 * We don't care about quotoff's performance.
	 */
	xfs_trans_set_sync(tp);
	return xfs_trans_commit(tp);
}


STATIC int
xfs_qm_log_quotaoff(
	struct xfs_mount	*mp,
	struct xfs_qoff_logitem	**qoffstartp,
	uint			flags)
{
	struct xfs_trans	*tp;
	int			error;
	struct xfs_qoff_logitem	*qoffi;

	*qoffstartp = NULL;

	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_quotaoff, 0, 0, 0, &tp);
	if (error)
		goto out;

	qoffi = xfs_trans_get_qoff_item(tp, NULL, flags & XFS_ALL_QUOTA_ACCT);
	xfs_trans_log_quotaoff_item(tp, qoffi);

	spin_lock(&mp->m_sb_lock);
	mp->m_sb.sb_qflags = (mp->m_qflags & ~(flags)) & XFS_MOUNT_QUOTA_ALL;
	spin_unlock(&mp->m_sb_lock);

	xfs_log_sb(tp);

	/*
	 * We have to make sure that the transaction is secure on disk before we
	 * return and actually stop quota accounting. So, make it synchronous.
	 * We don't care about quotoff's performance.
	 */
	xfs_trans_set_sync(tp);
	error = xfs_trans_commit(tp);
	if (error)
		goto out;

	*qoffstartp = qoffi;
out:
	return error;
}

/* Fill out the quota context. */
static void
xfs_qm_scall_getquota_fill_qc(