本文整理汇总了Golang中github.com/jbooth/maggiefs/maggiefs.Inode.FullMode方法的典型用法代码示例。如果您正苦于以下问题:Golang Inode.FullMode方法的具体用法?Golang Inode.FullMode怎么用?Golang Inode.FullMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/jbooth/maggiefs/maggiefs.Inode
的用法示例。
在下文中一共展示了Inode.FullMode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: fillEntryOut
func fillEntryOut(out *raw.EntryOut, i *maggiefs.Inode) {
// fill out
out.NodeId = i.Inodeid
out.Generation = i.Generation
out.EntryValid = uint64(0)
out.AttrValid = uint64(0)
out.EntryValidNsec = uint32(100)
out.AttrValidNsec = uint32(100)
//Inode
out.Ino = i.Inodeid
out.Size = i.Length
out.Blocks = numBlocks(i.Length, maggiefs.PAGESIZE)
out.Atime = uint64(0) // always 0 for atime
out.Mtime = uint64(i.Mtime) // Mtime is user modifiable and is the last time data changed
out.Ctime = uint64(i.Ctime) // Ctime is tracked by the FS and changes when attrs or data change
out.Atimensec = uint32(0)
out.Mtimensec = uint32(0)
out.Ctimensec = uint32(0)
out.Mode = i.FullMode()
out.Nlink = i.Nlink
out.Uid = i.Uid
out.Gid = i.Gid
out.Rdev = uint32(0) // regular file, not block dvice
out.Blksize = maggiefs.PAGESIZE
}
示例2: fillAttrOut
func fillAttrOut(out *raw.AttrOut, i *maggiefs.Inode) {
// raw.Attr
out.Ino = i.Inodeid
out.Size = i.Length
out.Blocks = numBlocks(i.Length, maggiefs.PAGESIZE)
out.Atime = uint64(0) // always 0 for atime
out.Mtime = uint64(i.Mtime) // Mtime is user modifiable and is the last time data changed
out.Ctime = uint64(i.Ctime) // Ctime is tracked by the FS and changes when attrs or data change
out.Atimensec = uint32(0)
out.Mtimensec = uint32(0)
out.Ctimensec = uint32(0)
out.Mode = i.FullMode()
out.Nlink = i.Nlink
out.Uid = i.Uid
out.Gid = i.Gid
out.Rdev = uint32(0) // regular file, not block dvice
out.Blksize = maggiefs.PAGESIZE
// raw.AttrOut
out.AttrValid = uint64(0)
out.AttrValidNsec = uint32(100)
fmt.Printf("Filled attrOut %v with inode %v\n", out, i)
}