github.com/pachyderm/pachyderm@v1.13.4/src/server/pfs/fuse/loopback_unix.go (about)

     1  // Copyright 2019 the Go-FUSE Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package fuse
     6  
     7  import (
     8  	"context"
     9  	"syscall"
    10  
    11  	"github.com/hanwen/go-fuse/v2/fs"
    12  	"golang.org/x/sys/unix"
    13  )
    14  
    15  func (n *loopbackNode) Getxattr(ctx context.Context, attr string, dest []byte) (uint32, syscall.Errno) {
    16  	sz, err := unix.Getxattr(n.path(), attr, dest)
    17  	return uint32(sz), fs.ToErrno(err)
    18  }
    19  
    20  func (n *loopbackNode) Setxattr(ctx context.Context, attr string, data []byte, flags uint32) syscall.Errno {
    21  	err := unix.Setxattr(n.path(), attr, data, int(flags))
    22  	return fs.ToErrno(err)
    23  }
    24  
    25  func (n *loopbackNode) Removexattr(ctx context.Context, attr string) syscall.Errno {
    26  	err := unix.Removexattr(n.path(), attr)
    27  	return fs.ToErrno(err)
    28  }
    29  
    30  func (n *loopbackNode) Listxattr(ctx context.Context, dest []byte) (uint32, syscall.Errno) {
    31  	sz, err := unix.Listxattr(n.path(), dest)
    32  	return uint32(sz), fs.ToErrno(err)
    33  }