<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: mdev scan</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Because a picture is worth a thousand words...<BR>
<BR>
--- util-linux/mdev.c 2008-07-01 17:34:50.000000000 +0200<BR>
+++ util-linux/mdev.c.new 2008-07-08 00:16:36.000000000 +0200<BR>
@@ -21,8 +21,6 @@<BR>
#define root_major (G.root_major)<BR>
#define root_minor (G.root_minor)<BR>
<BR>
-#define MAX_SYSFS_DEPTH 3 /* prevent infinite loops in /sys symlinks */<BR>
-<BR>
/* We use additional 64+ bytes in make_device() */<BR>
#define SCRATCH_SIZE 80<BR>
<BR>
@@ -76,11 +74,10 @@<BR>
* "/sys/block/..." is for block devices. "/sys/bus" etc is not!<BR>
* Since kernel 2.6.25 block devices are also in /sys/class/block. */<BR>
/* TODO: would it be acceptable to just use strstr(path, "/block/")? */<BR>
- if (strncmp(&path[5], "class/block/"+6, 6) != 0<BR>
- && strncmp(&path[5], "class/block/", 12) != 0)<BR>
- type = S_IFCHR;<BR>
+ if (NULL == strstr(&path[5], "/block/"))<BR>
+ type = S_IFCHR;<BR>
else<BR>
- type = S_IFBLK;<BR>
+ type = S_IFBLK;<BR>
<BR>
if (ENABLE_FEATURE_MDEV_CONF) {<BR>
FILE *fp;<BR>
@@ -315,15 +312,6 @@<BR>
return TRUE;<BR>
}<BR>
<BR>
-/* Directory callback for /sys/ traversal */<BR>
-static int dirAction(const char *fileName ATTRIBUTE_UNUSED,<BR>
- struct stat *statbuf ATTRIBUTE_UNUSED,<BR>
- void *userData ATTRIBUTE_UNUSED,<BR>
- int depth)<BR>
-{<BR>
- return (depth >= MAX_SYSFS_DEPTH ? SKIP : TRUE);<BR>
-}<BR>
-<BR>
/* For the full gory details, see linux/Documentation/firmware_class/README<BR>
*<BR>
* Firmware loading works like this:<BR>
@@ -401,13 +389,8 @@<BR>
root_major = major(st.st_dev);<BR>
root_minor = minor(st.st_dev);<BR>
<BR>
- recursive_action("/sys/block",<BR>
- ACTION_RECURSE | ACTION_FOLLOWLINKS,<BR>
- fileAction, dirAction, temp, 0);<BR>
-<BR>
- recursive_action("/sys/class",<BR>
- ACTION_RECURSE | ACTION_FOLLOWLINKS,<BR>
- fileAction, dirAction, temp, 0);<BR>
+ recursive_action("/sys", ACTION_RECURSE,<BR>
+ fileAction, NULL, temp, 0);<BR>
<BR>
} else {<BR>
/* Hotplug:<BR>
<BR>
<BR>
The patch has been tested on 2.6.19.2 kernel. I hope to get it tested on 2.6.13 in the<BR>
coming week.<BR>
<BR>
John<BR>
<BR>
<BR>
</FONT>
</P>
<br>
<span style="font-family:Arial,sans-serif;font-size:10pt;color:blue"><b>Cellent Finance Solutions AG</b></span><br><br>
<span style="font-family:Arial,sans-serif;font-size:9pt">
Firmensitz: Calwer Straße 33, 70173 Stuttgart<br>
Registergericht: Amtsgericht Stuttgart, HRB 720743<br>
Vorstand: Thomas Wild<br>
Vorsitzender des Aufsichtsrats: Rudolf Zipf
</span>
</BODY>
</HTML>