From: Christoph Hellwig <hch@lst.de>
To: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
Cc: Christoph Hellwig <hch@lst.de>, Chris Mason <clm@fb.com>,
Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>,
"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
Christian Brauner <brauner@kernel.org>,
Eric Biggers <ebiggers@kernel.org>
Subject: Re: [PATCH 3/5] btrfs: split btrfs_fs_devices.opened
Date: Mon, 18 Dec 2023 16:01:37 +0100 [thread overview]
Message-ID: <20231218150137.GA19041@lst.de> (raw)
In-Reply-To: <9326eff4-fc35-42e7-a381-973a9a3d5e80@wdc.com>
On Mon, Dec 18, 2023 at 11:56:11AM +0000, Johannes Thumshirn wrote:
> > struct list_head seed_list;
> >
> > - /* Count fs-devices opened. */
> > - int opened;
> > + /* Count if fs_device is in used. */
> > + unsigned int in_use;
>
> Can we make in_use a refcount_t? That will catch eventual miscounts.
> Also open/close devices isn't exactly a fastpath so refcount_t is good.
The refcount_t doesn't allow an increment to go from zero to 1, so
I don't think it fits here.
next prev parent reply other threads:[~2023-12-18 15:01 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-18 4:49 use the super_block as bdev holder Christoph Hellwig
2023-12-18 4:49 ` [PATCH 1/5] btrfs: always open the device read-only in btrfs_scan_one_device Christoph Hellwig
2023-12-18 4:49 ` [PATCH 2/5] btrfs: call btrfs_close_devices from ->kill_sb Christoph Hellwig
2023-12-18 12:22 ` Christian Brauner
2023-12-27 17:09 ` Eric Biggers
2023-12-18 4:49 ` [PATCH 3/5] btrfs: split btrfs_fs_devices.opened Christoph Hellwig
2023-12-18 11:56 ` Johannes Thumshirn
2023-12-18 15:01 ` Christoph Hellwig [this message]
2023-12-18 4:49 ` [PATCH 4/5] btrfs: open block devices after superblock creation Christoph Hellwig
2023-12-18 4:49 ` [PATCH 5/5] btrfs: use the super_block as holder when mounting file systems Christoph Hellwig
2023-12-18 12:14 ` Johannes Thumshirn
2023-12-18 15:02 ` Christoph Hellwig
2023-12-19 5:33 ` Gao Xiang
2023-12-19 12:19 ` Christoph Hellwig
2023-12-19 13:48 ` Gao Xiang
2023-12-18 12:20 ` use the super_block as bdev holder Johannes Thumshirn
-- strict thread matches above, loose matches on Subject: below --
2024-02-14 16:42 [PATCH 0/5] btrfs: " Johannes Thumshirn
2024-02-14 16:42 ` [PATCH 3/5] btrfs: split btrfs_fs_devices.opened Johannes Thumshirn
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=20231218150137.GA19041@lst.de \
--to=hch@lst.de \
--cc=Johannes.Thumshirn@wdc.com \
--cc=brauner@kernel.org \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=ebiggers@kernel.org \
--cc=josef@toxicpanda.com \
--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