[PATCH] xfs: fix variable set but not used warnings

Dave Chinner david at fromorbit.com
Tue Apr 5 01:05:58 CDT 2011


On Tue, Apr 05, 2011 at 01:52:27AM +0200, David Sterba wrote:
> Hi,
> 
> I've seen this one too and I think this may not be a trivialy removable one, at
> least not without some analysis.

Sure.

Background: the quotaon syscall on XFS can only change whether
quotas are enforced or not in XFS. It can't switch quotas on at
all because that has to be done at mount time. Switching quotas on
at mount time sets the appropriate flags in the superblock, so we
can always rely on a superblock flag check for whether accounting
is enabled or not.

> On Mon, Apr 04, 2011 at 01:21:20PM -0500, Alex Elder wrote:
> > > Index: linux-2.6/fs/xfs/quota/xfs_qm_syscalls.c
> > > ===================================================================
> > > --- linux-2.6.orig/fs/xfs/quota/xfs_qm_syscalls.c	2011-04-03 06:40:45.399789765 -0700
> > > +++ linux-2.6/fs/xfs/quota/xfs_qm_syscalls.c	2011-04-03 06:43:00.219782939 -0700
> > > @@ -313,14 +313,12 @@ xfs_qm_scall_quotaon(
> > >  {
> > >  	int		error;
> > >  	uint		qf;
> > > -	uint		accflags;
> > >  	__int64_t	sbflags;
> > >  
> > >  	flags &= (XFS_ALL_QUOTA_ACCT | XFS_ALL_QUOTA_ENFD);
> > >  	/*
> > >  	 * Switching on quota accounting must be done at mount time.
> > >  	 */
> > > -	accflags = flags & XFS_ALL_QUOTA_ACCT;
> > >  	flags &= ~(XFS_ALL_QUOTA_ACCT);
> > 
> > Unrelated, but isn't the effect of this line plus the one a few
> > lines up the same as this?
> > 
> > 	flags &= XFS_ALL_QUOTA_ENFD;
> 
> yes it its, but then why was the separate accflags there? That's why I'm not
> sure it should go away so easily.

It's dead, Jim.



More information about the xfs mailing list