All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@dilger.ca>
To: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>,
	xfs@oss.sgi.com, cluster-devel <cluster-devel@redhat.com>,
	Steven Whitehouse <swhiteho@redhat.com>,
	Mark Fasheh <mfasheh@suse.com>, Joel Becker <jlbec@evilplan.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Jeff Mahoney <jeffm@suse.de>, Dave Kleikamp <shaggy@kernel.org>,
	jfs-discussion@lists.sourceforge.net, tytso@mit.edu
Subject: Re: [PATCH 03/12] xfs: Set allowed quota types
Date: Tue, 7 Oct 2014 13:46:20 -0600	[thread overview]
Message-ID: <3391F66C-E2A7-4FC8-8696-3C1600D54DA9@dilger.ca> (raw)
In-Reply-To: <20141007192935.GF30038@quack.suse.cz>

[-- Attachment #1: Type: text/plain, Size: 1573 bytes --]

On Oct 7, 2014, at 1:29 PM, Jan Kara <jack@suse.cz> wrote:
> On Tue 07-10-14 07:30:28, Dave Chinner wrote:
>> On Wed, Oct 01, 2014 at 09:31:25PM +0200, Jan Kara wrote:
>>> We support user, group, and project quotas. Tell VFS about it.
>>> 
>>> CC: xfs@oss.sgi.com
>>> CC: Dave Chinner <david@fromorbit.com>
>>> Signed-off-by: Jan Kara <jack@suse.cz>
>>> ---
>>> fs/xfs/xfs_super.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>> 
>>> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
>>> index b194652033cd..b32e998e8cbc 100644
>>> --- a/fs/xfs/xfs_super.c
>>> +++ b/fs/xfs/xfs_super.c
>>> @@ -1419,6 +1419,8 @@ xfs_fs_fill_super(
>>> 	sb->s_export_op = &xfs_export_operations;
>>> #ifdef CONFIG_XFS_QUOTA
>>> 	sb->s_qcop = &xfs_quotactl_operations;
>>> +	sb->s_dquot.allowed_types = (1 << USRQUOTA) | (1 << GRPQUOTA) |
>>> +				    (1 << PRJQUOTA);
>> 
>> Would it be better to define masks for these rather than open
>> coding these shifts everywhere?
>  I can do that. Any suggestion for a name? I was thinking about it for a
> while and couldn't come up with anything satisfactory...

Better to have QUOTA at the start, and TYPE in the name, so maybe:

enum quota_types {
	QUOTA_TYPE_USR = 1 << USRQUOTA,
	QUOTA_TYPE_GRP = 1 << GRPQUOTA,
	QUOTA_TYPE_PRJ = 1 << PRJQUOTA,
};

or maybe "enum quota_type_mask" or similar.

I prefer named enums over #defines since this makes it more clear
when declaring variables like "allowed_types" what valid values are
instead of just "int" that someone might mistakenly set to USRQUOTA
directly or something.

Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Andreas Dilger <adilger@dilger.ca>
To: Jan Kara <jack@suse.cz>
Cc: Dave Kleikamp <shaggy@kernel.org>,
	jfs-discussion@lists.sourceforge.net, tytso@mit.edu,
	Jeff Mahoney <jeffm@suse.de>, Mark Fasheh <mfasheh@suse.com>,
	reiserfs-devel@vger.kernel.org, xfs@oss.sgi.com,
	cluster-devel <cluster-devel@redhat.com>,
	Joel Becker <jlbec@evilplan.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>,
	Steven Whitehouse <swhiteho@redhat.com>,
	ocfs2-devel@oss.oracle.com
Subject: Re: [PATCH 03/12] xfs: Set allowed quota types
Date: Tue, 7 Oct 2014 13:46:20 -0600	[thread overview]
Message-ID: <3391F66C-E2A7-4FC8-8696-3C1600D54DA9@dilger.ca> (raw)
In-Reply-To: <20141007192935.GF30038@quack.suse.cz>


[-- Attachment #1.1: Type: text/plain, Size: 1573 bytes --]

On Oct 7, 2014, at 1:29 PM, Jan Kara <jack@suse.cz> wrote:
> On Tue 07-10-14 07:30:28, Dave Chinner wrote:
>> On Wed, Oct 01, 2014 at 09:31:25PM +0200, Jan Kara wrote:
>>> We support user, group, and project quotas. Tell VFS about it.
>>> 
>>> CC: xfs@oss.sgi.com
>>> CC: Dave Chinner <david@fromorbit.com>
>>> Signed-off-by: Jan Kara <jack@suse.cz>
>>> ---
>>> fs/xfs/xfs_super.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>> 
>>> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
>>> index b194652033cd..b32e998e8cbc 100644
>>> --- a/fs/xfs/xfs_super.c
>>> +++ b/fs/xfs/xfs_super.c
>>> @@ -1419,6 +1419,8 @@ xfs_fs_fill_super(
>>> 	sb->s_export_op = &xfs_export_operations;
>>> #ifdef CONFIG_XFS_QUOTA
>>> 	sb->s_qcop = &xfs_quotactl_operations;
>>> +	sb->s_dquot.allowed_types = (1 << USRQUOTA) | (1 << GRPQUOTA) |
>>> +				    (1 << PRJQUOTA);
>> 
>> Would it be better to define masks for these rather than open
>> coding these shifts everywhere?
>  I can do that. Any suggestion for a name? I was thinking about it for a
> while and couldn't come up with anything satisfactory...

Better to have QUOTA at the start, and TYPE in the name, so maybe:

enum quota_types {
	QUOTA_TYPE_USR = 1 << USRQUOTA,
	QUOTA_TYPE_GRP = 1 << GRPQUOTA,
	QUOTA_TYPE_PRJ = 1 << PRJQUOTA,
};

or maybe "enum quota_type_mask" or similar.

I prefer named enums over #defines since this makes it more clear
when declaring variables like "allowed_types" what valid values are
instead of just "int" that someone might mistakenly set to USRQUOTA
directly or something.

Cheers, Andreas






[-- Attachment #1.2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 121 bytes --]

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

WARNING: multiple messages have this Message-ID (diff)
From: Andreas Dilger <adilger@dilger.ca>
To: Jan Kara <jack@suse.cz>
Cc: Dave Chinner <david@fromorbit.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Ext4 Developers List <linux-ext4@vger.kernel.org>,
	xfs@oss.sgi.com, cluster-devel <cluster-devel@redhat.com>,
	Steven Whitehouse <swhiteho@redhat.com>,
	Mark Fasheh <mfasheh@suse.com>, Joel Becker <jlbec@evilplan.org>,
	ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org,
	Jeff Mahoney <jeffm@suse.de>, Dave Kleikamp <shaggy@kernel.org>,
	jfs-discussion@lists.sourceforge.net, tytso@mit.edu
Subject: [Ocfs2-devel] [PATCH 03/12] xfs: Set allowed quota types
Date: Tue, 7 Oct 2014 13:46:20 -0600	[thread overview]
Message-ID: <3391F66C-E2A7-4FC8-8696-3C1600D54DA9@dilger.ca> (raw)
In-Reply-To: <20141007192935.GF30038@quack.suse.cz>

On Oct 7, 2014, at 1:29 PM, Jan Kara <jack@suse.cz> wrote:
> On Tue 07-10-14 07:30:28, Dave Chinner wrote:
>> On Wed, Oct 01, 2014 at 09:31:25PM +0200, Jan Kara wrote:
>>> We support user, group, and project quotas. Tell VFS about it.
>>> 
>>> CC: xfs at oss.sgi.com
>>> CC: Dave Chinner <david@fromorbit.com>
>>> Signed-off-by: Jan Kara <jack@suse.cz>
>>> ---
>>> fs/xfs/xfs_super.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>> 
>>> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
>>> index b194652033cd..b32e998e8cbc 100644
>>> --- a/fs/xfs/xfs_super.c
>>> +++ b/fs/xfs/xfs_super.c
>>> @@ -1419,6 +1419,8 @@ xfs_fs_fill_super(
>>> 	sb->s_export_op = &xfs_export_operations;
>>> #ifdef CONFIG_XFS_QUOTA
>>> 	sb->s_qcop = &xfs_quotactl_operations;
>>> +	sb->s_dquot.allowed_types = (1 << USRQUOTA) | (1 << GRPQUOTA) |
>>> +				    (1 << PRJQUOTA);
>> 
>> Would it be better to define masks for these rather than open
>> coding these shifts everywhere?
>  I can do that. Any suggestion for a name? I was thinking about it for a
> while and couldn't come up with anything satisfactory...

Better to have QUOTA at the start, and TYPE in the name, so maybe:

enum quota_types {
	QUOTA_TYPE_USR = 1 << USRQUOTA,
	QUOTA_TYPE_GRP = 1 << GRPQUOTA,
	QUOTA_TYPE_PRJ = 1 << PRJQUOTA,
};

or maybe "enum quota_type_mask" or similar.

I prefer named enums over #defines since this makes it more clear
when declaring variables like "allowed_types" what valid values are
instead of just "int" that someone might mistakenly set to USRQUOTA
directly or something.

Cheers, Andreas





-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20141007/c17bf453/attachment.bin 

WARNING: multiple messages have this Message-ID (diff)
From: Andreas Dilger <adilger@dilger.ca>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 03/12] xfs: Set allowed quota types
Date: Tue, 7 Oct 2014 13:46:20 -0600	[thread overview]
Message-ID: <3391F66C-E2A7-4FC8-8696-3C1600D54DA9@dilger.ca> (raw)
In-Reply-To: <20141007192935.GF30038@quack.suse.cz>

On Oct 7, 2014, at 1:29 PM, Jan Kara <jack@suse.cz> wrote:
> On Tue 07-10-14 07:30:28, Dave Chinner wrote:
>> On Wed, Oct 01, 2014 at 09:31:25PM +0200, Jan Kara wrote:
>>> We support user, group, and project quotas. Tell VFS about it.
>>> 
>>> CC: xfs at oss.sgi.com
>>> CC: Dave Chinner <david@fromorbit.com>
>>> Signed-off-by: Jan Kara <jack@suse.cz>
>>> ---
>>> fs/xfs/xfs_super.c | 2 ++
>>> 1 file changed, 2 insertions(+)
>>> 
>>> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
>>> index b194652033cd..b32e998e8cbc 100644
>>> --- a/fs/xfs/xfs_super.c
>>> +++ b/fs/xfs/xfs_super.c
>>> @@ -1419,6 +1419,8 @@ xfs_fs_fill_super(
>>> 	sb->s_export_op = &xfs_export_operations;
>>> #ifdef CONFIG_XFS_QUOTA
>>> 	sb->s_qcop = &xfs_quotactl_operations;
>>> +	sb->s_dquot.allowed_types = (1 << USRQUOTA) | (1 << GRPQUOTA) |
>>> +				    (1 << PRJQUOTA);
>> 
>> Would it be better to define masks for these rather than open
>> coding these shifts everywhere?
>  I can do that. Any suggestion for a name? I was thinking about it for a
> while and couldn't come up with anything satisfactory...

Better to have QUOTA at the start, and TYPE in the name, so maybe:

enum quota_types {
	QUOTA_TYPE_USR = 1 << USRQUOTA,
	QUOTA_TYPE_GRP = 1 << GRPQUOTA,
	QUOTA_TYPE_PRJ = 1 << PRJQUOTA,
};

or maybe "enum quota_type_mask" or similar.

I prefer named enums over #defines since this makes it more clear
when declaring variables like "allowed_types" what valid values are
instead of just "int" that someone might mistakenly set to USRQUOTA
directly or something.

Cheers, Andreas





-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20141007/c17bf453/attachment.sig>

  reply	other threads:[~2014-10-07 19:46 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 19:31 [PATCH 0/12 RFC] Moving i_dquot out of struct inode Jan Kara
2014-10-01 19:31 ` [Cluster-devel] " Jan Kara
2014-10-01 19:31 ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31 ` Jan Kara
2014-10-01 19:31 ` [PATCH 01/12] quota: Allow each filesystem to specify which quota types it supports Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31 ` [PATCH 02/12] gfs2: Set allowed quota types Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31   ` Jan Kara
2014-10-02 10:41   ` Steven Whitehouse
2014-10-02 10:41     ` [Cluster-devel] " Steven Whitehouse
2014-10-02 10:41     ` [Ocfs2-devel] " Steven Whitehouse
2014-10-02 10:41     ` Steven Whitehouse
2014-10-01 19:31 ` [PATCH 03/12] xfs: " Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31   ` Jan Kara
2014-10-06 20:30   ` Dave Chinner
2014-10-06 20:30     ` [Cluster-devel] " Dave Chinner
2014-10-06 20:30     ` [Ocfs2-devel] " Dave Chinner
2014-10-07 19:29     ` Jan Kara
2014-10-07 19:29       ` [Cluster-devel] " Jan Kara
2014-10-07 19:29       ` [Ocfs2-devel] " Jan Kara
2014-10-07 19:46       ` Andreas Dilger [this message]
2014-10-07 19:46         ` [Cluster-devel] " Andreas Dilger
2014-10-07 19:46         ` [Ocfs2-devel] " Andreas Dilger
2014-10-07 19:46         ` Andreas Dilger
2014-10-08  8:42         ` Jan Kara
2014-10-08  8:42           ` [Cluster-devel] " Jan Kara
2014-10-08  8:42           ` [Ocfs2-devel] " Jan Kara
2014-10-08  8:42           ` Jan Kara
2014-10-01 19:31 ` [PATCH 04/12] fs: Generic infrastructure for optional inode fields Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 21:05   ` Andreas Dilger
2014-10-01 21:05     ` [Cluster-devel] " Andreas Dilger
2014-10-01 21:05     ` [Ocfs2-devel] " Andreas Dilger
2014-10-01 21:05     ` Andreas Dilger
2014-10-08  8:45     ` Jan Kara
2014-10-08  8:45       ` [Cluster-devel] " Jan Kara
2014-10-08  8:45       ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31 ` [PATCH 05/12] quota: Use optional inode field for i_dquot pointers Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31   ` Jan Kara
2014-10-01 19:31 ` [PATCH 06/12] ext2: Convert to private i_dquot field Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31   ` Jan Kara
2014-10-01 19:31 ` [PATCH 07/12] ext3: " Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31   ` Jan Kara
2014-10-01 19:31 ` [PATCH 08/12] ext4: " Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31   ` Jan Kara
2014-10-01 19:31 ` [PATCH 09/12] ocfs2: " Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31   ` Jan Kara
2014-10-01 19:31 ` [PATCH 10/12] reiserfs: " Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31 ` [PATCH 11/12] jfs: " Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31   ` Jan Kara
2014-10-01 19:31 ` [PATCH 12/12] vfs: Remove i_dquot field from inode Jan Kara
2014-10-01 19:31   ` [Cluster-devel] " Jan Kara
2014-10-01 19:31   ` [Ocfs2-devel] " Jan Kara
2014-10-01 19:31   ` Jan Kara
2014-10-10 14:54 [PATCH 0/12 v2] Moving i_dquot out of struct inode Jan Kara
2014-10-10 14:55 ` [PATCH 03/12] xfs: Set allowed quota types Jan Kara
2014-10-10 14:55   ` Jan Kara

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=3391F66C-E2A7-4FC8-8696-3C1600D54DA9@dilger.ca \
    --to=adilger@dilger.ca \
    --cc=cluster-devel@redhat.com \
    --cc=david@fromorbit.com \
    --cc=jack@suse.cz \
    --cc=jeffm@suse.de \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=jlbec@evilplan.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mfasheh@suse.com \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=reiserfs-devel@vger.kernel.org \
    --cc=shaggy@kernel.org \
    --cc=swhiteho@redhat.com \
    --cc=tytso@mit.edu \
    --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 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.