本文整理汇总了Golang中github.com/jacobsa/fuse/fuseops.GetInodeAttributesOp类的典型用法代码示例。如果您正苦于以下问题:Golang GetInodeAttributesOp类的具体用法?Golang GetInodeAttributesOp怎么用?Golang GetInodeAttributesOp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GetInodeAttributesOp类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: GetInodeAttributes
// LOCKS_EXCLUDED(fs.mu)
func (fs *cachingFS) GetInodeAttributes(
ctx context.Context,
op *fuseops.GetInodeAttributesOp) (err error) {
fs.mu.Lock()
defer fs.mu.Unlock()
// Figure out which inode the request is for.
var attrs fuseops.InodeAttributes
switch {
case op.Inode == fuseops.RootInodeID:
attrs = fs.rootAttrs()
case op.Inode%numInodes == fooOffset:
attrs = fs.fooAttrs()
case op.Inode%numInodes == dirOffset:
attrs = fs.dirAttrs()
case op.Inode%numInodes == barOffset:
attrs = fs.barAttrs()
}
// Fill in the response.
op.Attributes = attrs
op.AttributesExpiration = time.Now().Add(fs.getattrTimeout)
return
}
开发者ID:andrewgaul,项目名称:fuse,代码行数:30,代码来源:caching_fs.go
示例2: GetInodeAttributes
func (fs *Goofys) GetInodeAttributes(
ctx context.Context,
op *fuseops.GetInodeAttributesOp) (err error) {
fs.mu.Lock()
inode := fs.getInodeOrDie(op.Inode)
fs.mu.Unlock()
attr, err := inode.GetAttributes(fs)
op.Attributes = *attr
op.AttributesExpiration = time.Now().Add(365 * 24 * time.Hour)
return
}
开发者ID:ketqi,项目名称:goofys,代码行数:14,代码来源:goofys.go
示例3: GetInodeAttributes
func (fs *statFS) GetInodeAttributes(
ctx context.Context,
op *fuseops.GetInodeAttributesOp) (err error) {
switch op.Inode {
case fuseops.RootInodeID:
op.Attributes = dirAttrs()
case childInodeID:
op.Attributes = fileAttrs()
default:
err = fuse.ENOENT
}
return
}
开发者ID:andrewgaul,项目名称:fuse,代码行数:16,代码来源:statfs.go
示例4: GetInodeAttributes
func (fs *InterruptFS) GetInodeAttributes(
op *fuseops.GetInodeAttributesOp) (err error) {
switch op.Inode {
case fuseops.RootInodeID:
op.Attributes = rootAttrs
case fooID:
op.Attributes = fooAttrs
default:
err = fmt.Errorf("Unexpected inode ID: %v", op.Inode)
return
}
return
}
开发者ID:BanzaiMan,项目名称:gcsfuse,代码行数:16,代码来源:interrupt_fs.go
示例5: GetInodeAttributes
func (fs *memFS) GetInodeAttributes(
op *fuseops.GetInodeAttributesOp) (err error) {
fs.mu.Lock()
defer fs.mu.Unlock()
// Grab the inode.
inode := fs.getInodeOrDie(op.Inode)
// Fill in the response.
op.Attributes = inode.attrs
// We don't spontaneously mutate, so the kernel can cache as long as it wants
// (since it also handles invalidation).
op.AttributesExpiration = fs.clock.Now().Add(365 * 24 * time.Hour)
return
}
开发者ID:BanzaiMan,项目名称:gcsfuse,代码行数:17,代码来源:memfs.go
示例6: GetInodeAttributes
// LOCKS_EXCLUDED(fs.mu)
func (fs *fileSystem) GetInodeAttributes(
op *fuseops.GetInodeAttributesOp) (err error) {
// Find the inode.
fs.mu.Lock()
in := fs.inodes[op.Inode]
fs.mu.Unlock()
in.Lock()
defer in.Unlock()
// Grab its attributes.
op.Attributes, err = in.Attributes(op.Context())
if err != nil {
return
}
return
}
开发者ID:mbookman,项目名称:gcsfuse,代码行数:19,代码来源:fs.go
示例7: GetInodeAttributes
// GetInodeAttributes set attributes for a specified Node.
//
// Required for fuse.FileSystem.
func (k *KodingNetworkFS) GetInodeAttributes(ctx context.Context, op *fuseops.GetInodeAttributesOp) error {
entry, err := k.getEntry(ctx, op.Inode)
if err != nil {
return err
}
op.Attributes = *entry.GetAttrs()
return nil
}
开发者ID:koding,项目名称:koding,代码行数:13,代码来源:kodingnetworkfs.go
示例8: GetInodeAttributes
func (fs *flushFS) GetInodeAttributes(
op *fuseops.GetInodeAttributesOp) (err error) {
fs.mu.Lock()
defer fs.mu.Unlock()
switch op.Inode {
case fuseops.RootInodeID:
op.Attributes = fs.rootAttributes()
return
case fooID:
op.Attributes = fs.fooAttributes()
return
case barID:
op.Attributes = fs.barAttributes()
return
default:
err = fuse.ENOENT
return
}
}
开发者ID:BanzaiMan,项目名称:gcsfuse,代码行数:23,代码来源:flush_fs.go
示例9: GetInodeAttributes
func (fs *fsImpl) GetInodeAttributes(
ctx context.Context,
op *fuseops.GetInodeAttributesOp) (err error) {
fs.mu.Lock()
defer fs.mu.Unlock()
// Find the inode, verifying that it has not been forgotten.
in := fs.findInodeByID(op.Inode)
// Return appropriate attributes.
op.Attributes = in.attributes
return
}
开发者ID:andrewgaul,项目名称:fuse,代码行数:14,代码来源:forget_fs.go
示例10: GetInodeAttributes
func (fs *helloFS) GetInodeAttributes(
op *fuseops.GetInodeAttributesOp) (err error) {
// Find the info for this inode.
info, ok := gInodeInfo[op.Inode]
if !ok {
err = fuse.ENOENT
return
}
// Copy over its attributes.
op.Attributes = info.attributes
// Patch attributes.
fs.patchAttributes(&op.Attributes)
return
}
开发者ID:BanzaiMan,项目名称:gcsfuse,代码行数:17,代码来源:hello_fs.go
注:本文中的github.com/jacobsa/fuse/fuseops.GetInodeAttributesOp类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论