x/ref: Move v.io/v23/naming/ns to v.io/v23/namespace.

Also renamed ns.Namespace to namespace.T.

MultiPart: 2/2
Change-Id: I7011a8506c8cff289e6820e2d4dd782276eddc1d
diff --git a/profiles/fake/naming.go b/profiles/fake/naming.go
index 691de22..dab9a06 100644
--- a/profiles/fake/naming.go
+++ b/profiles/fake/naming.go
@@ -6,16 +6,16 @@
 
 import (
 	"v.io/v23/context"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	"v.io/v23/naming/ns"
 )
 
 func (r *Runtime) NewEndpoint(ep string) (naming.Endpoint, error) {
 	panic("unimplemented")
 }
-func (r *Runtime) SetNewNamespace(ctx *context.T, roots ...string) (*context.T, ns.Namespace, error) {
+func (r *Runtime) SetNewNamespace(ctx *context.T, roots ...string) (*context.T, namespace.T, error) {
 	panic("unimplemented")
 }
-func (r *Runtime) GetNamespace(ctx *context.T) ns.Namespace {
+func (r *Runtime) GetNamespace(ctx *context.T) namespace.T {
 	panic("unimplemented")
 }
diff --git a/profiles/internal/lib/publisher/publisher.go b/profiles/internal/lib/publisher/publisher.go
index b067f05..5a1c71c 100644
--- a/profiles/internal/lib/publisher/publisher.go
+++ b/profiles/internal/lib/publisher/publisher.go
@@ -14,8 +14,8 @@
 	"time"
 
 	"v.io/v23/context"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	"v.io/v23/naming/ns"
 	"v.io/v23/rpc"
 	"v.io/x/lib/vlog"
 )
@@ -85,7 +85,7 @@
 type stopCmd struct{} // sent to the runloop when we want it to exit.
 
 // New returns a new publisher that updates mounts on ns every period.
-func New(ctx *context.T, ns ns.Namespace, period time.Duration) Publisher {
+func New(ctx *context.T, ns namespace.T, period time.Duration) Publisher {
 	p := &publisher{
 		cmdchan:  make(chan interface{}),
 		donechan: make(chan struct{}),
@@ -166,7 +166,7 @@
 	<-p.donechan
 }
 
-func runLoop(ctx *context.T, cmdchan chan interface{}, donechan chan struct{}, ns ns.Namespace, period time.Duration) {
+func runLoop(ctx *context.T, cmdchan chan interface{}, donechan chan struct{}, ns namespace.T, period time.Duration) {
 	vlog.VI(2).Info("rpc pub: start runLoop")
 	state := newPubState(ctx, ns, period)
 
@@ -213,7 +213,7 @@
 // it's only used in the sequential publisher runLoop.
 type pubState struct {
 	ctx      *context.T
-	ns       ns.Namespace
+	ns       namespace.T
 	period   time.Duration
 	deadline time.Time           // deadline for the next sync call
 	names    map[string]nameAttr // names that have been added
@@ -227,7 +227,7 @@
 	isLeaf   bool
 }
 
-func newPubState(ctx *context.T, ns ns.Namespace, period time.Duration) *pubState {
+func newPubState(ctx *context.T, ns namespace.T, period time.Duration) *pubState {
 	return &pubState{
 		ctx:      ctx,
 		ns:       ns,
diff --git a/profiles/internal/lib/publisher/publisher_test.go b/profiles/internal/lib/publisher/publisher_test.go
index e8c988b..6c07234 100644
--- a/profiles/internal/lib/publisher/publisher_test.go
+++ b/profiles/internal/lib/publisher/publisher_test.go
@@ -12,7 +12,7 @@
 	"time"
 
 	"v.io/v23/context"
-	"v.io/v23/naming/ns"
+	"v.io/v23/namespace"
 	"v.io/v23/vtrace"
 
 	"v.io/x/ref/lib/flags"
@@ -34,7 +34,7 @@
 	return ctx
 }
 
-func resolve(t *testing.T, ns ns.Namespace, name string) []string {
+func resolve(t *testing.T, ns namespace.T, name string) []string {
 	me, err := ns.Resolve(testContext(), name)
 	if err != nil {
 		t.Fatalf("failed to resolve %q", name)
diff --git a/profiles/internal/naming/namespace/all_test.go b/profiles/internal/naming/namespace/all_test.go
index af205c2..3c5fbb8 100644
--- a/profiles/internal/naming/namespace/all_test.go
+++ b/profiles/internal/naming/namespace/all_test.go
@@ -14,8 +14,8 @@
 
 	"v.io/v23"
 	"v.io/v23/context"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	"v.io/v23/naming/ns"
 	"v.io/v23/options"
 	"v.io/v23/rpc"
 	"v.io/v23/security"
@@ -23,9 +23,9 @@
 	"v.io/x/lib/vlog"
 
 	_ "v.io/x/ref/profiles"
-	"v.io/x/ref/profiles/internal/naming/namespace"
-	service "v.io/x/ref/services/mounttable/lib"
-	test "v.io/x/ref/test"
+	inamespace "v.io/x/ref/profiles/internal/naming/namespace"
+	mtlib "v.io/x/ref/services/mounttable/lib"
+	"v.io/x/ref/test"
 	"v.io/x/ref/test/testutil"
 )
 
@@ -81,7 +81,7 @@
 	}
 }
 
-func doGlob(t *testing.T, ctx *context.T, ns ns.Namespace, pattern string, limit int) []string {
+func doGlob(t *testing.T, ctx *context.T, ns namespace.T, pattern string, limit int) []string {
 	var replies []string
 	rc, err := ns.Glob(ctx, pattern)
 	if err != nil {
@@ -156,19 +156,19 @@
 	compare(t, fname, name, me.Names(), want)
 }
 
-func testResolveToMountTable(t *testing.T, ctx *context.T, ns ns.Namespace, name string, want ...string) {
+func testResolveToMountTable(t *testing.T, ctx *context.T, ns namespace.T, name string, want ...string) {
 	doResolveTest(t, "ResolveToMountTable", ns.ResolveToMountTable, ctx, name, want)
 }
 
-func testResolveToMountTableWithPattern(t *testing.T, ctx *context.T, ns ns.Namespace, name string, pattern naming.NamespaceOpt, want ...string) {
+func testResolveToMountTableWithPattern(t *testing.T, ctx *context.T, ns namespace.T, name string, pattern naming.NamespaceOpt, want ...string) {
 	doResolveTest(t, "ResolveToMountTable", ns.ResolveToMountTable, ctx, name, want, pattern)
 }
 
-func testResolve(t *testing.T, ctx *context.T, ns ns.Namespace, name string, want ...string) {
+func testResolve(t *testing.T, ctx *context.T, ns namespace.T, name string, want ...string) {
 	doResolveTest(t, "Resolve", ns.Resolve, ctx, name, want)
 }
 
-func testResolveWithPattern(t *testing.T, ctx *context.T, ns ns.Namespace, name string, pattern naming.NamespaceOpt, want ...string) {
+func testResolveWithPattern(t *testing.T, ctx *context.T, ns namespace.T, name string, pattern naming.NamespaceOpt, want ...string) {
 	doResolveTest(t, "Resolve", ns.Resolve, ctx, name, want, pattern)
 }
 
@@ -184,7 +184,7 @@
 }
 
 func runMT(t *testing.T, ctx *context.T, mountPoint string) *serverEntry {
-	mtd, err := service.NewMountTableDispatcher("")
+	mtd, err := mtlib.NewMountTableDispatcher("")
 	if err != nil {
 		boom(t, "NewMountTableDispatcher returned error: %v", err)
 	}
@@ -600,10 +600,10 @@
 }
 
 func TestBadRoots(t *testing.T) {
-	if _, err := namespace.New(); err != nil {
+	if _, err := inamespace.New(); err != nil {
 		t.Errorf("namespace.New should not have failed with no roots")
 	}
-	if _, err := namespace.New("not a rooted name"); err == nil {
+	if _, err := inamespace.New("not a rooted name"); err == nil {
 		t.Errorf("namespace.New should have failed with an unrooted name")
 	}
 }
diff --git a/profiles/internal/rpc/cancel_test.go b/profiles/internal/rpc/cancel_test.go
index 72ea060..97813d7 100644
--- a/profiles/internal/rpc/cancel_test.go
+++ b/profiles/internal/rpc/cancel_test.go
@@ -13,8 +13,8 @@
 
 	"v.io/v23"
 	"v.io/v23/context"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	"v.io/v23/naming/ns"
 	"v.io/v23/rpc"
 	"v.io/x/lib/vlog"
 )
@@ -27,7 +27,7 @@
 
 type canceld struct {
 	sm       stream.Manager
-	ns       ns.Namespace
+	ns       namespace.T
 	name     string
 	child    string
 	started  chan struct{}
@@ -58,7 +58,7 @@
 	return nil
 }
 
-func makeCanceld(ctx *context.T, ns ns.Namespace, name, child string) (*canceld, error) {
+func makeCanceld(ctx *context.T, ns namespace.T, name, child string) (*canceld, error) {
 	sm := manager.InternalNew(naming.FixedRoutingID(0x111111111))
 	s, err := testInternalNewServer(ctx, sm, ns, v23.GetPrincipal(ctx))
 	if err != nil {
diff --git a/profiles/internal/rpc/client.go b/profiles/internal/rpc/client.go
index 3586fcf..458040f 100644
--- a/profiles/internal/rpc/client.go
+++ b/profiles/internal/rpc/client.go
@@ -19,8 +19,8 @@
 	"v.io/v23"
 	"v.io/v23/context"
 	"v.io/v23/i18n"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	"v.io/v23/naming/ns"
 	"v.io/v23/rpc"
 	"v.io/v23/security"
 	"v.io/v23/vdl"
@@ -84,7 +84,7 @@
 
 type client struct {
 	streamMgr          stream.Manager
-	ns                 ns.Namespace
+	ns                 namespace.T
 	vcOpts             []stream.VCOpt // vc opts passed to dial
 	preferredProtocols []string
 
@@ -114,7 +114,7 @@
 	clientPublicKey string // clientPublicKey = "" means we are running unencrypted (i.e. SecurityNone)
 }
 
-func InternalNewClient(streamMgr stream.Manager, ns ns.Namespace, opts ...rpc.ClientOpt) (rpc.Client, error) {
+func InternalNewClient(streamMgr stream.Manager, ns namespace.T, opts ...rpc.ClientOpt) (rpc.Client, error) {
 	c := &client{
 		streamMgr: streamMgr,
 		ns:        ns,
diff --git a/profiles/internal/rpc/full_test.go b/profiles/internal/rpc/full_test.go
index 40995e0..3ff09b7 100644
--- a/profiles/internal/rpc/full_test.go
+++ b/profiles/internal/rpc/full_test.go
@@ -21,8 +21,8 @@
 
 	"v.io/v23"
 	"v.io/v23/context"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	"v.io/v23/naming/ns"
 	"v.io/v23/options"
 	"v.io/v23/rpc"
 	"v.io/v23/security"
@@ -76,7 +76,7 @@
 	c.Unlock()
 }
 
-func testInternalNewServer(ctx *context.T, streamMgr stream.Manager, ns ns.Namespace, principal security.Principal, opts ...rpc.ServerOpt) (rpc.Server, error) {
+func testInternalNewServer(ctx *context.T, streamMgr stream.Manager, ns namespace.T, principal security.Principal, opts ...rpc.ServerOpt) (rpc.Server, error) {
 	client, err := InternalNewClient(streamMgr, ns)
 	if err != nil {
 		return nil, err
@@ -221,7 +221,7 @@
 	return security.GetCall(call.Context()).LocalPrincipal().MintDischarge(cav, expiry)
 }
 
-func startServer(t *testing.T, ctx *context.T, principal security.Principal, sm stream.Manager, ns ns.Namespace, name string, disp rpc.Dispatcher, opts ...rpc.ServerOpt) (naming.Endpoint, rpc.Server) {
+func startServer(t *testing.T, ctx *context.T, principal security.Principal, sm stream.Manager, ns namespace.T, name string, disp rpc.Dispatcher, opts ...rpc.ServerOpt) (naming.Endpoint, rpc.Server) {
 	return startServerWS(t, ctx, principal, sm, ns, name, disp, noWebsocket, opts...)
 }
 
@@ -234,7 +234,7 @@
 	return r
 }
 
-func startServerWS(t *testing.T, ctx *context.T, principal security.Principal, sm stream.Manager, ns ns.Namespace, name string, disp rpc.Dispatcher, shouldUseWebsocket websocketMode, opts ...rpc.ServerOpt) (naming.Endpoint, rpc.Server) {
+func startServerWS(t *testing.T, ctx *context.T, principal security.Principal, sm stream.Manager, ns namespace.T, name string, disp rpc.Dispatcher, shouldUseWebsocket websocketMode, opts ...rpc.ServerOpt) (naming.Endpoint, rpc.Server) {
 	vlog.VI(1).Info("InternalNewServer")
 	ctx, _ = v23.SetPrincipal(ctx, principal)
 	server, err := testInternalNewServer(ctx, sm, ns, principal, opts...)
@@ -271,7 +271,7 @@
 	return fmt.Sprintf("%s:%d", filepath.Base(file), line)
 }
 
-func verifyMount(t *testing.T, ctx *context.T, ns ns.Namespace, name string) []string {
+func verifyMount(t *testing.T, ctx *context.T, ns namespace.T, name string) []string {
 	me, err := ns.Resolve(ctx, name)
 	if err != nil {
 		t.Errorf("%s: %s not found in mounttable", loc(1), name)
@@ -280,14 +280,14 @@
 	return me.Names()
 }
 
-func verifyMountMissing(t *testing.T, ctx *context.T, ns ns.Namespace, name string) {
+func verifyMountMissing(t *testing.T, ctx *context.T, ns namespace.T, name string) {
 	if me, err := ns.Resolve(ctx, name); err == nil {
 		names := me.Names()
 		t.Errorf("%s: %s not supposed to be found in mounttable; got %d servers instead: %v (%+v)", loc(1), name, len(names), names, me)
 	}
 }
 
-func stopServer(t *testing.T, ctx *context.T, server rpc.Server, ns ns.Namespace, name string) {
+func stopServer(t *testing.T, ctx *context.T, server rpc.Server, ns namespace.T, name string) {
 	vlog.VI(1).Info("server.Stop")
 	new_name := "should_appear_in_mt/server"
 	verifyMount(t, ctx, ns, name)
@@ -317,7 +317,7 @@
 // the use of websockets. It does so by resolving the original name
 // and choosing the 'ws' endpoint from the set of endpoints returned.
 // It must return a name since it'll be passed to StartCall.
-func fakeWSName(ctx *context.T, ns ns.Namespace, name string) (string, error) {
+func fakeWSName(ctx *context.T, ns namespace.T, name string) (string, error) {
 	// Find the ws endpoint and use that.
 	me, err := ns.Resolve(ctx, name)
 	if err != nil {
@@ -336,7 +336,7 @@
 	client rpc.Client
 	server rpc.Server
 	ep     naming.Endpoint
-	ns     ns.Namespace
+	ns     namespace.T
 	sm     stream.Manager
 	name   string
 }
@@ -378,7 +378,7 @@
 	return verror.ErrorID(err) == id.ID
 }
 
-func runServer(t *testing.T, ctx *context.T, ns ns.Namespace, principal security.Principal, name string, obj interface{}, opts ...rpc.ServerOpt) stream.Manager {
+func runServer(t *testing.T, ctx *context.T, ns namespace.T, principal security.Principal, name string, obj interface{}, opts ...rpc.ServerOpt) stream.Manager {
 	rid, err := naming.NewRoutingID()
 	if err != nil {
 		t.Fatal(err)
diff --git a/profiles/internal/rpc/server.go b/profiles/internal/rpc/server.go
index 34e2eab..e995815 100644
--- a/profiles/internal/rpc/server.go
+++ b/profiles/internal/rpc/server.go
@@ -16,8 +16,8 @@
 
 	"v.io/v23/config"
 	"v.io/v23/context"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	"v.io/v23/naming/ns"
 	"v.io/v23/options"
 	"v.io/v23/rpc"
 	"v.io/v23/security"
@@ -100,7 +100,7 @@
 	// network interfaces through os syscall.
 	// TODO(jhahn): Add monitoring the network interface changes.
 	ipNets           []*net.IPNet
-	ns               ns.Namespace
+	ns               namespace.T
 	servesMountTable bool
 	isLeaf           bool
 
@@ -157,7 +157,7 @@
 
 var _ rpc.Server = (*server)(nil)
 
-func InternalNewServer(ctx *context.T, streamMgr stream.Manager, ns ns.Namespace, client rpc.Client, principal security.Principal, opts ...rpc.ServerOpt) (rpc.Server, error) {
+func InternalNewServer(ctx *context.T, streamMgr stream.Manager, ns namespace.T, client rpc.Client, principal security.Principal, opts ...rpc.ServerOpt) (rpc.Server, error) {
 	ctx, cancel := context.WithRootCancel(ctx)
 	ctx, _ = vtrace.SetNewSpan(ctx, "NewServer")
 	statsPrefix := naming.Join("rpc", "server", "routing-id", streamMgr.RoutingID().String())
diff --git a/profiles/internal/rpc/test/proxy_test.go b/profiles/internal/rpc/test/proxy_test.go
index 7249a3f..3fe5e72 100644
--- a/profiles/internal/rpc/test/proxy_test.go
+++ b/profiles/internal/rpc/test/proxy_test.go
@@ -16,8 +16,8 @@
 
 	"v.io/v23"
 	"v.io/v23/context"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	"v.io/v23/naming/ns"
 	"v.io/v23/options"
 	"v.io/v23/rpc"
 	"v.io/v23/security"
@@ -111,7 +111,7 @@
 }
 
 type proxyHandle struct {
-	ns    ns.Namespace
+	ns    namespace.T
 	sh    *modules.Shell
 	proxy modules.Handle
 	name  string
@@ -375,7 +375,7 @@
 	}
 }
 
-func verifyMount(t *testing.T, ctx *context.T, ns ns.Namespace, name string) []string {
+func verifyMount(t *testing.T, ctx *context.T, ns namespace.T, name string) []string {
 	me, err := ns.Resolve(ctx, name)
 	if err != nil {
 		t.Errorf("%s not found in mounttable", name)
@@ -384,7 +384,7 @@
 	return me.Names()
 }
 
-func verifyMountMissing(t *testing.T, ctx *context.T, ns ns.Namespace, name string) {
+func verifyMountMissing(t *testing.T, ctx *context.T, ns namespace.T, name string) {
 	if me, err := ns.Resolve(ctx, name); err == nil {
 		names := me.Names()
 		t.Errorf("%s not supposed to be found in mounttable; got %d servers instead: %v", name, len(names), names)
diff --git a/profiles/internal/rt/runtime.go b/profiles/internal/rt/runtime.go
index 3569097..83dd024 100644
--- a/profiles/internal/rt/runtime.go
+++ b/profiles/internal/rt/runtime.go
@@ -16,8 +16,8 @@
 	"v.io/v23"
 	"v.io/v23/context"
 	"v.io/v23/i18n"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	ns "v.io/v23/naming/ns"
 	"v.io/v23/options"
 	"v.io/v23/rpc"
 	"v.io/v23/security"
@@ -31,7 +31,7 @@
 	_ "v.io/x/ref/lib/stats/sysstats"
 	"v.io/x/ref/profiles/internal/lib/dependency"
 	inaming "v.io/x/ref/profiles/internal/naming"
-	"v.io/x/ref/profiles/internal/naming/namespace"
+	inamespace "v.io/x/ref/profiles/internal/naming/namespace"
 	irpc "v.io/x/ref/profiles/internal/rpc"
 	"v.io/x/ref/profiles/internal/rpc/stream"
 	imanager "v.io/x/ref/profiles/internal/rpc/stream/manager"
@@ -237,7 +237,7 @@
 		return nil, fmt.Errorf("failed to create rpc/stream/Manager: %v", err)
 	}
 
-	ns, _ := ctx.Value(namespaceKey).(ns.Namespace)
+	ns, _ := ctx.Value(namespaceKey).(namespace.T)
 	principal, _ := ctx.Value(principalKey).(security.Principal)
 	client, _ := ctx.Value(clientKey).(rpc.Client)
 
@@ -363,7 +363,7 @@
 
 	p, _ := ctx.Value(principalKey).(security.Principal)
 	sm, _ := ctx.Value(streamManagerKey).(stream.Manager)
-	ns, _ := ctx.Value(namespaceKey).(ns.Namespace)
+	ns, _ := ctx.Value(namespaceKey).(namespace.T)
 	otherOpts = append(otherOpts, imanager.DialTimeout{5 * time.Minute})
 
 	if protocols, ok := ctx.Value(protocolsKey).([]string); ok {
@@ -390,8 +390,8 @@
 	return cl
 }
 
-func (r *Runtime) setNewNamespace(ctx *context.T, roots ...string) (*context.T, ns.Namespace, error) {
-	ns, err := namespace.New(roots...)
+func (r *Runtime) setNewNamespace(ctx *context.T, roots ...string) (*context.T, namespace.T, error) {
+	ns, err := inamespace.New(roots...)
 	if err != nil {
 		return nil, nil, err
 	}
@@ -406,7 +406,7 @@
 	return ctx, ns, err
 }
 
-func (r *Runtime) SetNewNamespace(ctx *context.T, roots ...string) (*context.T, ns.Namespace, error) {
+func (r *Runtime) SetNewNamespace(ctx *context.T, roots ...string) (*context.T, namespace.T, error) {
 	newctx, ns, err := r.setNewNamespace(ctx, roots...)
 	if err != nil {
 		return ctx, nil, err
@@ -421,8 +421,8 @@
 	return newctx, ns, err
 }
 
-func (*Runtime) GetNamespace(ctx *context.T) ns.Namespace {
-	ns, _ := ctx.Value(namespaceKey).(ns.Namespace)
+func (*Runtime) GetNamespace(ctx *context.T) namespace.T {
+	ns, _ := ctx.Value(namespaceKey).(namespace.T)
 	return ns
 }
 
diff --git a/profiles/internal/testing/mocks/naming/namespace.go b/profiles/internal/testing/mocks/naming/namespace.go
index 3b4bfc9..cef0067 100644
--- a/profiles/internal/testing/mocks/naming/namespace.go
+++ b/profiles/internal/testing/mocks/naming/namespace.go
@@ -11,35 +11,35 @@
 	"time"
 
 	"v.io/v23/context"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	"v.io/v23/naming/ns"
 	"v.io/v23/security"
 	"v.io/v23/security/access"
 	"v.io/v23/verror"
 	"v.io/x/lib/vlog"
 
-	vnamespace "v.io/x/ref/profiles/internal/naming/namespace"
+	inamespace "v.io/x/ref/profiles/internal/naming/namespace"
 )
 
 // NewSimpleNamespace returns a simple implementation of a Namespace
 // server for use in tests.  In particular, it ignores TTLs and not
 // allow fully overlapping mount names.
-func NewSimpleNamespace() ns.Namespace {
-	ns, err := vnamespace.New()
+func NewSimpleNamespace() namespace.T {
+	ns, err := inamespace.New()
 	if err != nil {
 		panic(err)
 	}
-	return &namespace{mounts: make(map[string]*naming.MountEntry), ns: ns}
+	return &namespaceMock{mounts: make(map[string]*naming.MountEntry), ns: ns}
 }
 
-// namespace is a simple partial implementation of ns.Namespace.
-type namespace struct {
+// namespaceMock is a simple partial implementation of namespace.T.
+type namespaceMock struct {
 	sync.Mutex
 	mounts map[string]*naming.MountEntry
-	ns     ns.Namespace
+	ns     namespace.T
 }
 
-func (ns *namespace) Mount(ctx *context.T, name, server string, _ time.Duration, opts ...naming.NamespaceOpt) error {
+func (ns *namespaceMock) Mount(ctx *context.T, name, server string, _ time.Duration, opts ...naming.NamespaceOpt) error {
 	defer vlog.LogCall()()
 	ns.Lock()
 	defer ns.Unlock()
@@ -57,7 +57,7 @@
 	return nil
 }
 
-func (ns *namespace) Unmount(ctx *context.T, name, server string, opts ...naming.NamespaceOpt) error {
+func (ns *namespaceMock) Unmount(ctx *context.T, name, server string, opts ...naming.NamespaceOpt) error {
 	defer vlog.LogCall()()
 	ns.Lock()
 	defer ns.Unlock()
@@ -83,7 +83,7 @@
 	return nil
 }
 
-func (ns *namespace) Delete(ctx *context.T, name string, removeSubtree bool, opts ...naming.NamespaceOpt) error {
+func (ns *namespaceMock) Delete(ctx *context.T, name string, removeSubtree bool, opts ...naming.NamespaceOpt) error {
 	defer vlog.LogCall()()
 	ns.Lock()
 	defer ns.Unlock()
@@ -103,7 +103,7 @@
 	return nil
 }
 
-func (ns *namespace) Resolve(ctx *context.T, name string, opts ...naming.NamespaceOpt) (*naming.MountEntry, error) {
+func (ns *namespaceMock) Resolve(ctx *context.T, name string, opts ...naming.NamespaceOpt) (*naming.MountEntry, error) {
 	defer vlog.LogCall()()
 	_, name = security.SplitPatternName(name)
 	if address, suffix := naming.SplitAddressName(name); len(address) > 0 {
@@ -124,49 +124,49 @@
 	return nil, verror.New(naming.ErrNoSuchName, ctx, fmt.Sprintf("Resolve name %q not found in %v", name, ns.mounts))
 }
 
-func (ns *namespace) ResolveToMountTable(ctx *context.T, name string, opts ...naming.NamespaceOpt) (*naming.MountEntry, error) {
+func (ns *namespaceMock) ResolveToMountTable(ctx *context.T, name string, opts ...naming.NamespaceOpt) (*naming.MountEntry, error) {
 	defer vlog.LogCall()()
 	// TODO(mattr): Implement this method for tests that might need it.
 	panic("ResolveToMountTable not implemented")
 	return nil, nil
 }
 
-func (ns *namespace) FlushCacheEntry(name string) bool {
+func (ns *namespaceMock) FlushCacheEntry(name string) bool {
 	defer vlog.LogCall()()
 	return false
 }
 
-func (ns *namespace) CacheCtl(ctls ...naming.CacheCtl) []naming.CacheCtl {
+func (ns *namespaceMock) CacheCtl(ctls ...naming.CacheCtl) []naming.CacheCtl {
 	defer vlog.LogCall()()
 	return nil
 }
 
-func (ns *namespace) Glob(ctx *context.T, pattern string, opts ...naming.NamespaceOpt) (chan interface{}, error) {
+func (ns *namespaceMock) Glob(ctx *context.T, pattern string, opts ...naming.NamespaceOpt) (chan interface{}, error) {
 	defer vlog.LogCall()()
 	// TODO(mattr): Implement this method for tests that might need it.
 	panic("Glob not implemented")
 	return nil, nil
 }
 
-func (ns *namespace) SetRoots(...string) error {
+func (ns *namespaceMock) SetRoots(...string) error {
 	defer vlog.LogCall()()
 	panic("Calling SetRoots on a mock namespace.  This is not supported.")
 	return nil
 }
 
-func (ns *namespace) Roots() []string {
+func (ns *namespaceMock) Roots() []string {
 	defer vlog.LogCall()()
 	panic("Calling Roots on a mock namespace.  This is not supported.")
 	return nil
 }
 
-func (ns *namespace) GetPermissions(ctx *context.T, name string, opts ...naming.NamespaceOpt) (acl access.Permissions, etag string, err error) {
+func (ns *namespaceMock) GetPermissions(ctx *context.T, name string, opts ...naming.NamespaceOpt) (acl access.Permissions, etag string, err error) {
 	defer vlog.LogCall()()
 	panic("Calling GetPermissions on a mock namespace.  This is not supported.")
 	return nil, "", nil
 }
 
-func (ns *namespace) SetPermissions(ctx *context.T, name string, acl access.Permissions, etag string, opts ...naming.NamespaceOpt) error {
+func (ns *namespaceMock) SetPermissions(ctx *context.T, name string, acl access.Permissions, etag string, opts ...naming.NamespaceOpt) error {
 	defer vlog.LogCall()()
 	panic("Calling SetPermissions on a mock namespace.  This is not supported.")
 	return nil
diff --git a/profiles/internal/vtrace/vtrace_test.go b/profiles/internal/vtrace/vtrace_test.go
index 7c02c2f..63090f4 100644
--- a/profiles/internal/vtrace/vtrace_test.go
+++ b/profiles/internal/vtrace/vtrace_test.go
@@ -11,8 +11,8 @@
 
 	"v.io/v23"
 	"v.io/v23/context"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	"v.io/v23/naming/ns"
 	"v.io/v23/rpc"
 	"v.io/v23/security"
 	"v.io/v23/vtrace"
@@ -55,7 +55,7 @@
 
 type testServer struct {
 	sm           stream.Manager
-	ns           ns.Namespace
+	ns           namespace.T
 	name         string
 	child        string
 	stop         func() error
@@ -91,7 +91,7 @@
 	return nil
 }
 
-func makeTestServer(ctx *context.T, principal security.Principal, ns ns.Namespace, name, child string, forceCollect bool) (*testServer, error) {
+func makeTestServer(ctx *context.T, principal security.Principal, ns namespace.T, name, child string, forceCollect bool) (*testServer, error) {
 	sm := manager.InternalNew(naming.FixedRoutingID(0x111111111))
 	client, err := irpc.InternalNewClient(sm, ns)
 	if err != nil {
diff --git a/services/wsprd/namespace/request_handler.go b/services/wsprd/namespace/request_handler.go
index 3df6813..ca8c62e 100644
--- a/services/wsprd/namespace/request_handler.go
+++ b/services/wsprd/namespace/request_handler.go
@@ -9,15 +9,15 @@
 
 	"v.io/v23"
 	"v.io/v23/context"
+	"v.io/v23/namespace"
 	"v.io/v23/naming"
-	"v.io/v23/naming/ns"
 	"v.io/v23/rpc"
 	"v.io/v23/security/access"
 	"v.io/v23/verror"
 )
 
 type Server struct {
-	ns ns.Namespace
+	ns namespace.T
 }
 
 func New(ctx *context.T) *Server {