<!--
{
  "availability" : [
    "macOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FSKit",
  "identifier" : "/documentation/FSKit/FSVolume/ItemDeactivationHandler/deactivateItem(_:context:replyHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "FSKit"
    ],
    "preciseIdentifier" : "c:objc(pl)FSVolumeItemDeactivationHandler(im)deactivateItem:context:replyHandler:"
  },
  "title" : "deactivateItem(_:context:replyHandler:)"
}
-->

# deactivateItem(_:context:replyHandler:)

Notifies the file system that the kernel is no longer making immediate use of the given item.

```
func deactivateItem(_ item: FSItem, context: FSContext, replyHandler reply: @escaping @Sendable (FSDeactivateItemResult?, (any Error)?) -> Void)
```

```
func deactivateItem(_ item: FSItem, context: FSContext) async throws -> FSDeactivateItemResult
```

## Parameters

`item`

The item to deactivate.

`context`

An object that enables context-aware file system decisions throughout the operation.

`reply`

A block or closure to indicate success or failure. If deactivation succeeds, pass an instance of [`FSDeactivateItemResult`](/documentation/FSKit/FSDeactivateItemResult) containing the volume’s updated free space, along with a `nil` error. If deactivation fails, pass the relevant error as the second parameter; FSKit ignores the [`FSDeactivateItemResult`](/documentation/FSKit/FSDeactivateItemResult) instance in this case. For an `async` Swift implementation, there’s no reply handler; simply return the result instance or throw an error.

## Discussion

This method gives a file system a chance to release resources associated with an item.
However, this method prescribes no specific action; it’s acceptable to defer all reclamation until [`reclaimItem(_:replyHandler:)`](/documentation/FSKit/FSVolume/Handler/reclaimItem(_:replyHandler:)).
This method is the equivalent of VFS’s `VNOP_INACTIVE`.

FSKit restricts calls to this method based on the current value of [`itemDeactivationPolicy`](/documentation/FSKit/FSVolume/ItemDeactivation/itemDeactivationPolicy).

---

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)