]> git.hungrycats.org Git - linux/commit
sysfs: add initial support for binary files.
authorPatrick Mochel <mochel@osdl.org>
Fri, 31 Jan 2003 12:24:50 +0000 (06:24 -0600)
committerPatrick Mochel <mochel@osdl.org>
Fri, 31 Jan 2003 12:24:50 +0000 (06:24 -0600)
commit21c8dcc7ac693f07abf82b5ddbeb032044dbf7a9
tree9fc9c104b5c3c6f73bda5cee8926cff73be8ccab
parent3ca5999f8eda30227b36183f9134e82bef084790
sysfs: add initial support for binary files.

Yes, binary files. But before you scream in angst, please realize that they
do have a marked purpose for exporting certain types of data from the kernel.

Basically, they are for exporting blobs of data that likely have some structure,
but that the kernel has no control over. This includes VPD data from device
headers, EDD data, or CPU microcode. Instead of parsing the data, then
formatting in a certain way, only so userspace can parse the data again, we
just shove it out in a binary blob to userspace, and let them deal with it.

Anyway, it defines a struct bin_attribute, with read() and write() methods
for the data. A read call should set the pointer in the sysfs_bin_buffer
object that is passed in.

A write call receives a buffer ptr, too, and must obey the count/offset
fields for correct data.
fs/sysfs/Makefile
fs/sysfs/bin.c [new file with mode: 0644]
include/linux/sysfs.h