On 04/22/2017 06:45 PM, Chris Murphy wrote:
> On Fri, Apr 21, 2017 at 4:26 AM, Hans van Kranenburg
> <hans.van.kranenb...@mendix.com> wrote:
> 
>>
>> == Thinking out of the box ==
>>
>> Technically, converting from DUP to single could also mean:
>> * Flipping one bit in the block group type flags to 0 for each block
>> group item
>> * Flipping one bit in the chunk type flags and removing 1 stripe struct
>> for each metadata chunk item
>> * Removing the
>> * Anything else?
> 
> [...]
> Such a prune would
> need to write out new chunk and dev trees, and then whatever nodes end
> up pointing to those, maybe it's just the super blocks.

Or just use the existing offline tree plumbing code to remove some items
and insert some replacement ones.

>> How feasible would it be to write btrfs-progs style conversion to do this?
> 
> I can pretty much say it's not just a bit flip change because at the
> very least you've got new CRCs to write for any changed node.

The tree plumbing will take care of that, I was not planning to hexedit it.

> [...]

I was actually thinking about writing a C extension for python-btrfs
that gives me access to the building blocks that are present inside the
btrfs-progs code, so that the 'heavy lifting' can be done there, and so
that I can just easily script opening a filesystem and then doing tree
changes, inserting and removing some tree items, even interactively. ;-)

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

Reply via email to