From 3c7f782dac58e7bdbb297136c6751456e4aaf865 Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Sat, 20 May 2017 17:34:24 +0200 Subject: [PATCH] rpc: remove FilesystemRequest.Direction (unused) --- cmd/handler.go | 10 +--------- cmd/replication.go | 4 +--- rpc/structs.go | 10 +--------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/cmd/handler.go b/cmd/handler.go index ab78b48..113ae54 100644 --- a/cmd/handler.go +++ b/cmd/handler.go @@ -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 } diff --git a/cmd/replication.go b/cmd/replication.go index 25bb7c2..f76d3f2 100644 --- a/cmd/replication.go +++ b/cmd/replication.go @@ -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 diff --git a/rpc/structs.go b/rpc/structs.go index 0715776..52bb73b 100644 --- a/rpc/structs.go +++ b/rpc/structs.go @@ -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 {