Re: [PATCH 6/9] grep: cache userdiff_driver in grep_source

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> -		grep_attr_lock();
> -		drv = userdiff_find_by_path(gs->name);
> -		grep_attr_unlock();
> -		if (drv && drv->funcname.pattern) {
> -			const struct userdiff_funcname *pe = &drv->funcname;
> +		grep_source_load_driver(gs);
> +		if (gs->driver->funcname.pattern) {
> +			const struct userdiff_funcname *pe = &gs->driver->funcname;

When we load driver, gs->driver gets at least "default" driver, so we no
longer need to check for drv != NULL as we used to?  Is that the reason
for the slight difference here?

> @@ -1237,6 +1234,7 @@ void grep_source_init(struct grep_source *gs, enum grep_source_type type,
>  	gs->name = name ? xstrdup(name) : NULL;
>  	gs->buf = NULL;
>  	gs->size = 0;
> +	gs->driver = NULL;
>  
>  	switch (type) {
>  	case GREP_SOURCE_FILE:

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]