Re: [PATCH 3/3] v9fs: zero copy implementation

From: Pekka Enberg
Date: Thu Jan 05 2006 - 08:02:07 EST


On 1/5/06, Latchesar Ionkov <lucho@xxxxxxxxxx> wrote:
> v9fs_t_attach(struct v9fs_session_info *v9ses, char *uname, char *aname,
> - u32 fid, u32 afid, struct v9fs_fcall **fcall)
> + u32 fid, u32 afid, struct v9fs_fcall **rcp)
> {

[snip]

>
> - return v9fs_mux_rpc(v9ses->mux, &msg, fcall);
> + ret = -ENOMEM;

This assignment is redundant. You always override it below.

> + tc = v9fs_create_tattach(fid, afid, uname, aname);
> + if (!IS_ERR(tc)) {
> + ret = v9fs_mux_rpc(v9ses->mux, tc, rcp);
> + kfree(tc);
> + } else
> + ret = PTR_ERR(tc);

[seen in various other places as well]

> --- a/fs/9p/9p.h
> +++ b/fs/9p/9p.h
> +struct v9fs_str {
> + u16 len;
> + char *str;
> +};

[snip]

> +char *v9fs_str_copy(char *buf, int buflen, struct v9fs_str *str)
> +{
> + int n;
> +
> + if (buflen < str->len)
> + n = buflen;
> + else
> + n = str->len;
> +
> + memmove(buf, str->str, n - 1);
> +
> + return buf;
> +}
> +
> +int v9fs_str_compare(char *buf, struct v9fs_str *str)
> +{
> + int n, ret;
> +
> + ret = strncmp(buf, str->str, str->len);
> +
> + if (!ret) {
> + n = strlen(buf);
> + if (n < str->len)
> + ret = -1;
> + else if (n > str->len)
> + ret = 1;
> + }
> +
> + return ret;
> +}

Do you really need these? If yes, could you please put them in lib/?

Pekka
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/