---
name: "debugfs_use_file_start"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/debugfs_use_file_start"
---

# debugfs\_use\_file\_start(9)

mark the beginning of file data access

## NAME

debugfs\_use\_file\_start - mark the beginning of file data access

## SYNOPSIS

**int debugfs\_use\_file\_start(const struct dentry \*** *dentry***, int \*** *srcu\_idx***);**

## ARGUMENTS

*dentry*

the dentry object whose data is being accessed.

*srcu\_idx*

a pointer to some memory to store a SRCU index in.

## DESCRIPTION

Up to a matching call to **debugfs\_use\_file\_finish**, any successive call into the file removing functions **debugfs\_remove** and **debugfs\_remove\_recursive** will block. Since associated private file data may only get freed after a successful return of any of the removal functions, you may safely access it after a successful call to **debugfs\_use\_file\_start** without worrying about lifetime issues.

If -**EIO** is returned, the file has already been removed and thus, it is not safe to access any of its data. If, on the other hand, it is allowed to access the file data, zero is returned.

Regardless of the return code, any call to **debugfs\_use\_file\_start** must be followed by a matching call to **debugfs\_use\_file\_finish**.

## COPYRIGHT
