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

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

 



On 1/5/06, Latchesar Ionkov <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux