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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1560860909-51059-3-git-send-email-sunke32@huawei.com>
Date:   Tue, 18 Jun 2019 20:28:29 +0800
From:   SunKe <sunke32@...wei.com>
To:     <jlbec@...lplan.org>, <hch@....de>, <linux-kernel@...r.kernel.org>,
        <sunke32@...wei.com>
Subject: [PATCH 2/2] sample_configfs: soft link creat and delete

Add soft link creation and deletion

Signed-off-by: SunKe <sunke32@...wei.com>
---
 samples/configfs/configfs_sample.c | 41 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/samples/configfs/configfs_sample.c b/samples/configfs/configfs_sample.c
index c76b784..58915b8 100644
--- a/samples/configfs/configfs_sample.c
+++ b/samples/configfs/configfs_sample.c
@@ -392,6 +392,46 @@ static struct configfs_subsystem group_children_subsys = {
 /* ----------------------------------------------------------------- */
 
 /*
+ * 04-link-children
+ *
+ */
+static int link_children_allow_link(struct config_item *parent,
+		struct config_item *target)
+{
+	return 0;
+}
+
+static void link_children_drop_link(struct config_item *parent,
+		struct config_item *target)
+{
+
+}
+
+
+static struct configfs_item_operations link_children_item_ops = {
+	.allow_link		= link_children_allow_link,
+	.drop_link		= link_children_drop_link,
+};
+
+
+static const struct config_item_type link_children_type = {
+	.ct_item_ops		= &link_children_item_ops,
+	.ct_owner		= THIS_MODULE,
+
+};
+
+static struct configfs_subsystem link_children_subsys = {
+	.su_group = {
+		.cg_item = {
+			.ci_namebuf = "04-link-children",
+			.ci_type = &link_children_type,
+		},
+	},
+};
+
+/* ----------------------------------------------------------------- */
+
+/*
  * We're now done with our subsystem definitions.
  * For convenience in this module, here's a list of them all.  It
  * allows the init function to easily register them.  Most modules
@@ -402,6 +442,7 @@ static struct configfs_subsystem *example_subsys[] = {
 	&childless_subsys.subsys,
 	&simple_children_subsys,
 	&group_children_subsys,
+	&link_children_subsys,
 	NULL,
 };
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ