From: Jeff Mahoney <jeffm@suse.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>,
Nikolay Borisov <nborisov@suse.com>, Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: Re: [PATCH 1/6] btrfs: qgroup: Skeleton to support separate qgroup reservation type
Date: Tue, 24 Oct 2017 08:40:57 -0400 [thread overview]
Message-ID: <e4fb01cd-9861-2a62-14ee-c8dcd70b6b40@suse.com> (raw)
In-Reply-To: <3f8c74ef-c65f-21ae-64d5-a38936c2d9b0@suse.com>
[-- Attachment #1.1: Type: text/plain, Size: 1628 bytes --]
On 10/24/17 8:29 AM, Jeff Mahoney wrote:
> On 10/24/17 7:51 AM, Qu Wenruo wrote:
>>
>>
>> On 2017年10月24日 19:00, Nikolay Borisov wrote:
>>> nit: Why not BTRFS_QGROUP_RSV_TYPES_MAX = 2;
>>
>> My original plan is just as the same as yours.
>>
>> However I still remember I did it before and David fixed it by using
>> TYPES, so I follow his naming schema here.
>>
>> Kernel is also using this naming schema else where:
>> d91876496bcf ("btrfs: compress: put variables defined per compress type
>> in struct to make cache friendly")
>
> The COMPRESS_TYPES pattern isn't the right pattern to follow here.
> That's a special case since there's a _NONE that doesn't have anything
> associated with it, so we don't need to take a slot in the array.
>
> We also don't care about any of the specific values, just that they
> start at 0. The BTRFS_COMPRESS_TYPES example also has a
> BTRFS_COMPRESS_LAST item in the enum, which serves the same purpose as
> MAX. I don't have a strong opinion on the naming, just that we don't
> play games with +1 when handling arrays since, as you say, that's just
> waiting for subtle bugs later.
>
> enum btrfs_qgroup_rsv_type {
> BTRFS_QGROUP_RSV_DATA = 0,
> BTRFS_QGROUP_RSV_META,
> BTRFS_QGROUP_RSV_LAST,
> };
It turns out that BTRFS_COMPRESS_LAST did exist until very recently:
commit dc2f29212a2648164b054016dc5b948bf0fc92d5
Author: Anand Jain <anand.jain@oracle.com>
Date: Sun Aug 13 12:02:41 2017 +0800
btrfs: remove unused BTRFS_COMPRESS_LAST
... so it was there, but just wasn't used.
-Jeff
--
Jeff Mahoney
SUSE Labs
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-10-24 12:41 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 8:39 [PATCH 0/6] btrfs: qgroup: Separate qgroup reservation types Qu Wenruo
2017-10-24 8:39 ` [PATCH 1/6] btrfs: qgroup: Skeleton to support separate qgroup reservation type Qu Wenruo
2017-10-24 11:00 ` Nikolay Borisov
2017-10-24 11:51 ` Qu Wenruo
2017-10-24 12:23 ` Nikolay Borisov
2017-10-24 12:36 ` Qu Wenruo
2017-10-24 12:29 ` Jeff Mahoney
2017-10-24 12:40 ` Jeff Mahoney [this message]
2017-10-24 12:41 ` Qu Wenruo
2017-10-24 8:39 ` [PATCH 2/6] btrfs: qgroup: Introduce helpers to update and access new qgroup rsv Qu Wenruo
2017-10-24 11:07 ` Nikolay Borisov
2017-10-24 12:05 ` Qu Wenruo
2017-10-24 16:22 ` Edmund Nadolski
2017-10-25 0:38 ` Qu Wenruo
2017-10-24 8:39 ` [PATCH 3/6] btrfs: qgroup: Make qgroup_reserve and its callers to use separate reservation type Qu Wenruo
2017-10-24 8:39 ` [PATCH 4/6] btrfs: qgroup: Fix wrong qgroup reservation inheritance for relationship update Qu Wenruo
2017-10-24 12:01 ` Nikolay Borisov
2017-10-24 12:19 ` Qu Wenruo
2017-10-24 12:28 ` Nikolay Borisov
2017-10-24 17:11 ` Edmund Nadolski
2017-10-25 0:11 ` Qu Wenruo
2017-10-24 8:39 ` [PATCH 5/6] btrfs: qgroup: Update trace events to use new separate rsv types Qu Wenruo
2017-10-24 8:39 ` [PATCH 6/6] btrfs: qgroup: Cleanup the remaining old reservation counters Qu Wenruo
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=e4fb01cd-9861-2a62-14ee-c8dcd70b6b40@suse.com \
--to=jeffm@suse.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.com \
--cc=quwenruo.btrfs@gmx.com \
--cc=wqu@suse.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).