diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/devtmpfs.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c index 50375bb8e51d..278371c7bf5a 100644 --- a/drivers/base/devtmpfs.c +++ b/drivers/base/devtmpfs.c | |||
@@ -32,7 +32,7 @@ static int dev_mount = 1; | |||
32 | static int dev_mount; | 32 | static int dev_mount; |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | static rwlock_t dirlock; | 35 | static DEFINE_MUTEX(dirlock); |
36 | 36 | ||
37 | static int __init mount_param(char *str) | 37 | static int __init mount_param(char *str) |
38 | { | 38 | { |
@@ -93,7 +93,7 @@ static int create_path(const char *nodepath) | |||
93 | { | 93 | { |
94 | int err; | 94 | int err; |
95 | 95 | ||
96 | read_lock(&dirlock); | 96 | mutex_lock(&dirlock); |
97 | err = dev_mkdir(nodepath, 0755); | 97 | err = dev_mkdir(nodepath, 0755); |
98 | if (err == -ENOENT) { | 98 | if (err == -ENOENT) { |
99 | char *path; | 99 | char *path; |
@@ -117,7 +117,7 @@ static int create_path(const char *nodepath) | |||
117 | } | 117 | } |
118 | kfree(path); | 118 | kfree(path); |
119 | } | 119 | } |
120 | read_unlock(&dirlock); | 120 | mutex_unlock(&dirlock); |
121 | return err; | 121 | return err; |
122 | } | 122 | } |
123 | 123 | ||
@@ -229,7 +229,7 @@ static int delete_path(const char *nodepath) | |||
229 | if (!path) | 229 | if (!path) |
230 | return -ENOMEM; | 230 | return -ENOMEM; |
231 | 231 | ||
232 | write_lock(&dirlock); | 232 | mutex_lock(&dirlock); |
233 | for (;;) { | 233 | for (;;) { |
234 | char *base; | 234 | char *base; |
235 | 235 | ||
@@ -241,7 +241,7 @@ static int delete_path(const char *nodepath) | |||
241 | if (err) | 241 | if (err) |
242 | break; | 242 | break; |
243 | } | 243 | } |
244 | write_unlock(&dirlock); | 244 | mutex_unlock(&dirlock); |
245 | 245 | ||
246 | kfree(path); | 246 | kfree(path); |
247 | return err; | 247 | return err; |
@@ -352,8 +352,6 @@ int __init devtmpfs_init(void) | |||
352 | int err; | 352 | int err; |
353 | struct vfsmount *mnt; | 353 | struct vfsmount *mnt; |
354 | 354 | ||
355 | rwlock_init(&dirlock); | ||
356 | |||
357 | err = register_filesystem(&dev_fs_type); | 355 | err = register_filesystem(&dev_fs_type); |
358 | if (err) { | 356 | if (err) { |
359 | printk(KERN_ERR "devtmpfs: unable to register devtmpfs " | 357 | printk(KERN_ERR "devtmpfs: unable to register devtmpfs " |