FAllocate Event

Fires when the OS needs to allocate space for an open file.

Syntax

public class DefaultFuseEventListener implements FuseEventListener {
  ...
  public void FAllocate(FuseFAllocateEvent e) {}
  ...
}

public class FuseFAllocateEvent {
  public String path;
  public int fileContext;
  public int mode;
  public long offset;
  public long length;
  public int result;
}

Remarks

This event fires when the OS needs to allocate and zeroize space for an open file, which is identified by FileContext. The Path parameter contains the name of the file.

The allocation size of the file must be the greater of Offset+Length and current file size. The actual file size must be adjusted to match the new allocation size unless the Mode parameter includes the value 1 (FALLOC_FL_KEEP_SIZE).

Linux: The OS may send additional flags in the Mode parameter to manipulate file contents.

The range of the file data to zeroize starts from Offset and occupies Length bytes.

The event handler must ensure that the required space is allocated for specified file. If the event handler returns success then any subsequent write request to specified range must be guaranteed not to fail because of lack of space in the backend storage.

The ResultCode parameter will always be 0 when the event is fired. If the event cannot be handled in a "successful" manner for some reason (e.g., a resource isn't available, security checks failed, etc.), set it to a negative error code value (e.g. -ENOENT to indicate that the file does not exist) to report an appropriate error. Please refer to the Error Reporting and Handling topic for more information.

Copyright (c) 2022 Callback Technologies, Inc. - All rights reserved.
CBFS FUSE 2020 Java Edition - Version 20.0 [Build 8348]