[stgt] [PATCH 3/6] mgmt and concat_buf: using concat_buf in mgmt.c

FUJITA Tomonori fujita.tomonori at lab.ntt.co.jp
Thu Jan 12 23:24:07 CET 2012

On Thu, 12 Jan 2012 09:15:43 +0000
Alexander Nezhinsky <alexandern at mellanox.com> wrote:

> > From: FUJITA Tomonori [fujita.tomonori at lab.ntt.co.jp]
> > Sent: Thursday, January 12, 2012 2:04 AM
> > +     {
> > +             concat_buf_init(&b, &mtask->rsp_buf, &mtask->rsp_bsize);
> > Can we kill rsp_buf? That is, we can simply write the response to
> > *FILE?
> What do you mean? To redirect the FILE* directly to the socket, somehow?
> My implementation separated concat_buf and its use, so that it 
> is employed for response in tgtd and for request in tgtadm. 
> It leaves the resulting string in the user-supplied buffer pointer, 
> and the buffer can be handled and used as required by a specific
> user context. Do you see anything wrong with this approach?

I thought about more cleanup like adding something like FILE *rsp_fp.
Then "show" functions like tgt_target_show_all just call
fprintf. tgtd reads fp and write the data to ipc socket. I don't think
"show" functions need to handle buffers directly.

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

More information about the stgt mailing list