- Subject: Re: [PATCH 3/6] mgmt and concat_buf: using concat_buf in mgmt.c
- From: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx>
- Date: Fri, 20 Jan 2012 11:08:34 +0900
- Cc: fujita.tomonori@xxxxxxxxxxxxx, stgt@xxxxxxxxxxxxxxx
- In-reply-to: <2049319283-1326974400-cardhu_decombobulator_blackberry.rim.net-1575086476-@b14.c8.bise7.blackberry>
- References: <2049319283-1326974400-cardhu_decombobulator_blackberry.rim.net-1575086476-@b14.c8.bise7.blackberry>
On Thu, 19 Jan 2012 12:01:11 +0000
"Alexander Nezhinsky" <nezhinsky@xxxxxxxxx> wrote:
> I agree that encapsulation of concat_buf in mtask is cleaner and simpler, but I think that exposing FILE* when writing to socket or using mechanisms like splice are an overkill, even more than exposing size in mgmt.c
Yeah, we need helper functions to handle FILE* internally. So mgmt.c
doesn't need to handle FILE* directly. That's what you suggest below,
right?
Can you send a new patch for only mgmt.c with the modified concat_buf
patch?
> Let's save the size internally in concat_buf and add a method for writing to a fd (in our case a socket).
> So in addition to concat_sprintf() there will be concat_write(struct concat_buf *b, int fd)
> It will call fflush or fclose, as only then the buffer ptr and size are obtained, and write to the file.
> Then rsp_buf is indeed killed as concat_buf replaces it and instead calling free(rsp_buf) we call a new func concat_buf_free(struct concat_buf *b).
> Also no need in concat_finish(), as fclose() is called upon write.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux SCSI]
[Linux RAID]
[Linux Clusters]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[XFree86]
[Video Devices]