From: Brian Foster <bfoster@redhat.com>
To: xfs@oss.sgi.com
Subject: [PATCH 2/6] xfs: add a sysfs kset
Date: Fri, 6 Jun 2014 09:13:30 -0400 [thread overview]
Message-ID: <1402060414-22075-3-git-send-email-bfoster@redhat.com> (raw)
In-Reply-To: <1402060414-22075-1-git-send-email-bfoster@redhat.com>
Create a sysfs kset to contain all sub-objects associated with the XFS
module. The kset is created and removed on module initialization and
removal respectively. The kset uses fs_obj as a parent. This leads to
the creation of a /sys/fs/xfs directory when the kset exists.
Signed-off-by: Brian Foster <bfoster@redhat.com>
---
fs/xfs/xfs_super.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 8f0333b..1766214 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -61,6 +61,7 @@
static const struct super_operations xfs_super_operations;
static kmem_zone_t *xfs_ioend_zone;
mempool_t *xfs_ioend_pool;
+struct kset *xfs_kset;
#define MNTOPT_LOGBUFS "logbufs" /* number of XFS log buffers */
#define MNTOPT_LOGBSIZE "logbsize" /* size of XFS log buffers */
@@ -1761,9 +1762,15 @@ init_xfs_fs(void)
if (error)
goto out_cleanup_procfs;
+ xfs_kset = kset_create_and_add("xfs", NULL, fs_kobj);
+ if (!xfs_kset) {
+ error = -ENOMEM;
+ goto out_sysctl_unregister;;
+ }
+
error = xfs_qm_init();
if (error)
- goto out_sysctl_unregister;
+ goto out_kset_unregister;
error = register_filesystem(&xfs_fs_type);
if (error)
@@ -1772,6 +1779,8 @@ init_xfs_fs(void)
out_qm_exit:
xfs_qm_exit();
+ out_kset_unregister:
+ kset_unregister(xfs_kset);
out_sysctl_unregister:
xfs_sysctl_unregister();
out_cleanup_procfs:
@@ -1793,6 +1802,7 @@ exit_xfs_fs(void)
{
xfs_qm_exit();
unregister_filesystem(&xfs_fs_type);
+ kset_unregister(xfs_kset);
xfs_sysctl_unregister();
xfs_cleanup_procfs();
xfs_buf_terminate();
--
1.8.3.1
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-06-06 13:13 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-06 13:13 [PATCH 0/6] xfs sysfs support Brian Foster
2014-06-06 13:13 ` [PATCH 1/6] xfs: fix a couple error sequence jumps in xfs_mountfs() Brian Foster
2014-06-26 4:10 ` Dave Chinner
2014-06-06 13:13 ` Brian Foster [this message]
2014-06-26 4:13 ` [PATCH 2/6] xfs: add a sysfs kset Dave Chinner
2014-06-06 13:13 ` [PATCH 3/6] xfs: add xfs_mount sysfs kobject Brian Foster
2014-06-26 4:29 ` Dave Chinner
2014-06-06 13:13 ` [PATCH 4/6] xfs: add xlog sysfs kobject and attribute handlers Brian Foster
2014-06-26 4:47 ` Dave Chinner
2014-06-26 12:28 ` Brian Foster
2014-06-26 13:41 ` Brian Foster
2014-06-06 13:13 ` [PATCH 5/6] xfs: add log attributes for log lsn and grant head data Brian Foster
2014-06-26 4:52 ` Dave Chinner
2014-06-26 12:29 ` Brian Foster
2014-06-06 13:13 ` [PATCH 6/6] xfs: document log sysfs attributes in testing ABI Brian Foster
2014-06-26 5:03 ` Dave Chinner
2014-06-26 12:30 ` Brian Foster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1402060414-22075-3-git-send-email-bfoster@redhat.com \
--to=bfoster@redhat.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox