All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 4/4] xfs: per-type quota timers and warn limits
Date: Mon, 17 Feb 2020 10:03:59 -0600	[thread overview]
Message-ID: <0ed308e8-6a66-c43c-c94d-5ee782781aa3@redhat.com> (raw)
In-Reply-To: <20200217134339.GI31012@infradead.org>

On 2/17/20 7:43 AM, Christoph Hellwig wrote:
>>  	struct xfs_disk_dquot	*d = &dq->q_core;
>> +	struct xfs_def_quota	*defq;
>> +
>>  	ASSERT(d->d_id);
>> +	defq = xfs_get_defquota(dq);
> 
> Move up to the declaration line?

*shrug* ok

>> +	switch (type) {
>> +	case XFS_DQ_USER:
>> +		defq = &qinf->qi_usr_default;
>> +		break;
>> +	case XFS_DQ_GROUP:
>> +		defq = &qinf->qi_grp_default;
>> +		break;
>> +	case XFS_DQ_PROJ:
>> +		defq = &qinf->qi_prj_default;
>> +		break;
>> +	default:
>> +		ASSERT(0);
>> +		/* fall through */
>> +	}
> 
> Should this go into a helper?  Or even better replace the
> qi_*default members with an array that the type can index into?

Like maybe xfs_get_defquota() ;)

Not sure what I was thinking here, whoops.

>> @@ -592,39 +609,31 @@ xfs_qm_init_timelimits(
>>  	 *
>>  	 * Since we may not have done a quotacheck by this point, just read
>>  	 * the dquot without attaching it to any hashtables or lists.
>> -	 *
>> -	 * Timers and warnings are globally set by the first timer found in
>> -	 * user/group/proj quota types, otherwise a default value is used.
>> -	 * This should be split into different fields per quota type.
>>  	 */
>> -	if (XFS_IS_UQUOTA_RUNNING(mp))
>> -		type = XFS_DQ_USER;
>> -	else if (XFS_IS_GQUOTA_RUNNING(mp))
>> -		type = XFS_DQ_GROUP;
>> -	else
>> -		type = XFS_DQ_PROJ;
>>  	error = xfs_qm_dqget_uncached(mp, 0, type, &dqp);
>>  	if (error)
>>  		return;
>>  
>>  	ddqp = &dqp->q_core;
>> +	defq = xfs_get_defquota(dqp);
> 
> Isn't the defq variable already initialized earlier in the function?

Oh, uh ... whoops.  Not sure how I messed that up, thanks.

-Eric


  reply	other threads:[~2020-02-17 16:04 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-08 21:09 [PATCH 0/4] xfs: enable per-type quota timers and warn limits Eric Sandeen
2020-02-08 21:10 ` [PATCH 1/4] xfs: fix up some whitespace in quota code Eric Sandeen
2020-02-11  5:30   ` Allison Collins
2020-02-17 13:37   ` Christoph Hellwig
2020-02-08 21:11 ` [PATCH 2/4] xfs: simplify args to xfs_get_defquota Eric Sandeen
2020-02-11  5:30   ` Allison Collins
2020-02-17 13:38   ` Christoph Hellwig
2020-02-18 20:16     ` Eric Sandeen
2020-02-08 21:11 ` [PATCH 3/4] xfs: pass xfs_dquot to xfs_qm_adjust_dqtimers Eric Sandeen
2020-02-11  5:30   ` Allison Collins
2020-02-17 13:38   ` Christoph Hellwig
2020-02-08 21:12 ` [PATCH 4/4] xfs: per-type quota timers and warn limits Eric Sandeen
2020-02-11  5:30   ` Allison Collins
2020-02-17 13:43   ` Christoph Hellwig
2020-02-17 16:03     ` Eric Sandeen [this message]
2020-02-08 21:12 ` [PATCH 0/4] xfs: enable " Eric Sandeen
2020-02-11 15:43 ` Darrick J. Wong
2020-02-11 15:52   ` Eric Sandeen
2020-02-11 21:40     ` Eric Sandeen
2020-02-18  4:49 ` Zorro Lang
2020-02-18 21:07   ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ed308e8-6a66-c43c-c94d-5ee782781aa3@redhat.com \
    --to=sandeen@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.