[linux-cifs-client] [RFC][PATCH] cifs: add helper to simplify handling of unicode strings and use it

Christoph Hellwig hch at infradead.org
Mon Apr 13 09:49:00 GMT 2009


On Sun, Apr 12, 2009 at 02:43:57PM +0530, Suresh Jayaraman wrote:
> Based on the recent discussions on opencoded, inconsistent allocation of
> memory needed for a unicode string conversion, the consensus is to
> calculate the memory needed exactly instead of using size assumptions
> and to consolidate some code that allocates memory and does conversion
> in a helper function and use it widely.
> 
> This patch attempts to do the same. Please note that non-unicode cases
> has not been converted now as they are less error-prone than unicode
> cases. I've only compile tested this patch and yet to test it
> completely, but posting this little premature patch as there are lot
> of discussions happening around this code. This patch requires careful
> review.
> 
> Thanks to Jeff, Steve and Simo for useful suggestions.

One little comment before even looking at the code:  would it be useful
to have some of those helpers in common code?  We have an awful lot of
filesystems dealing with utf8 or ucs16 encoding with a lot of ad-hoc
helpers or even worse opencoded handling.

I started wondering about consolidating this when reviewing Barry's
patches for utf8 case insensitive support in xfs which I'll need to
revisit at some point.


More information about the linux-cifs-client mailing list