Commit Graph

6 Commits

Author SHA1 Message Date
Zach Brown
717b56698a Remove __exit from scoutfs_sysfs_exit()
scoutfs_sysfs_exit() is called during error handling in module init.
When scoutfs is built-in (so, never.) the __exit section won't be
loaded.  Remove the __exit annotation so it's always available to be
called.

Signed-off-by: Zach Brown <zab@versity.com>
2022-10-26 16:42:27 -07:00
Zach Brown
2dde729791 Add sysfs create attr w/ parent
Add sysfs attribute creation that can provide the parent dir kobject
instead of always creating the sysfs object dir off of the main
per-mount dir.

Signed-off-by: Zach Brown <zab@versity.com>
2021-05-26 14:18:19 -07:00
Zach Brown
ccb7c0bf4b Add rw sysfs attr wrapper
Add a wrapper around __ATTR_RW so that callers can add attributes with a
_store function.

Signed-off-by: Zach Brown <zab@versity.com>
2021-05-26 14:18:07 -07:00
Zach Brown
a239f6093d scoutfs: add mount_options/ sysfs dir
Add a directory per mount that shows the values of all the mount
options.

Signed-off-by: Zach Brown <zab@versity.com>
2019-06-05 14:30:11 -07:00
Zach Brown
2cc4f89ad5 scoutfs: add sysfs attrs wrappers
Add some helpers to manage the lifetime of groups of attributes in
sysfs.  We can wait until the sysfs files are no longer in use
before tearing down the data that they rely on.

Signed-off-by: Zach Brown <zab@versity.com>
2019-05-30 13:51:02 -07:00
Zach Brown
e354fd18b1 scoutfs: add sysfs.c, fsid file
I wanted to add a sysfs file that exports the fsid for the mount of a
given device.  But our use of sysfs was confusing and spread through
super.c and counters.c.

This moves the core of our sysfs use to sysfs.c.  Instead of defining
the per-mount dir as a kset we define it as an object with attributes
which gives us a place to add an fsid attribute.

counters still have their own whack of sysfs implementation.  We'll let
it keep it for now but we could move it into sysfs.c.  It's just counter
interation around the insane sysfs obj/attr/type nonsense.  For now it
just needs to know to add its counters dir as a child of the per-mount
dir instead of adding it to the kset.

Signed-off-by: Zach Brown <zab@versity.com>
2017-12-20 12:21:13 -08:00