lookUpInodeOp
parent
f0bdfc203b
commit
bf3dd28ec8
44
ops.go
44
ops.go
|
@ -20,51 +20,29 @@ import (
|
||||||
"time"
|
"time"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
"github.com/jacobsa/fuse/fuseops"
|
||||||
"github.com/jacobsa/fuse/internal/buffer"
|
"github.com/jacobsa/fuse/internal/buffer"
|
||||||
"github.com/jacobsa/fuse/internal/fusekernel"
|
"github.com/jacobsa/fuse/internal/fusekernel"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type internalOp struct {
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// Inodes
|
// Inodes
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Look up a child by name within a parent directory. The kernel sends this
|
type lookUpInodeOp struct {
|
||||||
// when resolving user paths to dentry structs, which are then cached.
|
internalOp
|
||||||
type LookUpInodeOp struct {
|
wrapped fuseops.LookUpInodeOp
|
||||||
commonOp
|
|
||||||
protocol fusekernel.Protocol
|
|
||||||
|
|
||||||
// The ID of the directory inode to which the child belongs.
|
|
||||||
Parent InodeID
|
|
||||||
|
|
||||||
// The name of the child of interest, relative to the parent. For example, in
|
|
||||||
// this directory structure:
|
|
||||||
//
|
|
||||||
// foo/
|
|
||||||
// bar/
|
|
||||||
// baz
|
|
||||||
//
|
|
||||||
// the file system may receive a request to look up the child named "bar" for
|
|
||||||
// the parent foo/.
|
|
||||||
Name string
|
|
||||||
|
|
||||||
// The resulting entry. Must be filled out by the file system.
|
|
||||||
//
|
|
||||||
// The lookup count for the inode is implicitly incremented. See notes on
|
|
||||||
// ForgetInodeOp for more information.
|
|
||||||
Entry ChildInodeEntry
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *LookUpInodeOp) ShortDesc() (desc string) {
|
func (o *lookUpInodeOp) kernelResponse(
|
||||||
desc = fmt.Sprintf("LookUpInode(parent=%v, name=%q)", o.Parent, o.Name)
|
protocol fusekernel.Protocol) (b buffer.OutMessage) {
|
||||||
return
|
size := fusekernel.EntryOutSize(protocol)
|
||||||
}
|
|
||||||
|
|
||||||
func (o *LookUpInodeOp) kernelResponse() (b buffer.OutMessage) {
|
|
||||||
size := fusekernel.EntryOutSize(o.protocol)
|
|
||||||
b = buffer.NewOutMessage(size)
|
b = buffer.NewOutMessage(size)
|
||||||
out := (*fusekernel.EntryOut)(b.Grow(size))
|
out := (*fusekernel.EntryOut)(b.Grow(size))
|
||||||
convertChildInodeEntry(&o.Entry, out)
|
convertChildInodeEntry(&o.wrapped.Entry, out)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue