VOL-2867 - Removed unnescessary proto.Clone() in getDevice() and getLogicalDevice().
Also renamed getDevice() to getDeviceReadOnly(), getLogicalDevice() to getLogicalDeviceReadOnly(), and getDeviceReadOnly() to getDeviceReadOnlyWithoutLock().
Callers of *ReadOnly() functions must not modify the returned structures.
Also fixed places where lock was not acquired before calling getDevice().
Related to VOL-3356.
Change-Id: I9913a76a497c4d977457edaea3b199a24a3a5cb8
diff --git a/rw_core/coreif/logical_device_agent_if.go b/rw_core/coreif/logical_device_agent_if.go
index 43422c1..f3c8644 100644
--- a/rw_core/coreif/logical_device_agent_if.go
+++ b/rw_core/coreif/logical_device_agent_if.go
@@ -22,14 +22,13 @@
import (
"context"
+
"github.com/opencord/voltha-go/rw_core/route"
- "github.com/opencord/voltha-protos/v3/go/voltha"
)
// LogicalDeviceAgent represents a generic agent
type LogicalDeviceAgent interface {
GetDeviceRoutes() *route.DeviceRoutes
- GetLogicalDevice(ctx context.Context) (*voltha.LogicalDevice, error)
GetWildcardInputPorts(ctx context.Context, excludePort uint32) map[uint32]struct{}
GetRoute(ctx context.Context, ingressPortNo uint32, egressPortNo uint32) ([]route.Hop, error)
GetNNIPorts() map[uint32]struct{}