1 64abb42a 2018-04-10 noreply package ufs
7 64abb42a 2018-04-10 noreply p9p "github.com/docker/go-p9p"
10 64abb42a 2018-04-10 noreply func dirFromInfo(info os.FileInfo) p9p.Dir {
11 64abb42a 2018-04-10 noreply dir := p9p.Dir{}
13 64abb42a 2018-04-10 noreply dir.Qid.Path = info.Sys().(*syscall.Stat_t).Ino
14 64abb42a 2018-04-10 noreply dir.Qid.Version = uint32(info.ModTime().UnixNano() / 1000000)
16 64abb42a 2018-04-10 noreply dir.Name = info.Name()
17 64abb42a 2018-04-10 noreply dir.Mode = uint32(info.Mode() & 0777)
18 64abb42a 2018-04-10 noreply dir.Length = uint64(info.Size())
19 64abb42a 2018-04-10 noreply dir.AccessTime = atime(info.Sys().(*syscall.Stat_t))
20 64abb42a 2018-04-10 noreply dir.ModTime = info.ModTime()
21 64abb42a 2018-04-10 noreply dir.MUID = "none"
23 64abb42a 2018-04-10 noreply if info.IsDir() {
24 64abb42a 2018-04-10 noreply dir.Qid.Type |= p9p.QTDIR
25 64abb42a 2018-04-10 noreply dir.Mode |= p9p.DMDIR
28 64abb42a 2018-04-10 noreply return dir
31 64abb42a 2018-04-10 noreply func oflags(mode p9p.Flag) int {
32 64abb42a 2018-04-10 noreply flags := 0
34 64abb42a 2018-04-10 noreply switch mode & 3 {
35 64abb42a 2018-04-10 noreply case p9p.OREAD:
36 64abb42a 2018-04-10 noreply flags = os.O_RDONLY
39 64abb42a 2018-04-10 noreply case p9p.ORDWR:
40 64abb42a 2018-04-10 noreply flags = os.O_RDWR
43 64abb42a 2018-04-10 noreply case p9p.OWRITE:
44 64abb42a 2018-04-10 noreply flags = os.O_WRONLY
47 64abb42a 2018-04-10 noreply case p9p.OEXEC:
48 64abb42a 2018-04-10 noreply flags = os.O_RDONLY
52 64abb42a 2018-04-10 noreply if mode&p9p.OTRUNC != 0 {
53 64abb42a 2018-04-10 noreply flags |= os.O_TRUNC
56 64abb42a 2018-04-10 noreply return flags