xref: /freebsd/sys/compat/linuxkpi/common/include/linux/debugfs.h (revision 307f78f3ed90a4145eeb2c8cc79bc95b2666f57a)
13f6cab07SMatt Macy /*-
23f6cab07SMatt Macy  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
33f6cab07SMatt Macy  *
43f6cab07SMatt Macy  * Copyright (c) 2016-2018, Matthew Macy <mmacy@freebsd.org>
53f6cab07SMatt Macy  *
63f6cab07SMatt Macy  * Redistribution and use in source and binary forms, with or without
73f6cab07SMatt Macy  * modification, are permitted provided that the following conditions
83f6cab07SMatt Macy  * are met:
93f6cab07SMatt Macy  * 1. Redistributions of source code must retain the above copyright
103f6cab07SMatt Macy  *    notice, this list of conditions and the following disclaimer.
113f6cab07SMatt Macy  * 2. Redistributions in binary form must reproduce the above copyright
123f6cab07SMatt Macy  *    notice, this list of conditions and the following disclaimer in the
133f6cab07SMatt Macy  *    documentation and/or other materials provided with the distribution.
143f6cab07SMatt Macy  *
153f6cab07SMatt Macy  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
163f6cab07SMatt Macy  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
173f6cab07SMatt Macy  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
183f6cab07SMatt Macy  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
193f6cab07SMatt Macy  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
203f6cab07SMatt Macy  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
213f6cab07SMatt Macy  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
223f6cab07SMatt Macy  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
233f6cab07SMatt Macy  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
243f6cab07SMatt Macy  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
253f6cab07SMatt Macy  * SUCH DAMAGE.
263f6cab07SMatt Macy  *
273f6cab07SMatt Macy  * $FreeBSD$
283f6cab07SMatt Macy  */
293f6cab07SMatt Macy 
30*307f78f3SVladimir Kondratyev #ifndef _LINUXKPI_LINUX_DEBUGFS_H_
31*307f78f3SVladimir Kondratyev #define _LINUXKPI_LINUX_DEBUGFS_H_
323f6cab07SMatt Macy 
333f6cab07SMatt Macy #include <linux/fs.h>
343f6cab07SMatt Macy #include <linux/seq_file.h>
353f6cab07SMatt Macy 
363f6cab07SMatt Macy #include <linux/types.h>
373f6cab07SMatt Macy 
383f6cab07SMatt Macy void debugfs_remove(struct dentry *dentry);
393f6cab07SMatt Macy 
403f6cab07SMatt Macy struct dentry *debugfs_create_file(const char *name, umode_t mode,
413f6cab07SMatt Macy 				   struct dentry *parent, void *data,
423f6cab07SMatt Macy 				   const struct file_operations *fops);
433f6cab07SMatt Macy 
443f6cab07SMatt Macy struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);
453f6cab07SMatt Macy 
463f6cab07SMatt Macy struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
473f6cab07SMatt Macy 				      const char *dest);
483f6cab07SMatt Macy 
493f6cab07SMatt Macy void debugfs_remove_recursive(struct dentry *dentry);
503f6cab07SMatt Macy 
513f6cab07SMatt Macy #endif
52