Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Sep 2019 16:37:38 +0000 (UTC)
From:      Johannes Lundberg <johalun@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352076 - in stable/12/sys: compat/linuxkpi/common/include/linux sys
Message-ID:  <201909091637.x89GbcWm046830@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: johalun
Date: Mon Sep  9 16:37:38 2019
New Revision: 352076
URL: https://svnweb.freebsd.org/changeset/base/352076

Log:
  MFC r351701:
  LinuxKPI: Add sysfs create/remove functions that handles multiple files in one call.
  
  Reviewed by:	hps
  Approved by:	imp (mentor), hps

Modified:
  stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h
  stable/12/sys/sys/param.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h
==============================================================================
--- stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h	Mon Sep  9 16:32:23 2019	(r352075)
+++ stable/12/sys/compat/linuxkpi/common/include/linux/sysfs.h	Mon Sep  9 16:37:38 2019	(r352076)
@@ -152,6 +152,29 @@ sysfs_remove_file(struct kobject *kobj, const struct a
 		sysctl_remove_name(kobj->oidp, attr->name, 1, 1);
 }
 
+static inline int
+sysfs_create_files(struct kobject *kobj, const struct attribute * const *attrs)
+{
+	int error = 0;
+	int i;
+
+	for (i = 0; attrs[i] && !error; i++)
+		error = sysfs_create_file(kobj, attrs[i]);
+	while (error && --i >= 0)
+		sysfs_remove_file(kobj, attrs[i]);
+
+	return (error);
+}
+
+static inline void
+sysfs_remove_files(struct kobject *kobj, const struct attribute * const *attrs)
+{
+	int i;
+
+	for (i = 0; attrs[i]; i++)
+		sysfs_remove_file(kobj, attrs[i]);
+}
+
 static inline void
 sysfs_remove_group(struct kobject *kobj, const struct attribute_group *grp)
 {

Modified: stable/12/sys/sys/param.h
==============================================================================
--- stable/12/sys/sys/param.h	Mon Sep  9 16:32:23 2019	(r352075)
+++ stable/12/sys/sys/param.h	Mon Sep  9 16:37:38 2019	(r352076)
@@ -60,7 +60,7 @@
  *		in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1200516	/* Master, propagated to newvers */
+#define __FreeBSD_version 1200517	/* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909091637.x89GbcWm046830>