diff options
Diffstat (limited to 'fs/coda/psdev.c')
| -rw-r--r-- | fs/coda/psdev.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c index 6c6771db36da..803aacf0d49c 100644 --- a/fs/coda/psdev.c +++ b/fs/coda/psdev.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
| 29 | #include <linux/skbuff.h> | 29 | #include <linux/skbuff.h> |
| 30 | #include <linux/proc_fs.h> | 30 | #include <linux/proc_fs.h> |
| 31 | #include <linux/devfs_fs_kernel.h> | ||
| 32 | #include <linux/vmalloc.h> | 31 | #include <linux/vmalloc.h> |
| 33 | #include <linux/fs.h> | 32 | #include <linux/fs.h> |
| 34 | #include <linux/file.h> | 33 | #include <linux/file.h> |
| @@ -259,7 +258,7 @@ static ssize_t coda_psdev_read(struct file * file, char __user * buf, | |||
| 259 | /* If request was not a signal, enqueue and don't free */ | 258 | /* If request was not a signal, enqueue and don't free */ |
| 260 | if (!(req->uc_flags & REQ_ASYNC)) { | 259 | if (!(req->uc_flags & REQ_ASYNC)) { |
| 261 | req->uc_flags |= REQ_READ; | 260 | req->uc_flags |= REQ_READ; |
| 262 | list_add(&(req->uc_chain), vcp->vc_processing.prev); | 261 | list_add_tail(&(req->uc_chain), &vcp->vc_processing); |
| 263 | goto out; | 262 | goto out; |
| 264 | } | 263 | } |
| 265 | 264 | ||
| @@ -365,22 +364,12 @@ static int init_coda_psdev(void) | |||
| 365 | err = PTR_ERR(coda_psdev_class); | 364 | err = PTR_ERR(coda_psdev_class); |
| 366 | goto out_chrdev; | 365 | goto out_chrdev; |
| 367 | } | 366 | } |
| 368 | devfs_mk_dir ("coda"); | 367 | for (i = 0; i < MAX_CODADEVS; i++) |
| 369 | for (i = 0; i < MAX_CODADEVS; i++) { | ||
| 370 | class_device_create(coda_psdev_class, NULL, | 368 | class_device_create(coda_psdev_class, NULL, |
| 371 | MKDEV(CODA_PSDEV_MAJOR,i), NULL, "cfs%d", i); | 369 | MKDEV(CODA_PSDEV_MAJOR,i), NULL, "cfs%d", i); |
| 372 | err = devfs_mk_cdev(MKDEV(CODA_PSDEV_MAJOR, i), | ||
| 373 | S_IFCHR|S_IRUSR|S_IWUSR, "coda/%d", i); | ||
| 374 | if (err) | ||
| 375 | goto out_class; | ||
| 376 | } | ||
| 377 | coda_sysctl_init(); | 370 | coda_sysctl_init(); |
| 378 | goto out; | 371 | goto out; |
| 379 | 372 | ||
| 380 | out_class: | ||
| 381 | for (i = 0; i < MAX_CODADEVS; i++) | ||
| 382 | class_device_destroy(coda_psdev_class, MKDEV(CODA_PSDEV_MAJOR, i)); | ||
| 383 | class_destroy(coda_psdev_class); | ||
| 384 | out_chrdev: | 373 | out_chrdev: |
| 385 | unregister_chrdev(CODA_PSDEV_MAJOR, "coda"); | 374 | unregister_chrdev(CODA_PSDEV_MAJOR, "coda"); |
| 386 | out: | 375 | out: |
| @@ -419,12 +408,9 @@ static int __init init_coda(void) | |||
| 419 | } | 408 | } |
| 420 | return 0; | 409 | return 0; |
| 421 | out: | 410 | out: |
| 422 | for (i = 0; i < MAX_CODADEVS; i++) { | 411 | for (i = 0; i < MAX_CODADEVS; i++) |
| 423 | class_device_destroy(coda_psdev_class, MKDEV(CODA_PSDEV_MAJOR, i)); | 412 | class_device_destroy(coda_psdev_class, MKDEV(CODA_PSDEV_MAJOR, i)); |
| 424 | devfs_remove("coda/%d", i); | ||
| 425 | } | ||
| 426 | class_destroy(coda_psdev_class); | 413 | class_destroy(coda_psdev_class); |
| 427 | devfs_remove("coda"); | ||
| 428 | unregister_chrdev(CODA_PSDEV_MAJOR, "coda"); | 414 | unregister_chrdev(CODA_PSDEV_MAJOR, "coda"); |
| 429 | coda_sysctl_clean(); | 415 | coda_sysctl_clean(); |
| 430 | out1: | 416 | out1: |
| @@ -441,12 +427,9 @@ static void __exit exit_coda(void) | |||
| 441 | if ( err != 0 ) { | 427 | if ( err != 0 ) { |
| 442 | printk("coda: failed to unregister filesystem\n"); | 428 | printk("coda: failed to unregister filesystem\n"); |
| 443 | } | 429 | } |
| 444 | for (i = 0; i < MAX_CODADEVS; i++) { | 430 | for (i = 0; i < MAX_CODADEVS; i++) |
| 445 | class_device_destroy(coda_psdev_class, MKDEV(CODA_PSDEV_MAJOR, i)); | 431 | class_device_destroy(coda_psdev_class, MKDEV(CODA_PSDEV_MAJOR, i)); |
| 446 | devfs_remove("coda/%d", i); | ||
| 447 | } | ||
| 448 | class_destroy(coda_psdev_class); | 432 | class_destroy(coda_psdev_class); |
| 449 | devfs_remove("coda"); | ||
| 450 | unregister_chrdev(CODA_PSDEV_MAJOR, "coda"); | 433 | unregister_chrdev(CODA_PSDEV_MAJOR, "coda"); |
| 451 | coda_sysctl_clean(); | 434 | coda_sysctl_clean(); |
| 452 | coda_destroy_inodecache(); | 435 | coda_destroy_inodecache(); |
