From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 08/11] btrfs-progs: track total_devs in fs devices
Date: Tue, 18 Jul 2023 03:28:25 +0800 [thread overview]
Message-ID: <ca797932-0b7f-dee7-ec08-0ff722f6180a@oracle.com> (raw)
In-Reply-To: <20230713185835.GF30916@twin.jikos.cz>
On 14/07/2023 02:58, David Sterba wrote:
> On Fri, Jul 07, 2023 at 11:52:38PM +0800, Anand Jain wrote:
>> Similar to the kernel, introduce the btrfs_fs_devices::total_devs
>> attribute to know the overall count of devices that are expected
>> to be present per filesystem.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>> kernel-shared/volumes.c | 4 +++-
>> kernel-shared/volumes.h | 1 +
>> 2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel-shared/volumes.c b/kernel-shared/volumes.c
>> index 1e42e4fe105e..fd5890d033c8 100644
>> --- a/kernel-shared/volumes.c
>> +++ b/kernel-shared/volumes.c
>> @@ -367,7 +367,8 @@ static int device_list_add(const char *path,
>> BTRFS_FSID_SIZE);
>>
>> fs_devices->latest_devid = devid;
>> - fs_devices->latest_trans = found_transid;
>> + /* Below we would set this to found_transid */
>> + fs_devices->latest_trans = 0;
>> fs_devices->lowest_devid = (u64)-1;
>> fs_devices->chunk_alloc_policy = BTRFS_CHUNK_ALLOC_REGULAR;
>> device = NULL;
>> @@ -438,6 +439,7 @@ static int device_list_add(const char *path,
>> if (found_transid > fs_devices->latest_trans) {
>> fs_devices->latest_devid = devid;
>> fs_devices->latest_trans = found_transid;
>> + fs_devices->total_devices = device->total_devs;
>> }
>> if (fs_devices->lowest_devid > devid) {
>> fs_devices->lowest_devid = devid;
>> diff --git a/kernel-shared/volumes.h b/kernel-shared/volumes.h
>> index 93e02a901d31..09964f96ca37 100644
>> --- a/kernel-shared/volumes.h
>> +++ b/kernel-shared/volumes.h
>> @@ -90,6 +90,7 @@ struct btrfs_fs_devices {
>>
>> u64 total_rw_bytes;
>>
>> + int total_devices;
>> int num_devices;
>> int missing;
>
> All the device counters could be added separately, that's for the
> kernel/userspace parity.
Hm. I didn't get this. Could you please elaborate on this?
Thanks.
>
>> int latest_bdev;
>> --
>> 2.39.3
next prev parent reply other threads:[~2023-07-17 19:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-07 15:52 [PATCH 00/11] btrfs-progs: fix bugs and CHANGING_FSID_V2 flag Anand Jain
2023-07-07 15:52 ` [PATCH 01/11] btrfs-progs: fix duplicate missing device Anand Jain
2023-07-07 15:52 ` [PATCH 02/11] btrfs-progs: call warn() for " Anand Jain
2023-07-13 18:48 ` David Sterba
2023-07-17 18:22 ` Anand Jain
2023-07-19 14:34 ` Anand Jain
2023-07-07 15:52 ` [PATCH 03/11] btrfs-progs: track missing device counter Anand Jain
2023-07-07 15:52 ` [PATCH 04/11] btrfs-progs: NULL initialize device name for missing Anand Jain
2023-07-07 15:52 ` [PATCH 05/11] btrfs-progs: tune: check for missing device Anand Jain
2023-07-13 18:49 ` David Sterba
2023-07-17 19:02 ` Anand Jain
2023-07-07 15:52 ` [PATCH 06/11] btrfs-progs: track changing_fsid flag in fs_devices Anand Jain
2023-07-07 15:52 ` [PATCH 07/11] btrfs-progs: track num_devices per fs_devices Anand Jain
2023-07-07 15:52 ` [PATCH 08/11] btrfs-progs: track total_devs in fs devices Anand Jain
2023-07-13 18:58 ` David Sterba
2023-07-17 19:28 ` Anand Jain [this message]
2023-07-07 15:52 ` [PATCH 09/11] btrfs-progs: track active metadata_uuid per fs_devices Anand Jain
2023-07-07 15:52 ` [PATCH 10/11] btrfs-progs: add helper to reunite devices with same metadata_uuid Anand Jain
2023-07-07 15:52 ` [PATCH 11/11] btrfs-progs: tune: fix incomplete fsid_change Anand Jain
2023-07-13 18:57 ` David Sterba
2023-07-17 19:25 ` Anand Jain
2023-07-20 14:33 ` Anand Jain
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=ca797932-0b7f-dee7-ec08-0ff722f6180a@oracle.com \
--to=anand.jain@oracle.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/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).