---
name: "debugfs_create_file_unsafe"
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_create_file_unsafe"
---

# debugfs\_create\_file\_unsafe(9)

create a file in the debugfs filesystem

## NAME

debugfs\_create\_file\_unsafe - create a file in the debugfs filesystem

## SYNOPSIS

**struct dentry \* debugfs\_create\_file\_unsafe(const char \*** *name***, umode\_t** *mode***, struct dentry \*** *parent***, void \*** *data***, const struct file\_operations \*** *fops***);**

## ARGUMENTS

*name*

a pointer to a string containing the name of the file to create.

*mode*

the permission that the file should have.

*parent*

a pointer to the parent dentry for this file. This should be a directory dentry if set. If this parameter is NULL, then the file will be created in the root of the debugfs filesystem.

*data*

a pointer to something that the caller will want to get to later on. The inode.i\_private pointer will point to this value on the **open** call.

*fops*

a pointer to a struct file\_operations that should be used for this file.

## DESCRIPTION

**debugfs\_create\_file\_unsafe** is completely analogous to **debugfs\_create\_file**, the only difference being that the fops handed it will not get protected against file removals by the debugfs core.

It is your responsibility to protect your struct file\_operation methods against file removals by means of **debugfs\_use\_file\_start** and **debugfs\_use\_file\_finish**. -\>**open** is still protected by debugfs though.

Any struct file\_operations defined by means of **DEFINE\_DEBUGFS\_ATTRIBUTE** is protected against file removals and thus, may be used here.

## COPYRIGHT
