Remove registration of a filesystem type */
| 525 | |
| 526 | /* Remove registration of a filesystem type */ |
| 527 | static int |
| 528 | vfs_unregister(struct vfsconf *vfc) |
| 529 | { |
| 530 | struct vfsconf *vfsp; |
| 531 | int error, maxtypenum; |
| 532 | |
| 533 | vfsconf_lock(); |
| 534 | vfsp = vfs_byname_locked(vfc->vfc_name); |
| 535 | if (vfsp == NULL) { |
| 536 | vfsconf_unlock(); |
| 537 | return (EINVAL); |
| 538 | } |
| 539 | if (vfsp->vfc_refcount != 0) { |
| 540 | vfsconf_unlock(); |
| 541 | return (EBUSY); |
| 542 | } |
| 543 | error = 0; |
| 544 | if ((vfc->vfc_flags & VFCF_SBDRY) != 0) { |
| 545 | if (vfc->vfc_vfsops_sd->vfs_uninit != NULL) |
| 546 | error = vfc->vfc_vfsops_sd->vfs_uninit(vfsp); |
| 547 | } else { |
| 548 | if (vfc->vfc_vfsops->vfs_uninit != NULL) { |
| 549 | error = vfc->vfc_vfsops->vfs_uninit(vfsp); |
| 550 | } |
| 551 | if (error != 0) { |
| 552 | vfsconf_unlock(); |
| 553 | return (error); |
| 554 | } |
| 555 | } |
| 556 | TAILQ_REMOVE(&vfsconf, vfsp, vfc_list); |
| 557 | maxtypenum = VFS_GENERIC; |
| 558 | TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) |
| 559 | if (maxtypenum < vfsp->vfc_typenum) |
| 560 | maxtypenum = vfsp->vfc_typenum; |
| 561 | maxvfsconf = maxtypenum + 1; |
| 562 | vfsconf_unlock(); |
| 563 | return (0); |
| 564 | } |
| 565 | |
| 566 | /* |
| 567 | * Standard kernel module handling code for filesystem modules. |
no test coverage detected