code: func (ed *emptyDir) SetUpAt(dir string, fsGroup *int64) error {
  	notMnt, err := ed.mounter.IsLikelyNotMountPoint(dir)
  	// Getting an os.IsNotExist err from is a contingency; the directory
  	// may not exist yet, in which case, setup should run.
  	if err != nil && !os.IsNotExist(err) {
  		return err
  	}
  
  	// If the plugin readiness file is present for this volume, and the
  	// storage medium is the default, then the volume is ready.  If the
  	// medium is memory, and a mountpoint is present, then the volume is
  	// ready.
  	if volumeutil.IsReady(ed.getMetaDir()) {
  		if ed.medium == v1.StorageMediumMemory && !notMnt {
  			return nil
  		} else if ed.medium == v1.StorageMediumDefault {
  			return nil
  		}
  	}
  
  	switch ed.medium {
  	case v1.StorageMediumDefault:
  		err = ed.setupDir(dir)
  	case v1.StorageMediumMemory:
  		err = ed.setupTmpfs(dir)
  	case v1.StorageMediumHugePages:
  		err = ed.setupHugepages(dir)
  	default:
  		err = fmt.Errorf("unknown storage medium %q", ed.medium)
  	}
  
  	volume.SetVolumeOwnership(ed, fsGroup)
  
  	if err == nil {
  		volumeutil.SetReady(ed.getMetaDir())
  	}
  
  	return err
  }
docs: // SetUpAt creates new directory.