本文整理汇总了Golang中github.com/jacobsa/fuse/fuseops.OpenDirOp类的典型用法代码示例。如果您正苦于以下问题:Golang OpenDirOp类的具体用法?Golang OpenDirOp怎么用?Golang OpenDirOp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OpenDirOp类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: OpenDir
// LOCKS_EXCLUDED(fs.mu)
func (fs *fileSystem) OpenDir(
op *fuseops.OpenDirOp) (err error) {
fs.mu.Lock()
defer fs.mu.Unlock()
// Make sure the inode still exists and is a directory. If not, something has
// screwed up because the VFS layer shouldn't have let us forget the inode
// before opening it.
in := fs.inodes[op.Inode].(inode.DirInode)
// Allocate a handle.
handleID := fs.nextHandleID
fs.nextHandleID++
fs.handles[handleID] = newDirHandle(in, fs.implicitDirs)
op.Handle = handleID
return
}
示例2: OpenDir
func (fs *Goofys) OpenDir(
ctx context.Context,
op *fuseops.OpenDirOp) (err error) {
fs.mu.Lock()
handleID := fs.nextHandleID
fs.nextHandleID++
in := fs.getInodeOrDie(op.Inode)
fs.mu.Unlock()
// XXX/is this a dir?
dh := in.OpenDir()
fs.mu.Lock()
defer fs.mu.Unlock()
fs.dirHandles[handleID] = dh
op.Handle = handleID
return
}