rpc: remove FilesystemRequest.Direction (unused)

This commit is contained in:
Christian Schwarz 2017-05-20 17:34:24 +02:00
parent 40fe7e643d
commit 3c7f782dac
3 changed files with 3 additions and 21 deletions

View File

@ -14,17 +14,9 @@ type Handler struct {
func (h Handler) HandleFilesystemRequest(r rpc.FilesystemRequest) (roots []zfs.DatasetPath, err error) {
var mapping zfs.DatasetMapping
switch r.Direction {
case rpc.DirectionPush:
mapping = h.PushMapping
case rpc.DirectionPull:
mapping = h.PullMapping
}
h.Logger.Printf("handling fsr: %#v", r)
if roots, err = zfs.ZFSListMapping(mapping); err != nil {
if roots, err = zfs.ZFSListMapping(h.PullMapping); err != nil {
h.Logger.Printf("handle fsr err: %v\n", err)
return
}

View File

@ -46,9 +46,7 @@ func doPull(pull PullContext) (err error) {
remote := pull.Remote
log := pull.Log
fsr := rpc.FilesystemRequest{
Direction: rpc.DirectionPull,
}
fsr := rpc.FilesystemRequest{}
var remoteFilesystems []zfs.DatasetPath
if remoteFilesystems, err = remote.FilesystemRequest(fsr); err != nil {
return

View File

@ -20,16 +20,8 @@ type RequestHeader struct {
Id [16]byte // UUID
}
type Direction string
const (
DirectionPush Direction = "push"
DirectionPull Direction = "pull"
)
type FilesystemRequest struct {
Roots []string // may be nil, indicating interest in all filesystems
Direction Direction
Roots []string // may be nil, indicating interest in all filesystems
}
type FilesystemVersionsRequest struct {