Re: [PATCH 4/4] Btrfs-progs: add super-recover to recover bad supers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux