Re: [RFC PATCH] Subject: virtio: Add unused buffers detach from vring



On Tue, Dec 15, 2009 at 11:14:07AM -0800, Shirley Ma wrote:
Hello Michael,

On Tue, 2009-12-15 at 20:47 +0200, Michael S. Tsirkin wrote:
+ detach_buf(vq, i);
+ END_USE(vq);
+ return vq->data[i];

In fact, this will return NULL always, won't it?

Nope, I changed the destroy to detach and return the buffers without
destroying them within the call. I thought it might be useful in some
other case.

Maybe I should put destroy call back?

Thanks
Shirley

No I think it's good as is, we do not need a callback.
I was simply saying that detach_buf sets data to NULL,
so return vq->data[i] after detach does not make sense.
You need to save data as comment below says.c

--
MST
--
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/



Relevant Pages

  • Re: [RFC PATCH] Subject: virtio: Add unused buffers detach from vring
    ... I changed the destroy to detach and return the buffers without ... Maybe I should put destroy call back? ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: Destroy does not work on Tree-view item
    ... Tk widgets are destroyed by "destroy widgetPath", but treeview items ... configure, delete, detach, drag, exists, focus, heading, identify, ...     while executing ...
    (comp.lang.tcl)
  • Re: Whats the secmantics of IoDetachDevice?
    ... C's driver will have its FastIoDetachDevice callback called, ... and should detach and destroy C in this callback. ... then A is sure to be removed from the stack. ...
    (microsoft.public.development.device.drivers)
  • Re: Using SHGetFileInfo causes Assertion
    ... then it will leak if you don't destroy the object represented by the handle. ... Make sure you understand the difference between DeleteObject and Detach ... SHFILEINFO shFinfo; ... m_ is generally only used for member variables, ...
    (microsoft.public.vc.mfc)
  • Destroy does not work on Tree-view item
    ... I have this command in my perl script: ... bad command "destroy": must be bbox, children, cget, column, ... configure, delete, detach, drag, exists, focus, heading, identify, ...
    (comp.lang.tcl)