本文整理汇总了Golang中github.com/jacobsa/fuse/fuseops.StatFSOp类的典型用法代码示例。如果您正苦于以下问题:Golang StatFSOp类的具体用法?Golang StatFSOp怎么用?Golang StatFSOp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StatFSOp类的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类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论