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

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

 



Tomo

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

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.

Sounds better?
Alexander
--
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


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux