FreeBSD/sbin/hastd/primary.c
/*
 * Function instructs GEOM_GATE to handle reads directly from within the kernel.
 */
Function instructs GEOM_GATE to handle reads directly from within the kernel.
Function instructs GEOM_GATE to handle reads directly from within the kernel .
static void
enable_direct_reads(struct hast_resource *res)
{
	struct g_gate_ctl_modify ggiomodify;
	bzero(&ggiomodify, sizeof(ggiomodify));
	ggiomodify.gctl_version = G_GATE_VERSION;
	ggiomodify.gctl_unit = res->hr_ggateunit;
	ggiomodify.gctl_modify = GG_MODIFY_READPROV | GG_MODIFY_READOFFSET;
	strlcpy(ggiomodify.gctl_readprov, res->hr_localpath,
	    sizeof(ggiomodify.gctl_readprov));
	ggiomodify.gctl_readoffset = res->hr_localoff;
	if (ioctl(res->hr_ggatefd, G_GATE_CMD_MODIFY, &ggiomodify) == 0)
		pjdlog_debug(1, "Direct reads enabled.");
	else
		pjdlog_errno(LOG_WARNING, "Failed to enable direct reads");
}
static void enable_direct_reads ( struct hast_resource * res ) { struct g_gate_ctl_modify ggiomodify ; bzero ( & ggiomodify , sizeof ( ggiomodify ) ) ; ggiomodify . gctl_version = G_GATE_VERSION ; ggiomodify . gctl_unit = res -> hr_ggateunit ; ggiomodify . gctl_modify = GG_MODIFY_READPROV | GG_MODIFY_READOFFSET ; strlcpy ( ggiomodify . gctl_readprov , res -> hr_localpath , sizeof ( ggiomodify . gctl_readprov ) ) ; ggiomodify . gctl_readoffset = res -> hr_localoff ; if ( ioctl ( res -> hr_ggatefd , G_GATE_CMD_MODIFY , & ggiomodify ) == 0 ) pjdlog_debug ( 1 , " " ) ; else pjdlog_errno ( LOG_WARNING , " " ) ; }
Function instructs GEOM_GATE to handle reads directly from within the kernel.
Function instructs GEOM_GATE to handle reads directly from within the kernel .