From: Christoph Hellwig <hch@infradead.org>
To: Chandra Seetharaman <sekharan@us.ibm.com>
Cc: xfs@oss.sgi.com
Subject: Re: [RFC PATCH 2/3] Add pquota fields where gquota is used
Date: Wed, 19 Oct 2011 05:57:42 -0400 [thread overview]
Message-ID: <20111019095742.GA20622@infradead.org> (raw)
In-Reply-To: <20111018000943.14942.24899.sendpatchset@chandra-lucid.austin.ibm.com>
> --- a/fs/xfs/xfs_dquot.c
> +++ b/fs/xfs/xfs_dquot.c
> @@ -841,8 +841,10 @@ xfs_qm_dqget(
> ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
> if (type == XFS_DQ_USER)
> ASSERT(ip->i_udquot == NULL);
> - else
> + else if (type == XFS_DQ_GROUP)
> ASSERT(ip->i_gdquot == NULL);
> + else
> + ASSERT(ip->i_pdquot == NULL);
An xfs_inode_dquot(ip, type) macro that gets you the right quota for
a given type would be highly useful. I'd love to see that as the
first patch in the series, as it would a) clean up a lot of code like
this and b) would also help with my TODO list of overlaying the
user/group dquots with the existing fields in the VFS inode and thus
shrinking the XFS inode.
> @@ -933,8 +935,8 @@ xfs_qm_dqget(
> xfs_dqlock(dqp);
> goto dqret;
> }
> - } else {
> - if (!XFS_IS_OQUOTA_ON(mp)) {
> + } else if (type == XFS_DQ_GROUP) {
> + if (!XFS_IS_GQUOTA_ON(mp)) {
> /* inode stays locked on return */
> xfs_qm_dqdestroy(dqp);
> return XFS_ERROR(ESRCH);
Together with a
XFS_IS_TYPE_QUOTA_ON(mp, type)
that should also really greatly simplify this error path in
xfs_qm_dqget.
> +#define XFS_IS_THIS_QUOTA_OFF(d) (! ((XFS_QM_ISUDQ(d) && \
> + XFS_IS_UQUOTA_ON((d)->q_mount)) || \
> + (XFS_QM_ISGDQ(d) && \
> + XFS_IS_GQUOTA_ON((d)->q_mount)) || \
> + (XFS_QM_ISPDQ(d) && \
> + XFS_IS_PQUOTA_ON((d)->q_mount))))
And the two callers of this could easily be converted to
!XFS_IS_TYPE_QUOTA_ON.
> diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h
> index 760140d..26f95a6 100644
> --- a/fs/xfs/xfs_inode.h
> +++ b/fs/xfs/xfs_inode.h
> @@ -231,6 +231,7 @@ typedef struct xfs_inode {
> struct xfs_mount *i_mount; /* fs mount struct ptr */
> struct xfs_dquot *i_udquot; /* user dquot */
> struct xfs_dquot *i_gdquot; /* group dquot */
> + struct xfs_dquot *i_pdquot; /* project dquot */
I'd really prefer to leave growing the inode until we are fully done
adding it. So move this part to the back, just add the macro and quota
on check in the first patch, but always redirect it to i_gdquot for now.
> +++ b/fs/xfs/xfs_mount.c
> @@ -628,6 +628,7 @@ xfs_sb_to_disk(
> xfs_sb_field_t f;
> int first;
> int size;
> + __be16 saved_qflags = from->sb_qflags;
>
> ASSERT(fields);
> if (!fields)
> @@ -669,6 +670,7 @@ xfs_sb_to_disk(
>
> fields &= ~(1LL << f);
> }
> + from->sb_qflags = saved_qflags;
> }
What is this for? It will need some better documentation.
> - ASSERT(ip->i_udquot == NULL);
> + ASSERT_ALWAYS(ip->i_udquot == NULL);
Why the change to ASSERT_ALWAYS here?
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2011-10-19 9:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-18 0:09 [RFC PATCH 0/3] Allow pquota and gquota to be used together Chandra Seetharaman
2011-10-18 0:09 ` [RFC PATCH 1/3] Remove in core use of XFS_OQUOTA_ENFD and XFS_OQUOTA_CHKD Chandra Seetharaman
2011-10-18 5:16 ` Arkadiusz Miśkiewicz
2011-10-18 14:15 ` Chandra Seetharaman
2011-10-18 22:40 ` Alex Elder
2011-10-19 15:06 ` Chandra Seetharaman
2011-10-18 0:09 ` [RFC PATCH 2/3] Add pquota fields where gquota is used Chandra Seetharaman
2011-10-19 9:57 ` Christoph Hellwig [this message]
2011-10-19 15:17 ` Chandra Seetharaman
2011-10-18 0:09 ` [RFC PATCH 3/3] Add pquotaino to on-disk super block Chandra Seetharaman
2011-10-26 16:14 ` Alex Elder
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=20111019095742.GA20622@infradead.org \
--to=hch@infradead.org \
--cc=sekharan@us.ibm.com \
--cc=xfs@oss.sgi.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