diff mbox

[12/13] xfs: rename on-disk dquot counter zap functions

Message ID 152506707010.21553.15727146910203332609.stgit@magnolia (mailing list archive)
State Accepted
Headers show

Commit Message

Darrick J. Wong April 30, 2018, 5:44 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

The function 'xfs_qm_dqiterate' doesn't iterate dquots at all, it
iterates all dquot blocks of a quota inode and clears the counters.
Therefore, change the name to something more descriptive so that we can
introduce a real dquot iterator later.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_qm.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Brian Foster May 1, 2018, 1:45 p.m. UTC | #1
On Sun, Apr 29, 2018 at 10:44:30PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> The function 'xfs_qm_dqiterate' doesn't iterate dquots at all, it
> iterates all dquot blocks of a quota inode and clears the counters.
> Therefore, change the name to something more descriptive so that we can
> introduce a real dquot iterator later.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_qm.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
> index c6b1e9bd7a3e..fcbbae70748a 100644
> --- a/fs/xfs/xfs_qm.c
> +++ b/fs/xfs/xfs_qm.c
> @@ -889,7 +889,7 @@ xfs_qm_reset_dqcounts(
>  }
>  
>  STATIC int
> -xfs_qm_dqiter_bufs(
> +xfs_qm_reset_dqcounts_all(
>  	struct xfs_mount	*mp,
>  	xfs_dqid_t		firstid,
>  	xfs_fsblock_t		bno,
> @@ -957,11 +957,11 @@ xfs_qm_dqiter_bufs(
>  }
>  
>  /*
> - * Iterate over all allocated USR/GRP/PRJ dquots in the system, calling a
> - * caller supplied function for every chunk of dquots that we find.
> + * Iterate over all allocated dquot blocks in this quota inode, zeroing all
> + * counters for every chunk of dquots that we find.
>   */
>  STATIC int
> -xfs_qm_dqiterate(
> +xfs_qm_reset_dqcounts_buf(
>  	struct xfs_mount	*mp,
>  	struct xfs_inode	*qip,
>  	uint			flags,
> @@ -1037,7 +1037,7 @@ xfs_qm_dqiterate(
>  			 * Iterate thru all the blks in the extent and
>  			 * reset the counters of all the dquots inside them.
>  			 */
> -			error = xfs_qm_dqiter_bufs(mp, firstid,
> +			error = xfs_qm_reset_dqcounts_all(mp, firstid,
>  						   map[i].br_startblock,
>  						   map[i].br_blockcount,
>  						   flags, buffer_list);
> @@ -1299,7 +1299,7 @@ xfs_qm_quotacheck(
>  	 * We don't log our changes till later.
>  	 */
>  	if (uip) {
> -		error = xfs_qm_dqiterate(mp, uip, XFS_QMOPT_UQUOTA,
> +		error = xfs_qm_reset_dqcounts_buf(mp, uip, XFS_QMOPT_UQUOTA,
>  					 &buffer_list);
>  		if (error)
>  			goto error_return;
> @@ -1307,7 +1307,7 @@ xfs_qm_quotacheck(
>  	}
>  
>  	if (gip) {
> -		error = xfs_qm_dqiterate(mp, gip, XFS_QMOPT_GQUOTA,
> +		error = xfs_qm_reset_dqcounts_buf(mp, gip, XFS_QMOPT_GQUOTA,
>  					 &buffer_list);
>  		if (error)
>  			goto error_return;
> @@ -1315,7 +1315,7 @@ xfs_qm_quotacheck(
>  	}
>  
>  	if (pip) {
> -		error = xfs_qm_dqiterate(mp, pip, XFS_QMOPT_PQUOTA,
> +		error = xfs_qm_reset_dqcounts_buf(mp, pip, XFS_QMOPT_PQUOTA,
>  					 &buffer_list);
>  		if (error)
>  			goto error_return;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoph Hellwig May 2, 2018, 4:35 p.m. UTC | #2
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index c6b1e9bd7a3e..fcbbae70748a 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -889,7 +889,7 @@  xfs_qm_reset_dqcounts(
 }
 
 STATIC int
-xfs_qm_dqiter_bufs(
+xfs_qm_reset_dqcounts_all(
 	struct xfs_mount	*mp,
 	xfs_dqid_t		firstid,
 	xfs_fsblock_t		bno,
@@ -957,11 +957,11 @@  xfs_qm_dqiter_bufs(
 }
 
 /*
- * Iterate over all allocated USR/GRP/PRJ dquots in the system, calling a
- * caller supplied function for every chunk of dquots that we find.
+ * Iterate over all allocated dquot blocks in this quota inode, zeroing all
+ * counters for every chunk of dquots that we find.
  */
 STATIC int
-xfs_qm_dqiterate(
+xfs_qm_reset_dqcounts_buf(
 	struct xfs_mount	*mp,
 	struct xfs_inode	*qip,
 	uint			flags,
@@ -1037,7 +1037,7 @@  xfs_qm_dqiterate(
 			 * Iterate thru all the blks in the extent and
 			 * reset the counters of all the dquots inside them.
 			 */
-			error = xfs_qm_dqiter_bufs(mp, firstid,
+			error = xfs_qm_reset_dqcounts_all(mp, firstid,
 						   map[i].br_startblock,
 						   map[i].br_blockcount,
 						   flags, buffer_list);
@@ -1299,7 +1299,7 @@  xfs_qm_quotacheck(
 	 * We don't log our changes till later.
 	 */
 	if (uip) {
-		error = xfs_qm_dqiterate(mp, uip, XFS_QMOPT_UQUOTA,
+		error = xfs_qm_reset_dqcounts_buf(mp, uip, XFS_QMOPT_UQUOTA,
 					 &buffer_list);
 		if (error)
 			goto error_return;
@@ -1307,7 +1307,7 @@  xfs_qm_quotacheck(
 	}
 
 	if (gip) {
-		error = xfs_qm_dqiterate(mp, gip, XFS_QMOPT_GQUOTA,
+		error = xfs_qm_reset_dqcounts_buf(mp, gip, XFS_QMOPT_GQUOTA,
 					 &buffer_list);
 		if (error)
 			goto error_return;
@@ -1315,7 +1315,7 @@  xfs_qm_quotacheck(
 	}
 
 	if (pip) {
-		error = xfs_qm_dqiterate(mp, pip, XFS_QMOPT_PQUOTA,
+		error = xfs_qm_reset_dqcounts_buf(mp, pip, XFS_QMOPT_PQUOTA,
 					 &buffer_list);
 		if (error)
 			goto error_return;