Fssysfsfilec

/* File needs write support.

* The inode's perms must say it's ok,

* and we must have a store method.

if (!(inode->i_mode & S_IWUGO) || !ops->store) goto err_out;

/* File needs read support.

* The inode's perms must say it's ok, and we there

* must be a show method for it.

if (!(inode->i_mode & S_IRUGO) || !ops->show) goto err_out;

After the kernel has chosen to allow the access, an instance of sysfs_buffer is allocated, filled in with the appropriate elements, and connected to the file via file->private_data as shown below:

Continue reading here: Fssysfsfilec

Was this article helpful?

0 0