[08/21] xfs: remove log recovery quotaoff item dispatch for pass2 commit functions
diff mbox series

Message ID 158820770710.467894.3729357655928662895.stgit@magnolia
State Superseded
Headers show
Series
  • xfs: refactor log recovery
Related show

Commit Message

Darrick J. Wong April 30, 2020, 12:48 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Quotaoff doesn't actually do anything, so take advantage of the
commit_pass2_fn pointer being optional and get rid of the switch
statement clause.

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

Comments

Chandan Rajendra May 1, 2020, 3:09 p.m. UTC | #1
On Thursday, April 30, 2020 6:18 AM Darrick J. Wong wrote: 
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Quotaoff doesn't actually do anything, so take advantage of the
> commit_pass2_fn pointer being optional and get rid of the switch
> statement clause.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  fs/xfs/xfs_log_recover.c |    3 ---
>  1 file changed, 3 deletions(-)
> 
> 
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index 6ba3d64d08de..dba38fb99af7 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -2538,9 +2538,6 @@ xlog_recover_commit_pass2(
>  		return xlog_recover_bui_pass2(log, item, trans->r_lsn);
>  	case XFS_LI_BUD:
>  		return xlog_recover_bud_pass2(log, item);
> -	case XFS_LI_QUOTAOFF:
> -		/* nothing to do in pass2 */
> -		return 0;

If there is a XFS_LI_QUOTAOFF item in the log, wouldn't XLOG_RECOVER_PASS2
step end up executing the statements under the "default" case given below?

>  	default:
>  		xfs_warn(log->l_mp, "%s: invalid item type (%d)",
>  			__func__, ITEM_TYPE(item));
> 
>
Darrick J. Wong May 1, 2020, 5:41 p.m. UTC | #2
On Fri, May 01, 2020 at 08:39:21PM +0530, Chandan Rajendra wrote:
> On Thursday, April 30, 2020 6:18 AM Darrick J. Wong wrote: 
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> > 
> > Quotaoff doesn't actually do anything, so take advantage of the
> > commit_pass2_fn pointer being optional and get rid of the switch
> > statement clause.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  fs/xfs/xfs_log_recover.c |    3 ---
> >  1 file changed, 3 deletions(-)
> > 
> > 
> > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> > index 6ba3d64d08de..dba38fb99af7 100644
> > --- a/fs/xfs/xfs_log_recover.c
> > +++ b/fs/xfs/xfs_log_recover.c
> > @@ -2538,9 +2538,6 @@ xlog_recover_commit_pass2(
> >  		return xlog_recover_bui_pass2(log, item, trans->r_lsn);
> >  	case XFS_LI_BUD:
> >  		return xlog_recover_bud_pass2(log, item);
> > -	case XFS_LI_QUOTAOFF:
> > -		/* nothing to do in pass2 */
> > -		return 0;
> 
> If there is a XFS_LI_QUOTAOFF item in the log, wouldn't XLOG_RECOVER_PASS2
> step end up executing the statements under the "default" case given below?

Hmm, good point, this breaks bisectability.  This patch should be the
last of the pass2 conversion patches, and it can take care of removing
all the old function dispatch infrastructure and whatnot.

--D

> >  	default:
> >  		xfs_warn(log->l_mp, "%s: invalid item type (%d)",
> >  			__func__, ITEM_TYPE(item));
> > 
> > 
> 
> 
> -- 
> chandan
> 
> 
>

Patch
diff mbox series

diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 6ba3d64d08de..dba38fb99af7 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -2538,9 +2538,6 @@  xlog_recover_commit_pass2(
 		return xlog_recover_bui_pass2(log, item, trans->r_lsn);
 	case XFS_LI_BUD:
 		return xlog_recover_bud_pass2(log, item);
-	case XFS_LI_QUOTAOFF:
-		/* nothing to do in pass2 */
-		return 0;
 	default:
 		xfs_warn(log->l_mp, "%s: invalid item type (%d)",
 			__func__, ITEM_TYPE(item));