---
title: "deactivateItem(_:context:replyHandler:)"
framework: fskit
role: symbol
role_heading: Instance Method
path: "fskit/fsvolume/itemdeactivationhandler/deactivateitem(_:context:replyhandler:)"
---

# deactivateItem(_:context:replyHandler:)

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

## Declaration

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

```swift
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 doc://FSKit/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 doc://FSKit/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

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:). This method is the equivalent of VFS’s VNOP_INACTIVE. FSKit restricts calls to this method based on the current value of itemDeactivationPolicy.

## See Also

### Deactivating an item

- [FSDeactivateItemResult](fskit/fsdeactivateitemresult.md)
