summaryrefslogtreecommitdiff
path: root/udev.h
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-11-06 14:28:01 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 22:16:40 -0700
commit2b41e68a08548ce44b4d145900dab2bb04cd34f7 (patch)
treef2e96c9f150775e3673891d38a5af23d4246c826 /udev.h
parent482b0ecd8fcc2651c003c6f1ae9a2d3301ecf34a (diff)
[PATCH] replace tdb database by simple lockless file database
This makes the udev operation completely lockless by storing a file for every node in /dev/.udevdb/* This solved the problem with deadlocking concurrent udev processes waiting for each other to release the file lock under heavy load.
Diffstat (limited to 'udev.h')
-rw-r--r--udev.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/udev.h b/udev.h
index e8954338d9..1cf4ad7eae 100644
--- a/udev.h
+++ b/udev.h
@@ -41,26 +41,21 @@
#define LINE_SIZE 256
-/* length of public data to store in udevdb */
-#define UDEVICE_DB_LEN (offsetof(struct udevice, devpath))
-
struct udevice {
+ char devpath[DEVPATH_SIZE];
+ char subsystem[SUBSYSTEM_SIZE];
char name[NAME_SIZE];
char owner[OWNER_SIZE];
char group[GROUP_SIZE];
char type;
int major;
int minor;
- unsigned int mode; /* not mode_t due to conflicting definitions in different libcs */
+ mode_t mode;
char symlink[NAME_SIZE];
int partitions;
int config_line;
char config_file[NAME_SIZE];
long config_uptime;
-
- /* private data, not stored in udevdb */
- char devpath[DEVPATH_SIZE];
- char subsystem[SUBSYSTEM_SIZE];
char bus_id[SYSFS_NAME_LEN];
char bus[SYSFS_NAME_LEN];
char program_result[NAME_SIZE];
@@ -81,7 +76,7 @@ extern char **main_argv;
extern char **main_envp;
extern char sysfs_path[SYSFS_PATH_MAX];
extern char udev_root[PATH_MAX];
-extern char udev_db_filename[PATH_MAX+NAME_MAX];
+extern char udev_db_path[PATH_MAX+NAME_MAX];
extern char udev_permissions_filename[PATH_MAX+NAME_MAX];
extern char udev_config_filename[PATH_MAX+NAME_MAX];
extern char udev_rules_filename[PATH_MAX+NAME_MAX];