From: Wang Shilong <wangshilong1991@gmail.com>
To: dsterba@suse.cz
Cc: Wang Shilong <wangsl.fnst@cn.fujitsu.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 4/4] Btrfs-progs: add super-recover to recover bad supers
Date: Sat, 21 Sep 2013 09:16:25 +0800 [thread overview]
Message-ID: <0223DF74-26DE-44A2-8D5B-1B7DC1879940@gmail.com> (raw)
In-Reply-To: <20130918163127.GF6810@twin.jikos.cz>
Hello David,
> On Wed, Sep 18, 2013 at 11:31:16PM +0800, Wang Shilong wrote:
>>>> static struct btrfs_fs_info *__open_ctree_fd(int fp, const char *path,
>>>> u64 sb_bytenr,
>>>> u64 root_tree_bytenr, int writes,
>>>> - int partial, int restore)
>>>> + int partial, int restore,
>>>> + int run_ioctl)
>>>
>>> Yet another parameter to __open_ctree_fd, this really needs a cleanup.
>>> (Later is fine.)
>>
>> I have considered about this, __open_ctree_fd() is a *static* helper, if i don't
>> add another parameter to it. I have to move out of __open_ctree_fd() into
>> open_ctree_with_broken_super() which also seems not good!
>
> The idea is that all open_ctree* variants will take one parameter that
> accumulates what's currently passed via writes/partial/restore/run_ioctl:
>
> #define OPEN_CTREE_PARTIAL (1 << 0ULL)
> #define OPEN_CTREE_WRITES (1 << 1ULL)
> etc ...
>
> static struct btrfs_fs_info *__open_ctree_fd(int fp, const char *path,
> u64 sb_bytenr,
> u64 root_tree_bytenr,
> unsigned open_flags)
>
> and the callers updated accordingly. The calls then look like
>
> - open_ctree_fs_info_restore(target, 0, 0, 0, 1);
> + open_ctree_fs_info_restore(target, 0, 0, OPEN_CTREE_PARTIAL);
Good idea, i think this should be another patch.
Thanks,
Wang
next prev parent reply other threads:[~2013-09-21 1:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-18 8:27 [PATCH 0/4] add super-recover tool to recover bad supers Wang Shilong
2013-09-18 8:27 ` [PATCH 1/4] Btrfs-progs: do not run ioctls in check_mounted_where() Wang Shilong
2013-09-18 8:27 ` [PATCH 2/4] Btrfs-progs: pass flag to control whether run ioctl in btrfs_scan_for_fsid() Wang Shilong
2013-09-18 8:27 ` [PATCH 3/4] Btrfs-progs: move ask_user() to utils.c Wang Shilong
2013-09-18 8:27 ` [PATCH 4/4] Btrfs-progs: add super-recover to recover bad supers Wang Shilong
2013-09-18 15:13 ` David Sterba
2013-09-18 15:31 ` Wang Shilong
2013-09-18 16:31 ` David Sterba
2013-09-21 1:16 ` Wang Shilong [this message]
2013-09-23 12:10 ` [offlist] " David Sterba
2013-09-18 15:18 ` [PATCH 0/4] add super-recover tool " 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=0223DF74-26DE-44A2-8D5B-1B7DC1879940@gmail.com \
--to=wangshilong1991@gmail.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=wangsl.fnst@cn.fujitsu.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).