Exemple #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
}
Exemple #2
0
// 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
}