Feature #2703
closedadd mechanism to report ZFS send progress
0%
Description
Following up on the work to estimate the size of a ZFS send stream, it'd be great to see the progress of the ZFS send operation as its being sent.
Updated by Bill Pijewski over 11 years ago
I've added a new command: ZFS_IOC_SEND_PROGRESS. This command can only be issued by the process which has started the "zfs send", and it takes the file descriptor to which the stream is being written (to distinguish the stream from other streams which this process may have started). That way, streams and their respective progress will not be visible to other processes.
When "zfs send" is invoked with -v, a second thread is spawned which queries ZFS_IOC_SEND_PROGRESS every second and reports how many bytes have been written. The ZFS_IOC_SEND_PROGRESS command does so by examining the offset_t associated with the stream.
Further enhancements are possible in reporting a percentage done, or reporting overall progress when using "zfs send -r", but this change sheds some light on send progress where before there was none.
Webrev here:
Updated by Eric Schrock over 11 years ago
- Status changed from New to Resolved
changeset: 13686:4bc0783f6064
tag: tip
user: Bill Pijewski <wdp@joyent.com>
date: Wed May 09 15:05:14 2012 -0700
description:
2703 add mechanism to report ZFS send progress
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Eric Schrock <Eric.Schrock@delphix.com>
modified:
usr/src/cmd/truss/codes.c
usr/src/cmd/zfs/zfs_main.c
usr/src/lib/libzfs/common/libzfs.h
usr/src/lib/libzfs/common/libzfs_sendrecv.c
usr/src/lib/libzpool/common/sys/zfs_context.h
usr/src/man/man1m/zfs.1m
usr/src/uts/common/fs/zfs/dmu_send.c
usr/src/uts/common/fs/zfs/dsl_dataset.c
usr/src/uts/common/fs/zfs/sys/dmu.h
usr/src/uts/common/fs/zfs/sys/dmu_impl.h
usr/src/uts/common/fs/zfs/sys/dsl_dataset.h
usr/src/uts/common/fs/zfs/zfs_ioctl.c
usr/src/uts/common/sys/fs/zfs.h