Commit 5dac7ee0 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Rename CopyFileInfo() to Attr.FromFileInfo().

parent 727c7bbe
...@@ -64,7 +64,7 @@ func (me *fileSystemMount) fileInfoToEntry(fi *os.FileInfo) (out *EntryOut) { ...@@ -64,7 +64,7 @@ func (me *fileSystemMount) fileInfoToEntry(fi *os.FileInfo) (out *EntryOut) {
out = &EntryOut{} out = &EntryOut{}
splitNs(me.options.EntryTimeout, &out.EntryValid, &out.EntryValidNsec) splitNs(me.options.EntryTimeout, &out.EntryValid, &out.EntryValidNsec)
splitNs(me.options.AttrTimeout, &out.AttrValid, &out.AttrValidNsec) splitNs(me.options.AttrTimeout, &out.AttrValid, &out.AttrValidNsec)
CopyFileInfo(fi, &out.Attr) out.Attr.FromFileInfo(fi)
me.setOwner(&out.Attr) me.setOwner(&out.Attr)
if !fi.IsDirectory() && fi.Nlink == 0 { if !fi.IsDirectory() && fi.Nlink == 0 {
out.Nlink = 1 out.Nlink = 1
...@@ -74,7 +74,7 @@ func (me *fileSystemMount) fileInfoToEntry(fi *os.FileInfo) (out *EntryOut) { ...@@ -74,7 +74,7 @@ func (me *fileSystemMount) fileInfoToEntry(fi *os.FileInfo) (out *EntryOut) {
func (me *fileSystemMount) fileInfoToAttr(fi *os.FileInfo, nodeId uint64) (out *AttrOut) { func (me *fileSystemMount) fileInfoToAttr(fi *os.FileInfo, nodeId uint64) (out *AttrOut) {
out = &AttrOut{} out = &AttrOut{}
CopyFileInfo(fi, &out.Attr) out.Attr.FromFileInfo(fi)
splitNs(me.options.AttrTimeout, &out.AttrValid, &out.AttrValidNsec) splitNs(me.options.AttrTimeout, &out.AttrValid, &out.AttrValidNsec)
me.setOwner(&out.Attr) me.setOwner(&out.Attr)
out.Ino = nodeId out.Ino = nodeId
......
...@@ -55,7 +55,7 @@ func splitNs(time float64, secs *uint64, nsecs *uint32) { ...@@ -55,7 +55,7 @@ func splitNs(time float64, secs *uint64, nsecs *uint32) {
*secs = uint64(math.Trunc(time)) *secs = uint64(math.Trunc(time))
} }
func CopyFileInfo(fi *os.FileInfo, attr *Attr) { func (attr *Attr) FromFileInfo(fi *os.FileInfo) {
attr.Ino = uint64(fi.Ino) attr.Ino = uint64(fi.Ino)
attr.Size = uint64(fi.Size) attr.Size = uint64(fi.Size)
attr.Blocks = uint64(fi.Blocks) attr.Blocks = uint64(fi.Blocks)
......
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