I've managed to successfully create a dentry
in the matching path, but now how do I actually write there?
struct dentry* log_dir = debugfs_create_dir ("my_module", NULL);
struct dentry* log_file = debugfs_create_dir ("log", 0777, log_dir, NULL, NULL);
I'd say the best reference for what you need to do would be the debugfs.txt documentation file within the kernel source tree.
I also assume you made a mistake in your code sample here:
Since it looks like you're trying to create a file, not another directory. So I guess what you wanted to do is more like this:
where log_fops would maybe be something like this:
And, of course you'd also need to implement your log_read and log_write functions: