Programming Interface

Since the debugfs code is very clean, simple, and well documented, it is not necessary to add remarks about the implementation. It suffices to discuss the programming interface. However, have a look at the source code, which is a very nice application of the libfs routines.

Three functions are available to create new filesystem objects:


struct dentry *debugfs_create_file(const char *name, mode_t mode, struct dentry *parent, void *data, const struct file_operations *fops);

struct dentry *debugfs_create_dir(const char *name, struct dentry *parent);

struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, const char *dest);

Unsurprisingly, a filesystem object can either be a regular file, a directory, or a symbolic link. Two additional operations allow for renaming and removing files:

Continue reading here: Info

Was this article helpful?

0 0