Skip to contentSkip to conversation

use libsysfs for udevstart directory walking

RFC PATCH In review Arun Bhanu 1 participant 2 messages Sep 15, 2004 – Sep 18, 2004

lore
Share & tools
lore

Arun Bhanu

author
#0 lore raw

RFC PATCH 1/1 use libsysfs for udevstart directory walking

Hi

Following up on Kay's idea about using libsysfs for directory walking.

Attached patch(against udev-032) is a first cut attempt at replacing udev_scan_class directory walking code with libsysfs calls. If we agree on this approach, I'll do the same for udev_scan_block.

Currently, libsysfs does not provide an API for getting all the classes. So, I've introduced two new functions in libsysfs:

struct dlist *sysfs_open_classes(void)
void sysfs_close_classes(struct dlist *clslist)

Comments/flames?

                --Arun
libsysfs/sysfs/libsysfs.h +3 -0
diff -Nru a/libsysfs/sysfs/libsysfs.h b/libsysfs/sysfs/libsysfs.h
@@ -288,6 +288,9 @@
 extern struct sysfs_attribute *sysfs_open_classdev_attr
 	(const char *classname, const char *dev, 
 	 					const char *attrib); 
+extern struct dlist *sysfs_open_classes(void);
+extern void sysfs_close_classes(struct dlist *clslist);
+
 
 /**
  * sort_list: sorter function to keep list elements sorted in alphabetical 
libsysfs/sysfs_class.c +45 -0

48 lines not on this page · raw message

udevstart.c +20 -54

92 lines not on this page · raw message

-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam Camcorder. More prizes in the weekly Lunch Hour Challenge. Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

author
#1 lore raw

On 06:00 Thu 16 Sep , Arun Bhanu wrote:

Sorry to reply to my own post.

Quoted 2 lines

Currently, libsysfs does not provide an API for getting all the classes. So, I've introduced two new functions in libsysfs:

I was wrong about this.

Quoted 2 lines

struct dlist *sysfs_open_classes(void)
void sysfs_close_classes(struct dlist *clslist)

Remco <[email protected]>, pointed out to me that libsysfs provides these functionalities with the following two APIs:

struct dlist *sysfs_open_subsystem_list(char *name) void sysfs_close_list(struct dlist *list)

Just ignore this patch. I'll resend the patch which uses the above APIs.

                --Arun

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel