fs: debugfs: Add write functionality to debugfs blobs
authorAvadhut Naik <Avadhut.Naik@amd.com>
Thu, 16 Nov 2023 22:47:23 +0000 (16:47 -0600)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 21 Nov 2023 20:10:44 +0000 (21:10 +0100)
commit71cd3c636404ceb08226b5095ca36a04eb578ca1
tree6359d5ced02f0e69c796f4690262d362dd7f8868
parent709f3cbd652e50e96a9d9c62a300313b636e3f6f
fs: debugfs: Add write functionality to debugfs blobs

Currently, debugfs_create_blob() creates read-only debugfs binary blob
files.

In some cases, however, userspace tools need to write variable length
data structures into predetermined memory addresses. An example is when
injecting Vendor-defined error types through the einj module. In such
cases, the functionality to write to these blob files in debugfs would
be desired since the mapping aspect can be handled within the modules
with userspace tools only needing to write into the blob files.

Implement a write callback to enable writing to these blob files, created
in debugfs, by owners only.

Signed-off-by: Avadhut Naik <Avadhut.Naik@amd.com>
Reviewed-by: Alexey Kardashevskiy <aik@amd.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
fs/debugfs/file.c