linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Eric Sandeen <sandeen@redhat.com>
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 05:43:39 -0800	[thread overview]
Message-ID: <20200217134339.GI31012@infradead.org> (raw)
In-Reply-To: <7a35e397-dbc7-b991-6277-5f9931d03950@redhat.com>

>  	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?

> +	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?

> @@ -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?

  parent reply	other threads:[~2020-02-17 13:43 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 [this message]
2020-02-17 16:03     ` Eric Sandeen
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=20200217134339.GI31012@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).