code: func New(params legacy.Params) (*Backend, error) {
  	rootDir := params.GetString("path")
  	if rootDir == "" {
  		rootDir = params.GetString("data_dir")
  	}
  	if rootDir == "" {
  		return nil, trace.BadParameter("filesystem backend: 'path' is not set")
  	}
  
  	// Ensure that the path to the root directory exists.
  	err := os.MkdirAll(rootDir, defaultDirMode)
  	if err != nil {
  		return nil, trace.ConvertSystemError(err)
  	}
  
  	bk := &Backend{
  		InternalClock: clockwork.NewRealClock(),
  		rootDir:       rootDir,
  		log: logrus.WithFields(logrus.Fields{
  			trace.Component: "backend:dir",
  			trace.ComponentFields: logrus.Fields{
  				"dir": rootDir,
  			},
  		}),
  	}
  
  	// DELETE IN: 2.8.0
  	// Migrate data to new flat keyspace backend.
  	err = migrate(rootDir, bk)
  	if err != nil {
  		return nil, trace.Wrap(err)
  	}
  
  	return bk, nil
  }
docs: // New creates a new instance of a directory based backend that implements
  // backend.Backend.