From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>,
linux-btrfs@vger.kernel.org, Greed Rong <greedrong@gmail.com>
Subject: Re: [PATCH 3/4] btrfs: preallocate anon_dev for subvolume and snapshot creation
Date: Wed, 1 Jul 2020 19:39:29 +0200 [thread overview]
Message-ID: <20200701173928.GF27795@twin.jikos.cz> (raw)
In-Reply-To: <f792151a-ebd5-2ac7-c9ac-0c274ea1ab8e@gmx.com>
On Wed, Jul 01, 2020 at 11:25:27AM +0800, Qu Wenruo wrote:
> >> +struct btrfs_root *btrfs_get_new_fs_root(struct btrfs_fs_info *fs_info,
> >> + u64 objectid, dev_t anon_dev)
> >> +{
> >> + return __get_fs_root(fs_info, objectid, anon_dev, true);
> >> +}
> >
> > This does not look like a good API, we should keep btrfs_get_fs_root and
> > add the anon_bdev initialization to the callers, there are only a few.
> >
>
> A few = over 25?
>
> I have switched to keep btrfs_get_fs_root(), but you won't like the summary:
>
> Old:
> fs/btrfs/disk-io.h | 2 ++
> fs/btrfs/ioctl.c | 21 ++++++++++++++++-
> fs/btrfs/transaction.c | 3 ++-
> fs/btrfs/transaction.h | 2 ++
> 5 files changed, 70 insertions(+), 9 deletions(-)
>
> New:
> fs/btrfs/backref.c | 4 ++--
> fs/btrfs/disk-io.c | 42 ++++++++++++++++++++++++++++++++++--------
> fs/btrfs/disk-io.h | 3 ++-
> fs/btrfs/export.c | 2 +-
> fs/btrfs/file.c | 2 +-
> fs/btrfs/inode.c | 2 +-
> fs/btrfs/ioctl.c | 31 +++++++++++++++++++++++++------
> fs/btrfs/relocation.c | 11 ++++++-----
> fs/btrfs/root-tree.c | 2 +-
> fs/btrfs/scrub.c | 2 +-
> fs/btrfs/send.c | 4 ++--
> fs/btrfs/super.c | 2 +-
> fs/btrfs/transaction.c | 3 ++-
> fs/btrfs/transaction.h | 2 ++
> fs/btrfs/tree-log.c | 2 +-
> fs/btrfs/uuid-tree.c | 2 +-
> 16 files changed, 83 insertions(+), 33 deletions(-)
>
> Do we really go that direction?
You're right, I don't like the summary and I don't like the code either.
Adding the anon_dev argument to btrfs_get_fs_root is wrong and I have
never suggested that. What I meant is to put the actual id allocation
to the callers where the subvolume is created, ie only 2 places.
next prev parent reply other threads:[~2020-07-01 17:39 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 2:17 [PATCH 0/4] btrfs: workaround exhausted anonymous block device pool Qu Wenruo
2020-06-16 2:17 ` [PATCH 1/4] btrfs: disk-io: don't allocate anonymous block device for user invisible roots Qu Wenruo
2020-06-16 19:21 ` Josef Bacik
2020-06-16 2:17 ` [PATCH 2/4] btrfs: detect uninitialized btrfs_root::anon_dev for user visible subvolumes Qu Wenruo
2020-06-16 19:25 ` Josef Bacik
2020-06-16 22:49 ` Qu Wenruo
2020-06-16 23:32 ` Josef Bacik
2020-06-16 23:49 ` Qu Wenruo
2020-06-17 11:31 ` David Sterba
2020-06-17 13:37 ` Josef Bacik
2020-06-17 23:39 ` Qu Wenruo
2020-06-16 2:17 ` [PATCH 3/4] btrfs: preallocate anon_dev for subvolume and snapshot creation Qu Wenruo
2020-06-16 15:10 ` David Sterba
2020-06-16 22:54 ` Qu Wenruo
2020-07-01 3:25 ` Qu Wenruo
2020-07-01 17:39 ` David Sterba [this message]
2020-07-01 23:56 ` Qu Wenruo
2020-07-02 16:08 ` David Sterba
2020-07-02 23:46 ` David Sterba
2020-07-03 5:19 ` Qu Wenruo
2020-07-03 12:29 ` David Sterba
2020-07-03 12:39 ` Qu Wenruo
2020-06-16 2:17 ` [PATCH 4/4] btrfs: free anon_dev earlier to prevent exhausting anonymous block device pool Qu Wenruo
2020-06-16 19:23 ` Josef Bacik
2020-06-16 22:48 ` David Sterba
2020-06-16 23:31 ` Josef Bacik
2020-06-30 14:14 ` [PATCH 0/4] btrfs: workaround exhausted " David Sterba
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=20200701173928.GF27795@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=greedrong@gmail.com \
--cc=linux-btrfs@vger.kernel.org \
--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