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