当前位置: 首页>>代码示例>>Golang>>正文


Golang StatFSOp.BlockSize方法代码示例

本文整理汇总了Golang中github.com/jacobsa/fuse/fuseops.StatFSOp.BlockSize方法的典型用法代码示例。如果您正苦于以下问题:Golang StatFSOp.BlockSize方法的具体用法?Golang StatFSOp.BlockSize怎么用?Golang StatFSOp.BlockSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/jacobsa/fuse/fuseops.StatFSOp的用法示例。


在下文中一共展示了StatFSOp.BlockSize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: StatFS

// StatFS sets filesystem metadata.
//
// Required for fuse.FileSystem.
func (k *KodingNetworkFS) StatFS(ctx context.Context, op *fuseops.StatFSOp) error {
	ds := k.DiskInfo

	op.BlockSize = ds.BlockSize
	op.Blocks = ds.BlocksTotal
	op.BlocksFree = ds.BlocksFree
	op.BlocksAvailable = op.BlocksFree

	return nil
}
开发者ID:koding,项目名称:koding,代码行数:13,代码来源:kodingnetworkfs.go

示例2: StatFS

func (fs *Goofys) StatFS(
	ctx context.Context,
	op *fuseops.StatFSOp) (err error) {

	const BLOCK_SIZE = 4096
	const TOTAL_SPACE = 1 * 1024 * 1024 * 1024 * 1024 * 1024 // 1PB
	const TOTAL_BLOCKS = TOTAL_SPACE / BLOCK_SIZE
	const INODES = 1 * 1000 * 1000 * 1000 // 1 billion
	op.BlockSize = BLOCK_SIZE
	op.Blocks = TOTAL_BLOCKS
	op.BlocksFree = TOTAL_BLOCKS
	op.BlocksAvailable = TOTAL_BLOCKS
	op.IoSize = 1 * 1024 * 1024 // 1MB
	op.Inodes = INODES
	op.InodesFree = INODES
	return
}
开发者ID:ketqi,项目名称:goofys,代码行数:17,代码来源:goofys.go

示例3: StatFS

func (fs *fileSystem) StatFS(
	ctx context.Context,
	op *fuseops.StatFSOp) (err error) {
	// Simulate a large amount of free space so that the Finder doesn't refuse to
	// copy in files. (See issue #125.) Use 2^17 as the block size because that
	// is the largest that OS X will pass on.
	op.BlockSize = 1 << 17
	op.Blocks = 1 << 33
	op.BlocksFree = op.Blocks
	op.BlocksAvailable = op.Blocks

	// Similarly with inodes.
	op.Inodes = 1 << 50
	op.InodesFree = op.Inodes

	// Prefer large transfers. This is the largest value that OS X will
	// faithfully pass on, according to fuseops/ops.go.
	op.IoSize = 1 << 20

	return
}
开发者ID:zfo,项目名称:gcsfuse,代码行数:21,代码来源:fs.go


注:本文中的github.com/jacobsa/fuse/fuseops.StatFSOp.BlockSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。