lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1296837627-7416-1-git-send-email-dann.frazier@canonical.com>
Date:	Fri,  4 Feb 2011 09:40:27 -0700
From:	dann.frazier@...onical.com
To:	ocfs2-devel@....oracle.com
Cc:	linux-kernel@...r.kernel.org,
	dann frazier <dann.frazier@...onical.com>
Subject: [PATCH] [ocfs2] Use a kobject instead of a kset

From: dann frazier <dann.frazier@...onical.com>

We currently allocate a kset and add attributes to its internal kobject.
However, Documentation/kobject.txt says only the kset code should manipulate
this internal object, and we can get the same results by just creating our
own kobject and avoiding a kset altogether.

Signed-off-by: dann frazier <dann.frazier@...onical.com>
---
 fs/ocfs2/stackglue.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
index 39abf89..7098101 100644
--- a/fs/ocfs2/stackglue.c
+++ b/fs/ocfs2/stackglue.c
@@ -607,29 +607,29 @@ static struct attribute_group ocfs2_attr_group = {
 	.attrs = ocfs2_attrs,
 };
 
-static struct kset *ocfs2_kset;
+static struct kobject *ocfs2_kobj;
 
 static void ocfs2_sysfs_exit(void)
 {
-	kset_unregister(ocfs2_kset);
+	kobject_put(ocfs2_kobj);
 }
 
 static int ocfs2_sysfs_init(void)
 {
 	int ret;
 
-	ocfs2_kset = kset_create_and_add("ocfs2", NULL, fs_kobj);
-	if (!ocfs2_kset)
+	ocfs2_kobj = kobject_create_and_add("ocfs2", fs_kobj);
+	if (!ocfs2_kobj)
 		return -ENOMEM;
 
-	ret = sysfs_create_group(&ocfs2_kset->kobj, &ocfs2_attr_group);
+	ret = sysfs_create_group(ocfs2_kobj, &ocfs2_attr_group);
 	if (ret)
 		goto error;
 
 	return 0;
 
 error:
-	kset_unregister(ocfs2_kset);
+	kobject_put(ocfs2_kobj);
 	return ret;
 }
 
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ