// Reset implements the KBFSOps interface for KBFSOpsStandard.
494230
func (fs *KBFSOpsStandard) Reset(
	ctx context.Context, handle *tlfhandle.Handle) error {
	timeTrackerDone := fs.longOperationDebugDumper.Begin(ctx)
	defer timeTrackerDone()

	// First, make sure the folder has been reset according to the
	// mdserver.
	bareHandle, err := handle.ToBareHandle()
	if err != nil {
		return err
	}
	id, _, err := fs.config.MDServer().GetForHandle(
		ctx, bareHandle, kbfsmd.Merged, nil)
	if err == nil {
		fs.log.CDebugf(ctx, "Folder %s can't be reset; still has ID %s",
			handle.GetCanonicalPath(), id)
		return errors.WithStack(FolderNotResetOnServer{handle})
	} else if _, ok := errors.Cause(err).(kbfsmd.ServerErrorClassicTLFDoesNotExist); !ok {
		// Return errors if they don't indicate the folder is new.
		return err
	}

	fs.opsLock.Lock()
	defer fs.opsLock.Unlock()
	fs.log.CDebugf(ctx, "Reset %s", handle.GetCanonicalPath())
	fb := data.FolderBranch{Tlf: handle.TlfID(), Branch: data.MasterBranch}
	ops, ok := fs.ops[fb]
	if ok {
		err := ops.Reset(ctx, handle)
		if err != nil {
			return err
		}
		delete(fs.ops, fb)
		fav := handle.ToFavorite()
		delete(fs.opsByFav, fav)
		err = ops.Shutdown(ctx)
		if err != nil {
			return err
		}
	}

	// Reset the TLF by overwriting the TLF ID in the sigchain.  This
	// assumes that the server is in implicit team mode for new TLFs,
	// which at this point it should always be.
	return fs.resetTlfID(ctx, handle)
}
70136
func (n *NamespacedKV) Reset() {
	it := n.db.NewIterator(util.BytesPrefix(n.prefix), nil)
	defer it.Release()
	batch := n.db.newBatch()
	for it.Next() {
		batch.Delete(it.Key())
		batch.checkFlush()
	}
	batch.flush()
}
763577
func (s *Storage) Reset() {
	s.setBadger(storage.TotalCountKey, 0)
	s.setBadger(storage.IosSuccessKey, 0)
	s.setBadger(storage.IosErrorKey, 0)
	s.setBadger(storage.AndroidSuccessKey, 0)
	s.setBadger(storage.AndroidErrorKey, 0)
}
451518
func (cb *Breaker) Reset() {
	atomic.StoreInt32(&cb.broken, 0)
	atomic.StoreInt32(&cb.tripped, 0)
	atomic.StoreInt64(&cb.halfOpens, 0)
	cb.ResetCounters()
	cb.sendEvent(BreakerReset)
}
602163
func (fp *fieldPath) reset() {
	copy(fp.path, fpReset)
	fp.last = 0
	fp.done = false
}
1309861
func Reset() {
	states = stateMap{
		m: map[string]*remote.State{},
	}

	locks = lockMap{
		m: map[string]*state.LockInfo{},
	}
}
572294
func (w *Writer) Reset(writer io.Writer) (err error) {
	w.seq++
	if w.err == nil {
		w.writePending()
		err = w.err
	}
	w.w = writer
	w.f, _ = writer.(flusher)
	w.i = 0
	w.j = 0
	w.written = 0
	w.first = false
	w.pending = false
	w.err = nil
	return
}
290230
func (c *Chunk) Reset() {
	if c.columns == nil {
		return
	}
	for _, col := range c.columns {
		col.reset()
	}
	c.numVirtualRows = 0
}
1336312
func (b *BitWriter) Reset(w io.Writer) {
	b.w = w
	b.b[0] = 0x00
	b.count = 8
}
1091596
func (r *Reader) Reset() {
	if r.structTypeRef != nil {
		r.structTypeRef = r.structTypeRef[:0]
	}
	if r.fieldsRef != nil {
		r.fieldsRef = r.fieldsRef[:0]
	}
	if r.Simple {
		return
	}
	if r.ref != nil {
		r.ref = r.ref[:0]
	}
}
629039
func (s *memSeries) reset() {
	s.chunks = nil
	s.headChunk = nil
	s.firstChunkID = 0
	s.nextAt = math.MinInt64
	s.sampleBuf = [4]sample{}
	s.pendingCommit = false
	s.app = nil
}
311815
func (z *Writer) Reset(w io.Writer) {
	z.init(w, z.level)
}
398466
func (l *Logger) Reset() {
	l.ErrorCounter.Reset()
	if l.errors != nil {
		l.errors.Reset()
	}
}
36834
func (s *Storage) Reset() {
	s.setBoltDB(storage.TotalCountKey, 0)
	s.setBoltDB(storage.IosSuccessKey, 0)
	s.setBoltDB(storage.IosErrorKey, 0)
	s.setBoltDB(storage.AndroidSuccessKey, 0)
	s.setBoltDB(storage.AndroidErrorKey, 0)
}
680359
func Reset() error {
	if conn != nil {
		conn.Close()
	}

	var err error
	conn, err = kbCtx.LoopbackListener.Dial()
	if err != nil {
		return fmt.Errorf("Socket error: %s", err)
	}
	return nil
}
214
func (dec *ProtoDecoder) Reset(r io.Reader) {
	dec.pBuf.Reset()
	dec.bBuf.Reset()
	dec.r = r
}
989030
func (s *SSD1306Driver) Reset() (err error) {
	s.Off()
	s.Clear()
	s.On()
	return nil
}