Пример #1
0
void
zfsctl_fini(void)
{
#ifdef sun
	/*
	 * Remove vfsctl vnode ops
	 */
	if (zfsctl_ops_root)
		vn_freevnodeops(zfsctl_ops_root);
	if (zfsctl_ops_snapdir)
		vn_freevnodeops(zfsctl_ops_snapdir);
	if (zfsctl_ops_snapshot)
		vn_freevnodeops(zfsctl_ops_snapshot);
	if (zfsctl_ops_shares)
		vn_freevnodeops(zfsctl_ops_shares);
	if (zfsctl_ops_shares_dir)
		vn_freevnodeops(zfsctl_ops_shares_dir);

	zfsctl_ops_root = NULL;
	zfsctl_ops_snapdir = NULL;
	zfsctl_ops_snapshot = NULL;
	zfsctl_ops_shares = NULL;
	zfsctl_ops_shares_dir = NULL;
#endif	/* sun */
}
Пример #2
0
void
zfs_remove_op_tables()
{
	/*
	 * Remove vfs ops
	 */
	ASSERT(zfsfstype);
	(void) vfs_freevfsops_by_type(zfsfstype);
	zfsfstype = 0;

	/*
	 * Remove vnode ops
	 */
	if (zfs_dvnodeops)
		vn_freevnodeops(zfs_dvnodeops);
	if (zfs_fvnodeops)
		vn_freevnodeops(zfs_fvnodeops);
	if (zfs_symvnodeops)
		vn_freevnodeops(zfs_symvnodeops);
	if (zfs_xdvnodeops)
		vn_freevnodeops(zfs_xdvnodeops);
	if (zfs_evnodeops)
		vn_freevnodeops(zfs_evnodeops);

	zfs_dvnodeops = NULL;
	zfs_fvnodeops = NULL;
	zfs_symvnodeops = NULL;
	zfs_xdvnodeops = NULL;
	zfs_evnodeops = NULL;
}
Пример #3
0
void
smbfsfini()
{
	if (smbfs_vfsops) {
		(void) vfs_freevfsops_by_type(smbfsfstyp);
		smbfs_vfsops = NULL;
	}
	if (smbfs_vnodeops) {
		vn_freevnodeops(smbfs_vnodeops);
		smbfs_vnodeops = NULL;
	}
}
Пример #4
0
void
zfsctl_fini(void)
{
	/*
	 * Remove vfsctl vnode ops
	 */
	if (zfsctl_ops_root)
		vn_freevnodeops(zfsctl_ops_root);
	if (zfsctl_ops_snapdir)
		vn_freevnodeops(zfsctl_ops_snapdir);
	if (zfsctl_ops_snapshot)
		vn_freevnodeops(zfsctl_ops_snapshot);
	if (zfsctl_ops_shares)
		vn_freevnodeops(zfsctl_ops_shares);
	if (zfsctl_ops_shares_dir)
		vn_freevnodeops(zfsctl_ops_shares_dir);

	zfsctl_ops_root = NULL;
	zfsctl_ops_snapdir = NULL;
	zfsctl_ops_snapshot = NULL;
	zfsctl_ops_shares = NULL;
	zfsctl_ops_shares_dir = NULL;
}
Пример #5
0
int
_fini()
{
	int error;

	error = mod_remove(&modlinkage);
	if (error)
		return (error);
	/*
	 * Tear down the operations vectors
	 */
	(void) vfs_freevfsops_by_type(tmpfsfstype);
	vn_freevnodeops(tmp_vnodeops);
	return (0);
}
Пример #6
0
int
_fini(void)
{
   int error;

   error = mod_remove(&VMBlockModlinkage);
   if (error) {
      Warning("Could not remove vmblock module.\n");
      return error;
   }

   BlockCleanup();
   vfs_freevfsops_by_type(vmblockType);
   vn_freevnodeops(vmblockVnodeOps);

   return 0;
}
Пример #7
0
Файл: gfs.c Проект: RJVB/zfs
/*
 * gfs_make_opsvec: take an array of vnode type definitions and create
 * their vnodeops_t structures
 *
 * This routine takes an array of gfs_opsvec_t's.  It could
 * alternatively take an array of gfs_opsvec_t*'s, which would allow
 * vnode types to be completely defined in files external to the caller
 * of gfs_make_opsvec().  As it stands, much more sharing takes place --
 * both the caller and the vnode type provider need to access gfsv_ops
 * and gfsv_template, and the caller also needs to know gfsv_name.
 */
int
gfs_make_opsvec(gfs_opsvec_t *vec)
{
	int error, i;

	for (i = 0; ; i++) {
		if (vec[i].gfsv_name == NULL)
			return (0);
		error = vn_make_ops(vec[i].gfsv_name, vec[i].gfsv_template,
		    vec[i].gfsv_ops);
		if (error)
			break;
	}

	cmn_err(CE_WARN, "gfs_make_opsvec: bad vnode ops template for '%s'",
	    vec[i].gfsv_name);
	for (i--; i >= 0; i--) {
		vn_freevnodeops(*vec[i].gfsv_ops);
		*vec[i].gfsv_ops = NULL;
	}
	return (error);
}
Пример #8
0
int
_fini()
{
	int error;

	/*
	 * If a forceably unmounted instance is still hanging around, we cannot
	 * allow the module to be unloaded because that would cause panics once
	 * the VFS framework decides it's time to call into VFS_FREEVFS().
	 */
	if (tmpfs_mountcount)
		return (EBUSY);

	error = mod_remove(&modlinkage);
	if (error)
		return (error);
	/*
	 * Tear down the operations vectors
	 */
	(void) vfs_freevfsops_by_type(tmpfsfstype);
	vn_freevnodeops(tmp_vnodeops);
	return (0);
}
Пример #9
0
iumfs_init(struct vfssw *iumfs_vfssw, int fstype)
#endif
{
    int err;

    DEBUG_PRINT((CE_CONT, "iumfs_init called\n"));
    DEBUG_PRINT((CE_CONT, "iumfs_init: fstype = %d(0x%x)\n", fstype, fstype));

    iumfs_fstype = fstype;

#ifdef SOL10
    do {
        err = vfs_setfsops(fstype, iumfs_vfs_ops_def_array, &iumfs_vfsops);
        if (err)
            break;
        err = vn_make_ops(fsname, iumfs_vnode_ops_def_array, &iumfs_vnodeops);
        if (err)
            break;
    } while (FALSE);

    if (err) {
        if (iumfs_vfsops != NULL) {
            vfs_freevfsops_by_type(fstype);
        }
        if (iumfs_vnodeops != NULL) {
            vn_freevnodeops(iumfs_vnodeops);
        }
    }
#endif
    /* 
     * filesystem id に使うデバイス番号を決める。
     */
    iumfs_major = getudev();
    DEBUG_PRINT((CE_CONT, "iumfs_init: major = %d(0x%x)\n", iumfs_major, iumfs_major));
    DEBUG_PRINT((CE_CONT, "iumfs_init: return(%d)\n", err));
    return (err);
}
Пример #10
0
int
_fini(void)
{
	int	error;

	error = mod_remove(&modlinkage);

	DTRACE_PROBE1(mod_remove, int, error);

	if (error)
		return (error);

	mutex_destroy(&hs_mounttab_lock);

	/*
	 * Tear down the operations vectors
	 */
	(void) vfs_freevfsops_by_type(hsfsfstype);
	vn_freevnodeops(hsfs_vnodeops);

	hs_fini_hsnode_cache();
	hsched_fini_caches();
	return (0);
}
Пример #11
0
/*
 * Cache clean up routine. This routine is called if mod_install() failed
 * and we have to clean up because the module could not be installed,
 * or by _fini() when we're unloading the module.
 */
static void
cachefs_fini()
{
	extern int cachefsfstyp;
	extern struct vnodeops *cachefs_vnodeops;

	if (cachefs_up == B_FALSE) {
		/*
		 * cachefs_init() was not called on _init(),
		 * nothing to deallocate.
		 */
		return;
	}

	/*
	 * Clean up cachefs.0.key kstat.
	 * Currently, you can only do a
	 * modunload if cachefs_unloadable is nonzero, and that's
	 * pretty much just for debugging.  however, if there ever
	 * comes a day when cachefs is more freely unloadable
	 * (e.g. the modunload daemon can do it normally), then we'll
	 * have to make changes in the stats_ API.  this is because a
	 * stats_cookie_t holds the id # derived from here, and it
	 * will all go away at modunload time.  thus, the API will
	 * need to somehow be more robust than is currently necessary.
	 */
	kstat_delete_byname("cachefs", 0, "key");

	if (cachefs_kstat_key != NULL) {
		cachefs_kstat_key_t *key;
		int i;

		for (i = 0; i < cachefs_kstat_key_n; i++) {
			key = cachefs_kstat_key + i;

			cachefs_kmem_free((void *)(uintptr_t)key->ks_mountpoint,
			    strlen((char *)(uintptr_t)key->ks_mountpoint) + 1);
			cachefs_kmem_free((void *)(uintptr_t)key->ks_backfs,
			    strlen((char *)(uintptr_t)key->ks_backfs) + 1);
			cachefs_kmem_free((void *)(uintptr_t)key->ks_cachedir,
			    strlen((char *)(uintptr_t)key->ks_cachedir) + 1);
			cachefs_kmem_free((void *)(uintptr_t)key->ks_cacheid,
			    strlen((char *)(uintptr_t)key->ks_cacheid) + 1);
		}

		cachefs_kmem_free(cachefs_kstat_key,
		    cachefs_kstat_key_n * sizeof (*cachefs_kstat_key));
	}

	/*
	 * Clean up kmem_cache entities
	 */
	kmem_cache_destroy(cachefs_cache_kmcache);
	kmem_cache_destroy(cachefs_filegrp_cache);
	kmem_cache_destroy(cachefs_fscache_cache);
	kmem_cache_destroy(cachefs_req_cache);
	kmem_cache_destroy(cachefs_cnode_cache);
#ifdef CFSRLDEBUG
	if (cachefs_rl_debug_cache != NULL)
		kmem_cache_destroy(cachefs_rl_debug_cache);
#endif /* CFSRLDEBUG */

	/*
	 * Clean up the operations structures
	 */
	(void) vfs_freevfsops_by_type(cachefsfstyp);
	vn_freevnodeops(cachefs_vnodeops);

	/*
	 * Destroy mutexes
	 */
#ifdef CFSRLDEBUG
	mutex_destroy(&cachefs_rl_debug_mutex);
#endif /* CFSRLDEBUG */
	mutex_destroy(&cachefs_async_lock);
	mutex_destroy(&cachefs_minor_lock);
	mutex_destroy(&cachefs_rename_lock);
	mutex_destroy(&cachefs_kmem_lock);
	mutex_destroy(&cachefs_kstat_key_lock);
	mutex_destroy(&cachefs_newnum_lock);
	mutex_destroy(&cachefs_cachelock);
}