示例#1
0
MODULE_INIT void glusterfs_init(void)
{
	struct fsal_module *myself = &GlusterFS.fsal;

	/* register_fsal seems to expect zeroed memory. */
	memset(myself, 0, sizeof(*myself));

	if (register_fsal(myself, glfsal_name, FSAL_MAJOR_VERSION,
			  FSAL_MINOR_VERSION, FSAL_ID_GLUSTER) != 0) {
		LogCrit(COMPONENT_FSAL,
			"Gluster FSAL module failed to register.");
		return;
	}

	/* set up module operations */
	myself->m_ops.create_export = glusterfs_create_export;

	/* setup global handle internals */
	myself->m_ops.init_config = init_config;

	/* Enable extended fop support */
	myself->m_ops.support_ex = glusterfs_support_ex;
	/*
	 * Following inits needed for pNFS support
	 * get device info will used by pnfs meta data server
	 */
	myself->m_ops.getdeviceinfo = getdeviceinfo;
	myself->m_ops.fsal_pnfs_ds_ops = pnfs_ds_ops_init;

	LogDebug(COMPONENT_FSAL, "FSAL Gluster initialized");
}
示例#2
0
MODULE_INIT void zfs_load(void)
{
	int retval;
	struct fsal_module *myself = &ZFS.fsal;

	retval = register_fsal(myself, myname,
			       FSAL_MAJOR_VERSION,
			       FSAL_MINOR_VERSION,
			       FSAL_ID_NO_PNFS);
	if (retval != 0) {
		fprintf(stderr, "ZFS module failed to register");
		return;
	}

	myself->m_ops.create_export = zfs_create_export;
	myself->m_ops.init_config = zfs_init_config;
}