Commit 7e754013 authored by Kirill Smelkov's avatar Kirill Smelkov Committed by Han-Wen Nienhuys

nodefs: Drop unneecessary casts

- casting fuse.AttrOut.Attr to fuse.Attr is noop
- casting fileSystemMount.options.Owner to fuse.Owner is noop
- casting fuse.ReadIn.Context to fuse.Context is noop
parent 3342667f
...@@ -36,7 +36,7 @@ func (d *connectorDir) ReadDir(input *fuse.ReadIn, out *fuse.DirEntryList) (code ...@@ -36,7 +36,7 @@ func (d *connectorDir) ReadDir(input *fuse.ReadIn, out *fuse.DirEntryList) (code
// rewinddir() should be as if reopening directory. // rewinddir() should be as if reopening directory.
// TODO - test this. // TODO - test this.
if d.lastOffset > 0 && input.Offset == 0 { if d.lastOffset > 0 && input.Offset == 0 {
d.stream, code = d.node.OpenDir((*fuse.Context)(&input.Context)) d.stream, code = d.node.OpenDir(&input.Context)
if !code.Ok() { if !code.Ok() {
return code return code
} }
...@@ -72,7 +72,7 @@ func (d *connectorDir) ReadDirPlus(input *fuse.ReadIn, out *fuse.DirEntryList) ( ...@@ -72,7 +72,7 @@ func (d *connectorDir) ReadDirPlus(input *fuse.ReadIn, out *fuse.DirEntryList) (
// rewinddir() should be as if reopening directory. // rewinddir() should be as if reopening directory.
if d.lastOffset > 0 && input.Offset == 0 { if d.lastOffset > 0 && input.Offset == 0 {
d.stream, code = d.node.OpenDir((*fuse.Context)(&input.Context)) d.stream, code = d.node.OpenDir(&input.Context)
if !code.Ok() { if !code.Ok() {
return code return code
} }
......
...@@ -92,7 +92,7 @@ func (c *FileSystemConnector) verify() { ...@@ -92,7 +92,7 @@ func (c *FileSystemConnector) verify() {
// childLookup fills entry information for a newly created child inode // childLookup fills entry information for a newly created child inode
func (c *rawBridge) childLookup(out *fuse.EntryOut, n *Inode, context *fuse.Context) { func (c *rawBridge) childLookup(out *fuse.EntryOut, n *Inode, context *fuse.Context) {
n.Node().GetAttr((*fuse.Attr)(&out.Attr), nil, context) n.Node().GetAttr(&out.Attr, nil, context)
n.mount.fillEntry(out) n.mount.fillEntry(out)
out.NodeId, out.Generation = c.fsConn().lookupUpdate(n) out.NodeId, out.Generation = c.fsConn().lookupUpdate(n)
if out.Ino == 0 { if out.Ino == 0 {
......
...@@ -59,7 +59,7 @@ func (m *fileSystemMount) mountName() string { ...@@ -59,7 +59,7 @@ func (m *fileSystemMount) mountName() string {
func (m *fileSystemMount) setOwner(attr *fuse.Attr) { func (m *fileSystemMount) setOwner(attr *fuse.Attr) {
if m.options.Owner != nil { if m.options.Owner != nil {
attr.Owner = *(*fuse.Owner)(m.options.Owner) attr.Owner = *m.options.Owner
} }
} }
......
...@@ -134,7 +134,7 @@ func (c *rawBridge) GetAttr(input *fuse.GetAttrIn, out *fuse.AttrOut) (code fuse ...@@ -134,7 +134,7 @@ func (c *rawBridge) GetAttr(input *fuse.GetAttrIn, out *fuse.AttrOut) (code fuse
} }
} }
dest := (*fuse.Attr)(&out.Attr) dest := &out.Attr
code = node.fsInode.GetAttr(dest, f, &input.Context) code = node.fsInode.GetAttr(dest, f, &input.Context)
if !code.Ok() { if !code.Ok() {
return code return code
...@@ -253,7 +253,7 @@ func (c *rawBridge) SetAttr(input *fuse.SetAttrIn, out *fuse.AttrOut) (code fuse ...@@ -253,7 +253,7 @@ func (c *rawBridge) SetAttr(input *fuse.SetAttrIn, out *fuse.AttrOut) (code fuse
// Must call GetAttr(); the filesystem may override some of // Must call GetAttr(); the filesystem may override some of
// the changes we effect here. // the changes we effect here.
attr := (*fuse.Attr)(&out.Attr) attr := &out.Attr
code = node.fsInode.GetAttr(attr, nil, &input.Context) code = node.fsInode.GetAttr(attr, nil, &input.Context)
if code.Ok() { if code.Ok() {
node.mount.fillAttr(out, input.NodeId) node.mount.fillAttr(out, input.NodeId)
...@@ -279,7 +279,7 @@ func (c *rawBridge) Mknod(input *fuse.MknodIn, name string, out *fuse.EntryOut) ...@@ -279,7 +279,7 @@ func (c *rawBridge) Mknod(input *fuse.MknodIn, name string, out *fuse.EntryOut)
child, code := parent.fsInode.Mknod(name, input.Mode, uint32(input.Rdev), &input.Context) child, code := parent.fsInode.Mknod(name, input.Mode, uint32(input.Rdev), &input.Context)
if code.Ok() { if code.Ok() {
c.childLookup(out, child, &input.Context) c.childLookup(out, child, &input.Context)
code = child.fsInode.GetAttr((*fuse.Attr)(&out.Attr), nil, &input.Context) code = child.fsInode.GetAttr(&out.Attr, nil, &input.Context)
} }
return code return code
} }
...@@ -290,7 +290,7 @@ func (c *rawBridge) Mkdir(input *fuse.MkdirIn, name string, out *fuse.EntryOut) ...@@ -290,7 +290,7 @@ func (c *rawBridge) Mkdir(input *fuse.MkdirIn, name string, out *fuse.EntryOut)
child, code := parent.fsInode.Mkdir(name, input.Mode, &input.Context) child, code := parent.fsInode.Mkdir(name, input.Mode, &input.Context)
if code.Ok() { if code.Ok() {
c.childLookup(out, child, &input.Context) c.childLookup(out, child, &input.Context)
code = child.fsInode.GetAttr((*fuse.Attr)(&out.Attr), nil, &input.Context) code = child.fsInode.GetAttr(&out.Attr, nil, &input.Context)
} }
return code return code
} }
...@@ -311,7 +311,7 @@ func (c *rawBridge) Symlink(header *fuse.InHeader, pointedTo string, linkName st ...@@ -311,7 +311,7 @@ func (c *rawBridge) Symlink(header *fuse.InHeader, pointedTo string, linkName st
child, code := parent.fsInode.Symlink(linkName, pointedTo, &header.Context) child, code := parent.fsInode.Symlink(linkName, pointedTo, &header.Context)
if code.Ok() { if code.Ok() {
c.childLookup(out, child, &header.Context) c.childLookup(out, child, &header.Context)
code = child.fsInode.GetAttr((*fuse.Attr)(&out.Attr), nil, &header.Context) code = child.fsInode.GetAttr(&out.Attr, nil, &header.Context)
} }
return code return code
} }
...@@ -346,7 +346,7 @@ func (c *rawBridge) Link(input *fuse.LinkIn, name string, out *fuse.EntryOut) (c ...@@ -346,7 +346,7 @@ func (c *rawBridge) Link(input *fuse.LinkIn, name string, out *fuse.EntryOut) (c
child, code := parent.fsInode.Link(name, existing.fsInode, &input.Context) child, code := parent.fsInode.Link(name, existing.fsInode, &input.Context)
if code.Ok() { if code.Ok() {
c.childLookup(out, child, &input.Context) c.childLookup(out, child, &input.Context)
code = child.fsInode.GetAttr((*fuse.Attr)(&out.Attr), nil, &input.Context) code = child.fsInode.GetAttr(&out.Attr, nil, &input.Context)
} }
return code return code
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment