Commit Graph

5 Commits

Author SHA1 Message Date
Benedikt Morbach 621d07bd3a btrfs-progs: send-dump: add missing newlines
make sure to include newlines after commands that have only one
argument, such as 'unlink' or 'mkfile'

changes

    unlink          ./baz.0/file_autimes          ./baz.0/                        atime=2017-02-22T11:59:16+0100 mtime=2017-02-22T11:59:16+0100 ctime=2017-02-22T11:59:16+0100
    truncate        ./baz.0/file_a                  size=131072
    chmod           ./baz.0/file_a                  mode=644
    utimes          ./baz.0/file_a                  atime=2017-02-22T11:59:16+0100 mtime=2017-02-22T11:59:16+0100 ctime=2017-02-22T11:59:16+0100
    mkfile          ./baz.0/o258-11-0rename          ./baz.0/o258-11-0               dest=./baz.0/file_b
    utimes          ./baz.0/                        atime=2017-02-22T11:59:16+0100 mtime=2017-02-22T11:59:16+0100 ctime=2017-02-22T11:59:16+0100

to

    unlink          ./baz.0/file_a
    utimes          ./baz.0/                        atime=2017-02-22T11:59:16+0100 mtime=2017-02-22T11:59:16+0100 ctime=2017-02-22T11:59:16+0100
    truncate        ./baz.0/file_a                  size=131072
    chmod           ./baz.0/file_a                  mode=644
    utimes          ./baz.0/file_a                  atime=2017-02-22T11:59:16+0100 mtime=2017-02-22T11:59:16+0100 ctime=2017-02-22T11:59:16+0100
    mkfile          ./baz.0/o258-11-0
    rename          ./baz.0/o258-11-0               dest=./baz.0/file_b
    utimes          ./baz.0/                        atime=2017-02-22T11:59:16+0100 mtime=2017-02-22T11:59:16+0100 ctime=2017-02-22T11:59:16+0100

Signed-off-by: Benedikt Morbach <benedikt.morbach@googlemail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-03-08 13:00:48 +01:00
David Sterba 590d8b2ee5 btrfs-progs: send dump: use reentrant variant of localtime
Signed-off-by: David Sterba <dsterba@suse.com>
2016-12-14 15:06:34 +01:00
David Sterba 25afadfc72 btrfs-progs: send dump: print escaped path
Signed-off-by: David Sterba <dsterba@suse.com>
2016-12-14 15:06:34 +01:00
David Sterba 637563be3c btrfs-progs: send dump: introduce helper for printing escaped path
The send dump prints one line per stream operation, we'd like to prevent
any line breakage, so the characters are printed escaped in the C style.

Signed-off-by: David Sterba <dsterba@suse.com>
2016-12-14 15:06:34 +01:00
Qu Wenruo fad531e523 btrfs-progs: introduce new send-dump object
Introduce send-dump.[ch] which implements a new btrfs_send_ops to
exam and output all operations inside a send stream.

It has a better output format than the old and no longer compilable
send-test tool, but still tries to be script friendly.

Provides the basis for later "inspect-internal dump-send" command.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
[ drop escaping call from __print_dump for now, drop gcc warning tweaks,
  replace empty format strings with NULL ]
Signed-off-by: David Sterba <dsterba@suse.com>
2016-12-14 15:06:34 +01:00