// GetTlfSize implements the DiskBlockCache interface for
// diskBlockCacheWrapped.
437007
func (cache *diskBlockCacheWrapped) GetTlfIDs(
	ctx context.Context, cacheType DiskBlockCacheType) (
	tlfIDs []tlf.ID, err error) {
	cache.mtx.RLock()
	defer cache.mtx.RUnlock()

	if cacheType != DiskBlockWorkingSetCache {
		// Either sync cache only, or both.
		tlfIDs, err = cache.syncCache.GetTlfIDs(ctx)
		if err != nil {
			return nil, err
		}
	}

	if cacheType != DiskBlockSyncCache {
		// Either working set cache only, or both.
		wsTlfIDs, err := cache.workingSetCache.GetTlfIDs(ctx)
		if err != nil {
			return nil, err
		}

		// Uniquify them if needed.
		if len(tlfIDs) == 0 {
			tlfIDs = wsTlfIDs
		} else {
			s := make(map[tlf.ID]bool, len(tlfIDs)+len(wsTlfIDs))
			for _, id := range tlfIDs {
				s[id] = true
			}
			for _, id := range wsTlfIDs {
				s[id] = true
			}
			tlfIDs = make([]tlf.ID, 0, len(s))
			for id := range s {
				tlfIDs = append(tlfIDs, id)
			}
		}
	}

	return tlfIDs, nil
}
1063340
func (_class HostCrashdumpClass) GetSize(sessionID SessionRef, self HostCrashdumpRef) (_retval int, _err error) {
	_method := "host_crashdump.get_size"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertHostCrashdumpRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertIntToGo(_method + " -> ", _result.Value)
	return
}
814402
func (b BlockServerMeasured) GetEncodedSize(
	ctx context.Context, tlfID tlf.ID, id kbfsblock.ID,
	context kbfsblock.Context) (
	size uint32, status keybase1.BlockStatus, err error) {
	b.getEncodedSizeTimer.Time(func() {
		size, status, err = b.delegate.GetEncodedSize(ctx, tlfID, id, context)
	})
	return size, status, err
}
1318412
func (d *LogDatastore) GetSize(key Key) (size int, err error) {
	log.Printf("%s: GetSize %s\n", d.Name, key)
	return d.child.GetSize(key)
}
384014
func (w *Window) GetFramebufferSize() (width, height int) {
	var wi, h C.int
	C.glfwGetFramebufferSize(w.data, &wi, &h)
	return int(wi), int(h)
}
172537
func (c *LRUCache) Size() int {
	defer c.mutex.Unlock()
	c.mutex.Lock()
	return c.ll.Len()
}
831362
func (u *volumeUtil) GetFsCapacityByte(fullPath string) (int64, error) {
	_, capacity, _, _, _, _, err := fs.FsInfo(fullPath)
	return capacity, err
}
487234
func (u *FakeVolumeUtil) GetBlockCapacityByte(fullPath string) (int64, error) {
	return u.getDirEntryCapacity(fullPath, FakeEntryBlock)
}
1055837
func (_class PVSCacheStorageClass) GetSize(sessionID SessionRef, self PVSCacheStorageRef) (_retval int, _err error) {
	_method := "PVS_cache_storage.get_size"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertPVSCacheStorageRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)
	if _err != nil {
		return
	}
	_retval, _err = convertIntToGo(_method + " -> ", _result.Value)
	return
}
868949
func (cb *CommonBlock) GetEncodedSize() uint32 {
	cb.cacheMtx.RLock()
	defer cb.cacheMtx.RUnlock()
	return cb.cachedEncodedSize
}
798994
func (p *Packfile) GetSizeByOffset(o int64) (size int64, err error) {
	if _, err := p.s.SeekFromStart(o); err != nil {
		if err == io.EOF || isInvalid(err) {
			return 0, plumbing.ErrObjectNotFound
		}

		return 0, err
	}

	h, err := p.nextObjectHeader()
	if err != nil {
		return 0, err
	}
	return p.getObjectSize(h)
}
488020
func (cache *DiskBlockCacheLocal) GetTlfIDs(
	_ context.Context) (tlfIDs []tlf.ID, err error) {
	cache.lock.RLock()
	defer cache.lock.RUnlock()
	tlfIDs = make([]tlf.ID, 0, len(cache.tlfSizes))
	for id := range cache.tlfSizes {
		tlfIDs = append(tlfIDs, id)
	}
	return tlfIDs, nil
}
2967
func (b *BlockServerDisk) GetEncodedSize(
	ctx context.Context, tlfID tlf.ID, id kbfsblock.ID,
	context kbfsblock.Context) (
	size uint32, status keybase1.BlockStatus, err error) {
	if err := checkContext(ctx); err != nil {
		return 0, 0, err
	}

	defer func() {
		err = translateToBlockServerError(err)
	}()
	b.log.CDebugf(ctx,
		"BlockServerDisk.GetEncodedSize id=%s tlfID=%s context=%s",
		id, tlfID, context)
	tlfStorage, err := b.getStorage(tlfID)
	if err != nil {
		return 0, 0, err
	}

	tlfStorage.lock.RLock()
	defer tlfStorage.lock.RUnlock()
	if tlfStorage.store == nil {
		return 0, 0, errBlockServerDiskShutdown
	}

	hasContext, refStatus, err := tlfStorage.store.hasContext(ctx, id, context)
	if err != nil {
		return 0, 0, err
	}
	if !hasContext {
		return 0, 0, blockNonExistentError{id}
	}

	size64, err := tlfStorage.store.getDataSize(ctx, id)
	if err != nil {
		return 0, 0, err
	}
	return uint32(size64), refStatus.toBlockStatus(), nil
}
1180870
func ComputeBlockSize(fileSize int64, blockIndex int64) int64 {
	if BlockSize*(blockIndex+1) > fileSize {
		return fileSize % BlockSize
	}
	return BlockSize
}
197944
func (r *ReleaseAsset) GetSize() int {
	if r == nil || r.Size == nil {
		return 0
	}
	return *r.Size
}
1373581
func (cache *DiskBlockCacheService) GetBlock(ctx context.Context,
	arg kbgitkbfs.GetBlockArg) (kbgitkbfs.GetBlockRes, error) {
	// TODO: make sure this isn't remote.
	dbc := cache.config.DiskBlockCache()
	if dbc == nil {
		return kbgitkbfs.GetBlockRes{},
			DiskBlockCacheError{"Disk cache is nil"}
	}
	tlfID := tlf.ID{}
	err := tlfID.UnmarshalBinary(arg.TlfID)
	if err != nil {
		return kbgitkbfs.GetBlockRes{}, newDiskBlockCacheError(err)
	}
	blockID := kbfsblock.ID{}
	err = blockID.UnmarshalBinary(arg.BlockID)
	if err != nil {
		return kbgitkbfs.GetBlockRes{}, newDiskBlockCacheError(err)
	}
	buf, serverHalf, prefetchStatus, err := dbc.Get(
		ctx, tlfID, blockID, DiskBlockAnyCache)
	if err != nil {
		return kbgitkbfs.GetBlockRes{}, newDiskBlockCacheError(err)
	}
	protocolPrefetchStatus := prefetchStatus.ToProtocol()

	return kbgitkbfs.GetBlockRes{
		Buf:            buf,
		ServerHalf:     serverHalf.Bytes(),
		PrefetchStatus: protocolPrefetchStatus,
	}, nil
}
1239019
func GetSize(f *os.File) (ws Size, err error) {
	_, _, ec := syscall.Syscall(syscall.SYS_IOCTL,
		f.Fd(),
		uintptr(TIOCGWINSZ),
		uintptr(unsafe.Pointer(&ws)))

	err = getError(ec)

	if TIOCGWINSZ == 0 && err != nil {
		ws = Size{80, 25, 0, 0}
	}
	return ws, err
}