linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans van Kranenburg <hans.van.kranenburg@mendix.com>
To: Chris Murphy <lists@colorremedies.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: Experiences with metadata balance/convert
Date: Sat, 22 Apr 2017 22:21:30 +0200	[thread overview]
Message-ID: <838ab05f-094f-0c97-034f-e53e8cd374b7@mendix.com> (raw)
In-Reply-To: <CAJCQCtS1GGZ1dAzc5kdk8nrj=k7nRbW5F53f+byGmgPXYMrBug@mail.gmail.com>

On 04/22/2017 06:45 PM, Chris Murphy wrote:
> On Fri, Apr 21, 2017 at 4:26 AM, Hans van Kranenburg
> <hans.van.kranenburg@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

  parent reply	other threads:[~2017-04-22 20:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 10:26 Experiences with metadata balance/convert Hans van Kranenburg
2017-04-21 10:31 ` Hans van Kranenburg
2017-04-21 11:13   ` Hans van Kranenburg
2017-04-21 11:27     ` Austin S. Hemmelgarn
2017-04-22  9:17 ` Duncan
2017-04-22 21:18   ` Hans van Kranenburg
2017-04-22 16:45 ` Chris Murphy
2017-04-22 16:55   ` Chris Murphy
2017-04-22 20:22     ` Hans van Kranenburg
2017-04-22 20:33       ` Hans van Kranenburg
2017-04-22 20:21   ` Hans van Kranenburg [this message]
2017-04-23  9:45     ` Hans van Kranenburg

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=838ab05f-094f-0c97-034f-e53e8cd374b7@mendix.com \
    --to=hans.van.kranenburg@mendix.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.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).