'\" t .\" Title: debugfs_create_file .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: July 2017 .\" Manual: The debugfs filesystem .\" Source: Kernel Hackers Manual 4.11.6 .\" Language: English .\" .TH "DEBUGFS_CREATE_FILE" "9" "July 2017" "Kernel Hackers Manual 4\&.11\&" "The debugfs filesystem" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" debugfs_create_file \- create a file in the debugfs filesystem .SH "SYNOPSIS" .HP \w'struct\ dentry\ *\ debugfs_create_file('u .BI "struct dentry * debugfs_create_file(const\ char\ *\ " "name" ", umode_t\ " "mode" ", struct\ dentry\ *\ " "parent" ", void\ *\ " "data" ", const\ struct\ file_operations\ *\ " "fops" ");" .SH "ARGUMENTS" .PP \fIconst char * name\fR .RS 4 a pointer to a string containing the name of the file to create\&. .RE .PP \fIumode_t mode\fR .RS 4 the permission that the file should have\&. .RE .PP \fIstruct dentry * parent\fR .RS 4 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\&. .RE .PP \fIvoid * data\fR .RS 4 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 \fBopen\fR call\&. .RE .PP \fIconst struct file_operations * fops\fR .RS 4 a pointer to a struct file_operations that should be used for this file\&. .RE .SH "DESCRIPTION" .PP This is the basic \(lqcreate a file\(rq function for debugfs\&. It allows for a wide range of flexibility in creating a file, or a directory (if you want to create a directory, the \fBdebugfs_create_dir\fR function is recommended to be used instead\&.) .PP This function will return a pointer to a dentry if it succeeds\&. This pointer must be passed to the \fBdebugfs_remove\fR function when the file is to be removed (no automatic cleanup happens if your module is unloaded, you are responsible here\&.) If an error occurs, \fBNULL\fR will be returned\&. .PP If debugfs is not enabled in the kernel, the value \-\fBENODEV\fR will be returned\&. .SH "COPYRIGHT" .br