nfsmount,serve nfs: introduce symlink support #2975

This commit is contained in:
Nick Craig-Wood 2024-10-20 17:46:42 +01:00
parent d629102fa6
commit 4e7ee9310e

View File

@ -142,16 +142,16 @@ func (f *FS) Lstat(filename string) (fi os.FileInfo, err error) {
return fi, nil return fi, nil
} }
// Symlink is not supported over NFS // Symlink creates a link pointing to target
func (f *FS) Symlink(target, link string) (err error) { func (f *FS) Symlink(target, link string) (err error) {
defer log.Trace(target, "link=%q", link)("err=%v", &err) defer log.Trace(target, "link=%q", link)("err=%v", &err)
return os.ErrInvalid return f.vfs.Symlink(target, link)
} }
// Readlink is not supported // Readlink reads the contents of link
func (f *FS) Readlink(link string) (result string, err error) { func (f *FS) Readlink(link string) (result string, err error) {
defer log.Trace(link, "")("result=%q, err=%v", &result, &err) defer log.Trace(link, "")("result=%q, err=%v", &result, &err)
return "", os.ErrInvalid return f.vfs.Readlink(link)
} }
// Chmod changes the file modes // Chmod changes the file modes