<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSVolume/KernelOffloadedIOHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(pl)FSVolumeKernelOffloadedIOHandler"
  },
  "title" : "FSVolume.KernelOffloadedIOHandler"
}
-->

# FSVolume.KernelOffloadedIOHandler

Methods and properties implemented by volumes that use kernel-offloaded I/O to achieve higher file transfer performance.

```
protocol KernelOffloadedIOHandler : NSObjectProtocol
```

## Overview

A volume that conforms to this protocol supplies file extent mappings to FSKit, which allows file data transfers to take place in the kernel.
This approach provides higher-performance data transfer than transferring all file data between the module and kernel, while still allowing the file system to run in user space.

This protocol uses *extents* to provide the kernel the logical-to-physical mapping of a given file.
An extent describes a physical offset on disk, and a length and a logical offset within the file.
You don’t manage extents directly.
Instead, FSKit provides you with an [`FSExtentPacker`](/documentation/FSKit/FSExtentPacker) to define and pack the extents in your implementations of this protocol’s methods.

Most volumes conform to either this protocol or [`FSVolume.ReadWriteHandler`](/documentation/FSKit/FSVolume/ReadWriteHandler).
You can conform to both if you need to provide kernel-offloaded I/O only for certain files.
In that case, files with the [`inhibitKernelOffloadedIO`](/documentation/FSKit/FSItem/Attribute/inhibitKernelOffloadedIO) attribute set use [`FSVolume.ReadWriteHandler`](/documentation/FSKit/FSVolume/ReadWriteHandler), and those without it use this protocol.
A volume that doesn’t conform to either protocol can’t support any file I/O operation.

> Important: This protocol replaces the ``doc://FSKit/documentation/FSKit/FSVolumeKernelOffloadedIOOperations`` protocol. It exposes the same functionality, while using ``doc://FSKit/documentation/FSKit/FSVolumeHandlerResult`` objects. These objects add the ability to reply with ``doc://FSKit/documentation/FSKit/FSItem/Attributes`` and free space from the relevant methods.

## Topics

### Performing mapped I/O

[`func blockmapFile(FSItem, offset: off_t, length: Int, flags: FSBlockmapFlags, operationID: FSOperationID, packer: FSExtentPacker, replyHandler: (FSBlockmapResult?, (any Error)?) -> Void)`](/documentation/FSKit/FSVolume/KernelOffloadedIOHandler/blockmapFile(_:offset:length:flags:operationID:packer:replyHandler:))

Maps a file’s disk space into extents, allowing the kernel to perform I/O with that space.

[`struct FSBlockmapFlags`](/documentation/FSKit/FSBlockmapFlags)

Flags that describe the behavior of a blockmap operation.

[`class FSBlockmapResult`](/documentation/FSKit/FSBlockmapResult)

The result of a blockmap call.

[`func completeIO(for: FSItem, offset: off_t, length: Int, status: any Error, flags: FSCompleteIOFlags, operationID: FSOperationID, replyHandler: (FSCompleteIOResult?, (any Error)?) -> Void)`](/documentation/FSKit/FSVolume/KernelOffloadedIOHandler/completeIO(for:offset:length:status:flags:operationID:replyHandler:))

Completes an I/O operation for a given file.

[`struct FSCompleteIOFlags`](/documentation/FSKit/FSCompleteIOFlags)

Flags that describe the behavior of an I/O completion operation.

[`class FSCompleteIOResult`](/documentation/FSKit/FSCompleteIOResult)

The result of a complete-I/O call.

### Working with items

[`func createFile(named: FSFileName, in: FSItem, attributes: FSItem.SetAttributesRequest, packer: FSExtentPacker, context: FSContext, replyHandler: (FSCreateFileKOIOResult?, (any Error)?) -> Void)`](/documentation/FSKit/FSVolume/KernelOffloadedIOHandler/createFile(named:in:attributes:packer:context:replyHandler:))

Creates a new file item and map its disk space.

[`class SetAttributesRequest`](/documentation/FSKit/FSItem/SetAttributesRequest)

A request to set attributes on an item.

[`class FSCreateFileKOIOResult`](/documentation/FSKit/FSCreateFileKOIOResult)

The result of a kernel-offloaded create-file call.

[`func lookupItem(named: FSFileName, in: FSItem, packer: FSExtentPacker, context: FSContext, replyHandler: (FSLookupItemKOIOResult?, (any Error)?) -> Void)`](/documentation/FSKit/FSVolume/KernelOffloadedIOHandler/lookupItem(named:in:packer:context:replyHandler:))

Looks up an item within a directory and maps its disk space.

[`class FSLookupItemKOIOResult`](/documentation/FSKit/FSLookupItemKOIOResult)

The result of a kernel-offloaded lookup-item call.

[`func preallocateSpace(for: FSItem, at: off_t, length: Int, flags: FSVolume.PreallocateFlags, packer: FSExtentPacker, context: FSContext, replyHandler: (FSPreallocateKOIOResult?, (any Error)?) -> Void)`](/documentation/FSKit/FSVolume/KernelOffloadedIOHandler/preallocateSpace(for:at:length:flags:packer:context:replyHandler:))

Preallocates and maps disk space for the given file.

[`struct PreallocateFlags`](/documentation/FSKit/FSVolume/PreallocateFlags)

Behavior flags for preallocation operations.

[`class FSPreallocateKOIOResult`](/documentation/FSKit/FSPreallocateKOIOResult)

The result of a kernel-offloaded preallocate call.

### Mapping file extents

[`class FSExtentPacker`](/documentation/FSKit/FSExtentPacker)

A type that directs the kernel to map space on disk to a specific file managed by this file system.

## Relationships

### Inherits From

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)