github.com/scaleoutsean/fusego@v0.0.0-20220224074057-4a6429e46bb8/internal/fusekernel/fuse_kernel_darwin.go (about)

     1  package fusekernel
     2  
     3  import (
     4  	"time"
     5  )
     6  
     7  type Attr struct {
     8  	Ino        uint64
     9  	Size       uint64
    10  	Blocks     uint64
    11  	Atime      uint64
    12  	Mtime      uint64
    13  	Ctime      uint64
    14  	Crtime_    uint64 // OS X only
    15  	AtimeNsec  uint32
    16  	MtimeNsec  uint32
    17  	CtimeNsec  uint32
    18  	CrtimeNsec uint32 // OS X only
    19  	Mode       uint32
    20  	Nlink      uint32
    21  	Uid        uint32
    22  	Gid        uint32
    23  	Rdev       uint32
    24  	Flags_     uint32 // OS X only; see chflags(2)
    25  	Blksize    uint32
    26  	padding    uint32
    27  }
    28  
    29  func (a *Attr) SetCrtime(s uint64, ns uint32) {
    30  	a.Crtime_, a.CrtimeNsec = s, ns
    31  }
    32  
    33  func (a *Attr) SetFlags(f uint32) {
    34  	a.Flags_ = f
    35  }
    36  
    37  type SetattrIn struct {
    38  	setattrInCommon
    39  
    40  	// OS X only
    41  	Bkuptime_    uint64
    42  	Chgtime_     uint64
    43  	Crtime       uint64
    44  	BkuptimeNsec uint32
    45  	ChgtimeNsec  uint32
    46  	CrtimeNsec   uint32
    47  	Flags_       uint32 // see chflags(2)
    48  }
    49  
    50  func (in *SetattrIn) BkupTime() time.Time {
    51  	return time.Unix(int64(in.Bkuptime_), int64(in.BkuptimeNsec))
    52  }
    53  
    54  func (in *SetattrIn) Chgtime() time.Time {
    55  	return time.Unix(int64(in.Chgtime_), int64(in.ChgtimeNsec))
    56  }
    57  
    58  func (in *SetattrIn) Flags() uint32 {
    59  	return in.Flags_
    60  }
    61  
    62  func openFlags(flags uint32) OpenFlags {
    63  	return OpenFlags(flags)
    64  }
    65  
    66  type GetxattrIn struct {
    67  	getxattrInCommon
    68  
    69  	// OS X only
    70  	Position uint32
    71  	Padding  uint32
    72  }
    73  
    74  func (g *GetxattrIn) GetPosition() uint32 {
    75  	return g.Position
    76  }
    77  
    78  type SetxattrIn struct {
    79  	setxattrInCommon
    80  
    81  	// OS X only
    82  	Position uint32
    83  	Padding  uint32
    84  }
    85  
    86  func (s *SetxattrIn) GetPosition() uint32 {
    87  	return s.Position
    88  }