Side-project feature request for 'hammer mirror-*' functions

Michael Neumann mneumann at ntecs.de
Fri Oct 10 02:05:26 PDT 2008


Matthew Dillon wrote:
    If someone has the time, this is a really simple feature request.
    Ok, yah, I could do it myself, but I'm going to offer it to others
    first and that might save me a little time :-)
    It's simple.  If you do a hammer mirror-copy or hammer mirror-stream
    to a target HAMMER filesystem the code checks that the target is a PFS
    slave with the same shared UUID as the master's UUID.
    I want a feature that asks the user whether he wants to create a
    conforming PFS on the target at that point, if the target directory
    does not exist, instead of exiting with an error.
    i.e. this would take away all the effort of having to create a pfs-slave
    and assign the correct UUID to it.  It takes about 60 seconds and some
    cutting and pasting to do that manually now... not long, but we can
    make it ultra convenient.
    You would simply run the command and it would ask if you wanted to create
    a new PFS on the target instead of exiting.  You would say 'yes', and
    poof, new mirror slave target :-).
That's a feature I was missing too often, so I'd like to give it a try.

As far as I understand, I'd have to slightly modify the protocol at the 
beginning. Right now, the slave starts to send it's tid's to the master 
(a header record), which of course fails if the slave PFS does not exist
yet.

I'd have to change it so that the master first sends out it's
header information. Another option I was considering is to introduce a
command line switch, which contains the shared-uuid of the master and is 
passed to mirror-write. That would work without modifying the protocol,
but it isn't that easy because the master can be located at a remote
site.

Matt, do you already send a protocol version in hammer-copy (i.e. 
hammer-read and hammer-write)? If I change the protocol, that would 
require this version to be updated. I think HAMMER_IOC_PSEUDOFS_VERSION
is not the correct one, because it's the version of the PFS, not that
of the external mirror protocol. Is HAMMER_IOC_MIRROR_SIGNATURE or _REV
the right place to modify?

Or is there a way to do it without modifying the mirror protocol?

Regards,

  Michael





More information about the Kernel mailing list