func (fs *RedisFS) ValidatePath(path string) error {
	p, err := filepath.Abs(path)
	if err != nil {
		return err
	}
	if !strings.HasPrefix(p, fs.mountConf.Path) {
		return ErrFileNotManaged
	}
	return nil
}
ValidatePath ensures path belongs to a filesystem tree catched by pdwfs
package redisfs
import (
	"errors"
	"io"
	"os"
	"path/filepath"
	"sort"
	"strings"
	"github.com/cea-hpc/pdwfs/config"
)
var (
	ErrFileNotManaged = errors.New("File is not managed by pdwfs")
	ErrReadOnly = errors.New("File is read-only")
	ErrWriteOnly = errors.New("File is write-only")
	ErrIsDirectory = errors.New("Is directory")
	ErrNotDirectory = errors.New("Is not a directory")
	ErrDirNotEmpty = errors.New("Directory is not empty")
	ErrParentDirNotExist = errors.New("Parent directory does not exist")
)
type File interface {
	Name() string
	Sync() error
	Truncate(int64) error
	io.Reader
	io.ReaderAt
	io.Writer
	io.WriterAt
	io.Seeker
	io.Closer
	WriteVec([][]byte) (int, error)
	ReadVec([][]byte) (int, error)
	WriteVecAt([][]byte, int64) (int, error)
	ReadVecAt([][]byte, int64) (int, error)
}
const PathSeparator = "/"
type RedisFS struct {
	mountConf *config.Mount
	dataStore *DataStore
	redisRing *RedisRing
	inodes    map[string]*Inode
	root      *Inode
}
func NewRedisFS(redisConf *config.Redis, mountConf *config.Mount) *RedisFS {
	redisRing := NewRedisRing(redisConf)
	dataStore := NewDataStore(redisRing, int64(mountConf.StripeSize))
	root := NewInode(dataStore, redisRing, mountConf.Path)
	root.initMeta(true, 0600)
	return &RedisFS{
		mountConf: mountConf,
		redisRing: redisRing,
		dataStore: dataStore,
		inodes:    map[string]*Inode{root.Path(): root},
		root:      root,
	}
}
func (fs *RedisFS) Finalize() {
	fs.redisRing.Close()
	fs.dataStore.Close()
}