Skip to contentSkip to conversation

btrfs-progs: re-add send-test

PATCH Eric Sandeen 3 participants 4 messages Apr 6, 2013 – Apr 9, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

From: Mark Fasheh <[email protected]>

btrfs-progs: re-add send-test

send-test.c links against libbtrfs and uses the send functionality provided to decode and print a send stream to the console.

66819df "btrfs-progs: add send-test" contained this file when submitted, but somehow got lost on commit.

[[email protected]: Resurrect lost send-test.c from original commit]

---

TBH I've not tested this, just bringing it back verbatim from the original patch on the list. We had the make target but not the C file!

-Eric

Makefile +1 -1
index a270e9c..2275b97 100644
@@ -194,7 +194,7 @@ ioctl-test: $(objects) $(libs) ioctl-test.o
 	@echo "    [LD]     $@"
 	$(Q)$(CC) $(CFLAGS) -o ioctl-test $(objects) ioctl-test.o $(LDFLAGS) $(LIBS)
 
-send-test: $(objects) send-test.o
+send-test: $(objects) $(libs) send-test.o
 	@echo "    [LD]     $@"
 	$(Q)$(CC) $(CFLAGS) -o send-test $(objects) send-test.o $(LDFLAGS) $(LIBS) -lpthread
 
send-test.c new file +458 -0

458 lines not on this page · raw message

#1 lore raw
Quoted 6 lines · Eric Sandeen

From: Mark Fasheh <[email protected]>

btrfs-progs: re-add send-test

send-test.c links against libbtrfs and uses the send functionality provided to decode and print a send stream to the console.

This looks pretty much like fardump from Arne's far repository:

git://git.kernel.org/pub/scm/linux/kernel/git/arne/far-progs.git

The stream generated by btrfs send is generated in a way to be easily receivable by any other filesystem (destination fs' limitations apply). Thus, we came up with the term Filesystem Agnostic Replication.

In my opinion, one of the next steps would be getting the logic used in btrfs receive into a generic far lib, which itself would link against libbtrfs to take the btrfs part from there. So, "btrfs receive" on the command line would become a stub calling something in the yet to create far lib, which itself would call hooks back to libbtrfs.

I have no plan ready how to build btrfs progs if we're doing such a shift, that would have to be sorted out.

My goal is to get everything that could be shared with other filesystems out of btrfs-progs into a far lib, and the send-test sent here definitely falls into that category; plus: it already exists outside btrfs-progs, unless I'm missing something.

Thanks!
-Jan

Quoted 1 line

[snip]

#2 lore raw
Quoted 9 lines · Jan Schmidt
Quoted 6 lines · Eric Sandeen

From: Mark Fasheh <[email protected]>

btrfs-progs: re-add send-test

send-test.c links against libbtrfs and uses the send functionality provided to decode and print a send stream to the console.

This looks pretty much like fardump from Arne's far repository:

AFAICS, send-test uses the NO_FILE_DATA mode, and the implementation differes (it calls into btrfs_read_and_process_send_stream, unlike fardump that dumps the attributes as it finds them), but the goal of the utility seems to be the same.

Quoted 5 lines

In my opinion, one of the next steps would be getting the logic used in btrfs receive into a generic far lib, which itself would link against libbtrfs to take the btrfs part from there. So, "btrfs receive" on the command line would become a stub calling something in the yet to create far lib, which itself would call hooks back to libbtrfs.

Sounds good in the long term.

Quoted 7 lines

I have no plan ready how to build btrfs progs if we're doing such a shift, that would have to be sorted out.

My goal is to get everything that could be shared with other filesystems out of btrfs-progs into a far lib, and the send-test sent here definitely falls into that category; plus: it already exists outside btrfs-progs, unless I'm missing something.

I don't know if Mark has other plans with send-test or if it's a debugging or development utility. Merging functinality with FAR will take some time.

Are you fine with keeping send-test in btrfsprogs until then? It's not built by default so nobody will probably rely on it so it could get replaced by fardump eventually.

david

#3 lore raw
Quoted 6 lines · David Sterba
Quoted 5 lines · Jan Schmidt
Quoted 5 lines · Eric Sandeen
Quoted 4 lines
Quoted 4 lines

From: Mark Fasheh <[email protected]>

btrfs-progs: re-add send-test

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines

send-test.c links against libbtrfs and uses the send functionality provided to decode and print a send stream to the console.

This looks pretty much like fardump from Arne's far repository:

AFAICS, send-test uses the NO_FILE_DATA mode, and the implementation differes (it calls into btrfs_read_and_process_send_stream, unlike fardump that dumps the attributes as it finds them), but the goal of the utility seems to be the same.

Good point, we will have to add something like NO_FILE_DATA to the far lib (and probably even the zfs sender) as well.

Quoted 5 lines

[snip]

Are you fine with keeping send-test in btrfsprogs until then? It's not built by default so nobody will probably rely on it so it could get replaced by fardump eventually.

I'm absolutely fine with that. To make really sure we're not breaking anything as soon as we organize things differently, I suggest prepending

+ printf("Output format is known to be changed. Do not rely on it. You have been warned.\n");

or the like, but I don't insist on it :-)

-Jan