linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Allison Collins <allison.henderson@oracle.com>
To: Eric Sandeen <sandeen@redhat.com>, linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH 2/4] xfs: simplify args to xfs_get_defquota
Date: Mon, 10 Feb 2020 22:30:52 -0700	[thread overview]
Message-ID: <de89bec0-5cb6-d61b-30b9-858bbb2d1aa3@oracle.com> (raw)
In-Reply-To: <26218bfd-b003-c1fc-3ea3-e53d9c35187d@redhat.com>

On 2/8/20 2:11 PM, Eric Sandeen wrote:
> There's no real reason to pass both xfs_dquot and xfs_quotainfo to
> xfs_get_defquota, because the latter can be obtained from the former.
> This simplifies a bit more of the argument passing.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Looks ok to me
Reviewed-by: Allison Collins <allison.henderson@oracle.com>

> ---
>   fs/xfs/xfs_dquot.c       |  3 +--
>   fs/xfs/xfs_qm.c          | 17 ++++++++---------
>   fs/xfs/xfs_qm.h          |  3 ++-
>   fs/xfs/xfs_qm_syscalls.c |  2 +-
>   fs/xfs/xfs_trans_dquot.c |  3 +--
>   5 files changed, 13 insertions(+), 15 deletions(-)
> 
> diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
> index 02f433d1f13a..ddf41c24efcd 100644
> --- a/fs/xfs/xfs_dquot.c
> +++ b/fs/xfs/xfs_dquot.c
> @@ -69,13 +69,12 @@ xfs_qm_adjust_dqlimits(
>   	struct xfs_mount	*mp,
>   	struct xfs_dquot	*dq)
>   {
> -	struct xfs_quotainfo	*q = mp->m_quotainfo;
>   	struct xfs_disk_dquot	*d = &dq->q_core;
>   	struct xfs_def_quota	*defq;
>   	int			prealloc = 0;
>   
>   	ASSERT(d->d_id);
> -	defq = xfs_get_defquota(dq, q);
> +	defq = xfs_get_defquota(dq);
>   
>   	if (defq->bsoftlimit && !d->d_blk_softlimit) {
>   		d->d_blk_softlimit = cpu_to_be64(defq->bsoftlimit);
> diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
> index 0b0909657bad..b3cd87d0bccb 100644
> --- a/fs/xfs/xfs_qm.c
> +++ b/fs/xfs/xfs_qm.c
> @@ -541,8 +541,7 @@ xfs_qm_shrink_count(
>   STATIC void
>   xfs_qm_set_defquota(
>   	struct xfs_mount	*mp,
> -	uint			type,
> -	struct xfs_quotainfo	*qinf)
> +	uint			type)
>   {
>   	struct xfs_dquot	*dqp;
>   	struct xfs_def_quota	*defq;
> @@ -554,7 +553,7 @@ xfs_qm_set_defquota(
>   		return;
>   
>   	ddqp = &dqp->q_core;
> -	defq = xfs_get_defquota(dqp, qinf);
> +	defq = xfs_get_defquota(dqp);
>   
>   	/*
>   	 * Timers and warnings have been already set, let's just set the
> @@ -572,9 +571,9 @@ xfs_qm_set_defquota(
>   /* Initialize quota time limits from the root dquot. */
>   static void
>   xfs_qm_init_timelimits(
> -	struct xfs_mount	*mp,
> -	struct xfs_quotainfo	*qinf)
> +	struct xfs_mount	*mp)
>   {
> +	struct xfs_quotainfo	*qinf = mp->m_quotainfo;
>   	struct xfs_disk_dquot	*ddqp;
>   	struct xfs_dquot	*dqp;
>   	uint			type;
> @@ -671,14 +670,14 @@ xfs_qm_init_quotainfo(
>   
>   	mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD);
>   
> -	xfs_qm_init_timelimits(mp, qinf);
> +	xfs_qm_init_timelimits(mp);
>   
>   	if (XFS_IS_UQUOTA_RUNNING(mp))
> -		xfs_qm_set_defquota(mp, XFS_DQ_USER, qinf);
> +		xfs_qm_set_defquota(mp, XFS_DQ_USER);
>   	if (XFS_IS_GQUOTA_RUNNING(mp))
> -		xfs_qm_set_defquota(mp, XFS_DQ_GROUP, qinf);
> +		xfs_qm_set_defquota(mp, XFS_DQ_GROUP);
>   	if (XFS_IS_PQUOTA_RUNNING(mp))
> -		xfs_qm_set_defquota(mp, XFS_DQ_PROJ, qinf);
> +		xfs_qm_set_defquota(mp, XFS_DQ_PROJ);
>   
>   	qinf->qi_shrinker.count_objects = xfs_qm_shrink_count;
>   	qinf->qi_shrinker.scan_objects = xfs_qm_shrink_scan;
> diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h
> index 3a850401b102..4cefe1abb1d4 100644
> --- a/fs/xfs/xfs_qm.h
> +++ b/fs/xfs/xfs_qm.h
> @@ -164,9 +164,10 @@ extern int		xfs_qm_scall_quotaon(struct xfs_mount *, uint);
>   extern int		xfs_qm_scall_quotaoff(struct xfs_mount *, uint);
>   
>   static inline struct xfs_def_quota *
> -xfs_get_defquota(struct xfs_dquot *dqp, struct xfs_quotainfo *qi)
> +xfs_get_defquota(struct xfs_dquot *dqp)
>   {
>   	struct xfs_def_quota *defq;
> +	struct xfs_quotainfo *qi = dqp->q_mount->m_quotainfo;
>   
>   	if (XFS_QM_ISUDQ(dqp))
>   		defq = &qi->qi_usr_default;
> diff --git a/fs/xfs/xfs_qm_syscalls.c b/fs/xfs/xfs_qm_syscalls.c
> index 1ea82764bf89..e08c2f04f3ab 100644
> --- a/fs/xfs/xfs_qm_syscalls.c
> +++ b/fs/xfs/xfs_qm_syscalls.c
> @@ -478,7 +478,7 @@ xfs_qm_scall_setqlim(
>   		goto out_unlock;
>   	}
>   
> -	defq = xfs_get_defquota(dqp, q);
> +	defq = xfs_get_defquota(dqp);
>   	xfs_dqunlock(dqp);
>   
>   	error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_setqlim, 0, 0, 0, &tp);
> diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
> index d1b9869bc5fa..7470b02c5198 100644
> --- a/fs/xfs/xfs_trans_dquot.c
> +++ b/fs/xfs/xfs_trans_dquot.c
> @@ -585,13 +585,12 @@ xfs_trans_dqresv(
>   	xfs_qwarncnt_t		warnlimit;
>   	xfs_qcnt_t		total_count;
>   	xfs_qcnt_t		*resbcountp;
> -	struct xfs_quotainfo	*q = mp->m_quotainfo;
>   	struct xfs_def_quota	*defq;
>   
>   
>   	xfs_dqlock(dqp);
>   
> -	defq = xfs_get_defquota(dqp, q);
> +	defq = xfs_get_defquota(dqp);
>   
>   	if (flags & XFS_TRANS_DQ_RES_BLKS) {
>   		hardlimit = be64_to_cpu(dqp->q_core.d_blk_hardlimit);
> 

  reply	other threads:[~2020-02-11  5:30 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 [this message]
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
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=de89bec0-5cb6-d61b-30b9-858bbb2d1aa3@oracle.com \
    --to=allison.henderson@oracle.com \
    --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).