mirror of
https://github.com/rclone/rclone.git
synced 2024-11-28 03:14:55 +01:00
serve nfs: store billy FS in the Handler
This commit is contained in:
parent
cae22a7562
commit
a697d27455
@ -20,6 +20,7 @@ func NewHandler(vfs *vfs.VFS, opt *Options) nfs.Handler {
|
|||||||
handler := &Handler{
|
handler := &Handler{
|
||||||
vfs: vfs,
|
vfs: vfs,
|
||||||
opt: opt,
|
opt: opt,
|
||||||
|
billyFS: &FS{vfs: vfs},
|
||||||
}
|
}
|
||||||
handler.opt.HandleLimit = handler.opt.Limit()
|
handler.opt.HandleLimit = handler.opt.Limit()
|
||||||
handler.cache = cacheHelper(handler, handler.HandleLimit())
|
handler.cache = cacheHelper(handler, handler.HandleLimit())
|
||||||
@ -30,15 +31,14 @@ func NewHandler(vfs *vfs.VFS, opt *Options) nfs.Handler {
|
|||||||
type Handler struct {
|
type Handler struct {
|
||||||
vfs *vfs.VFS
|
vfs *vfs.VFS
|
||||||
opt *Options
|
opt *Options
|
||||||
|
billyFS *FS
|
||||||
cache nfs.Handler
|
cache nfs.Handler
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mount backs Mount RPC Requests, allowing for access control policies.
|
// Mount backs Mount RPC Requests, allowing for access control policies.
|
||||||
func (h *Handler) Mount(ctx context.Context, conn net.Conn, req nfs.MountRequest) (status nfs.MountStatus, hndl billy.Filesystem, auths []nfs.AuthFlavor) {
|
func (h *Handler) Mount(ctx context.Context, conn net.Conn, req nfs.MountRequest) (status nfs.MountStatus, hndl billy.Filesystem, auths []nfs.AuthFlavor) {
|
||||||
status = nfs.MountStatusOk
|
|
||||||
hndl = &FS{vfs: h.vfs}
|
|
||||||
auths = []nfs.AuthFlavor{nfs.AuthFlavorNull}
|
auths = []nfs.AuthFlavor{nfs.AuthFlavorNull}
|
||||||
return
|
return nfs.MountStatusOk, h.billyFS, auths
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change provides an interface for updating file attributes.
|
// Change provides an interface for updating file attributes.
|
||||||
|
Loading…
Reference in New Issue
Block a user