code: func (fm *filesManager) unlockFile(file *file) {
  	if !atomic.CompareAndSwapInt32(&file.state, fileInUse, fileOpened) {
  		panic(fmt.Errorf("failed to switch state from fileInUse to fileOpened for file %q, state=%v",
  			file.name, file.state))
  	}
  }
docs: // unlockFile unlocks the file if currently locked, otherwise panic.