code: func newSession(stor storage.Storage, o *opt.Options) (s *session, err error) {
  	if stor == nil {
  		return nil, os.ErrInvalid
  	}
  	storLock, err := stor.Lock()
  	if err != nil {
  		return
  	}
  	s = &session{
  		stor:      newIStorage(stor),
  		storLock:  storLock,
  		refCh:     make(chan *vTask),
  		relCh:     make(chan *vTask),
  		deltaCh:   make(chan *vDelta),
  		abandon:   make(chan int64),
  		fileRefCh: make(chan chan map[int64]int),
  		closeC:    make(chan struct{}),
  	}
  	s.setOptions(o)
  	s.tops = newTableOps(s)
  
  	s.closeW.Add(1)
  	go s.refLoop()
  	s.setVersion(nil, newVersion(s))
  	s.log("log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed")
  	return
  }
docs: // Creates new initialized session instance.