示例#1
0
func (fs *memFS) ReadSymlink(
	op *fuseops.ReadSymlinkOp) (err error) {
	fs.mu.Lock()
	defer fs.mu.Unlock()

	// Find the inode in question.
	inode := fs.getInodeOrDie(op.Inode)

	// Serve the request.
	op.Target = inode.target

	return
}
示例#2
0
文件: fs.go 项目: mbookman/gcsfuse
// LOCKS_EXCLUDED(fs.mu)
func (fs *fileSystem) ReadSymlink(
	op *fuseops.ReadSymlinkOp) (err error) {
	// Find the inode.
	fs.mu.Lock()
	in := fs.inodes[op.Inode].(*inode.SymlinkInode)
	fs.mu.Unlock()

	in.Lock()
	defer in.Unlock()

	// Serve the request.
	op.Target = in.Target()

	return
}