// LOCKS_EXCLUDED(fs.mu) func (fs *cachingFS) GetInodeAttributes( ctx context.Context, op *fuseops.GetInodeAttributesOp) (err error) { fs.mu.Lock() defer fs.mu.Unlock() // Figure out which inode the request is for. var attrs fuseops.InodeAttributes switch { case op.Inode == fuseops.RootInodeID: attrs = fs.rootAttrs() case op.Inode%numInodes == fooOffset: attrs = fs.fooAttrs() case op.Inode%numInodes == dirOffset: attrs = fs.dirAttrs() case op.Inode%numInodes == barOffset: attrs = fs.barAttrs() } // Fill in the response. op.Attributes = attrs op.AttributesExpiration = time.Now().Add(fs.getattrTimeout) return }
func (fs *statFS) GetInodeAttributes( ctx context.Context, op *fuseops.GetInodeAttributesOp) (err error) { switch op.Inode { case fuseops.RootInodeID: op.Attributes = dirAttrs() case childInodeID: op.Attributes = fileAttrs() default: err = fuse.ENOENT } return }
func (fs *InterruptFS) GetInodeAttributes( op *fuseops.GetInodeAttributesOp) (err error) { switch op.Inode { case fuseops.RootInodeID: op.Attributes = rootAttrs case fooID: op.Attributes = fooAttrs default: err = fmt.Errorf("Unexpected inode ID: %v", op.Inode) return } return }
// GetInodeAttributes set attributes for a specified Node. // // Required for fuse.FileSystem. func (k *KodingNetworkFS) GetInodeAttributes(ctx context.Context, op *fuseops.GetInodeAttributesOp) error { entry, err := k.getEntry(ctx, op.Inode) if err != nil { return err } op.Attributes = *entry.GetAttrs() return nil }
func (fs *Goofys) GetInodeAttributes( ctx context.Context, op *fuseops.GetInodeAttributesOp) (err error) { fs.mu.Lock() inode := fs.getInodeOrDie(op.Inode) fs.mu.Unlock() attr, err := inode.GetAttributes(fs) op.Attributes = *attr op.AttributesExpiration = time.Now().Add(365 * 24 * time.Hour) return }
func (fs *flushFS) GetInodeAttributes( op *fuseops.GetInodeAttributesOp) (err error) { fs.mu.Lock() defer fs.mu.Unlock() switch op.Inode { case fuseops.RootInodeID: op.Attributes = fs.rootAttributes() return case fooID: op.Attributes = fs.fooAttributes() return case barID: op.Attributes = fs.barAttributes() return default: err = fuse.ENOENT return } }
func (fs *fsImpl) GetInodeAttributes( ctx context.Context, op *fuseops.GetInodeAttributesOp) (err error) { fs.mu.Lock() defer fs.mu.Unlock() // Find the inode, verifying that it has not been forgotten. in := fs.findInodeByID(op.Inode) // Return appropriate attributes. op.Attributes = in.attributes return }
func (fs *memFS) GetInodeAttributes( op *fuseops.GetInodeAttributesOp) (err error) { fs.mu.Lock() defer fs.mu.Unlock() // Grab the inode. inode := fs.getInodeOrDie(op.Inode) // Fill in the response. op.Attributes = inode.attrs // We don't spontaneously mutate, so the kernel can cache as long as it wants // (since it also handles invalidation). op.AttributesExpiration = fs.clock.Now().Add(365 * 24 * time.Hour) return }
func (fs *helloFS) GetInodeAttributes( op *fuseops.GetInodeAttributesOp) (err error) { // Find the info for this inode. info, ok := gInodeInfo[op.Inode] if !ok { err = fuse.ENOENT return } // Copy over its attributes. op.Attributes = info.attributes // Patch attributes. fs.patchAttributes(&op.Attributes) return }