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

Christoph Hellwig <[email protected]>
Newsgroups gmane.linux.file-systems.cifs
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.