[v4,5/5] Replace function declartion by actual definition
diff mbox series

Message ID 20191112213310.212925-6-preichl@redhat.com
State Accepted
Headers show
Series
  • xfs: remove several typedefs in quota code
Related show

Commit Message

Pavel Reichl Nov. 12, 2019, 9:33 p.m. UTC
Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 fs/xfs/xfs_qm_syscalls.c | 140 ++++++++++++++++++---------------------
 1 file changed, 66 insertions(+), 74 deletions(-)

Comments

Darrick J. Wong Nov. 13, 2019, 4:43 a.m. UTC | #1
On Tue, Nov 12, 2019 at 10:33:10PM +0100, Pavel Reichl wrote:

The subject line is missing the usual 'xfs:'

OTOH this looks like a simple enough code move that I'll just fix it on
the way in.

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
>  fs/xfs/xfs_qm_syscalls.c | 140 ++++++++++++++++++---------------------
>  1 file changed, 66 insertions(+), 74 deletions(-)
> 
> diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
> index e685b9ae90b9..1ea82764bf89 100644
> --- a/fs/xfs/xfs_qm_syscalls.c
> +++ b/fs/xfs/xfs_qm_syscalls.c
> @@ -19,12 +19,72 @@
>  #include "xfs_qm.h"
>  #include "xfs_icache.h"
>  
> -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,
> -					struct xfs_qoff_logitem *startqoff,
> -					uint flags);
> +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;
> +}
> +
> +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);
> +}
>  
>  /*
>   * 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(
> -- 
> 2.23.0
>
Dave Chinner Nov. 14, 2019, 1:40 a.m. UTC | #2
On Tue, Nov 12, 2019 at 10:33:10PM +0100, Pavel Reichl wrote:
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
>  fs/xfs/xfs_qm_syscalls.c | 140 ++++++++++++++++++---------------------
>  1 file changed, 66 insertions(+), 74 deletions(-)

subject line needs updating but otherwise looks good.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

Patch
diff mbox series

diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
index e685b9ae90b9..1ea82764bf89 100644
--- a/fs/xfs/xfs_qm_syscalls.c
+++ b/fs/xfs/xfs_qm_syscalls.c
@@ -19,12 +19,72 @@ 
 #include "xfs_qm.h"
 #include "xfs_icache.h"
 
-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,
-					struct xfs_qoff_logitem *startqoff,
-					uint flags);
+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;
+}
+
+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);
+}
 
 /*
  * 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(