On 07/12/2012 01:20 PM, Sage Weil wrote:
> I think the caller should be able to distinguish between these two cases
> in the return value. What about:
>
>> > + */
>> > +static inline char *ceph_extract_encoded_string(void **p, void *end,
>> > + size_t *lenp, gfp_t gfp)
>
> int ceph_extract_encoded_string(void **p, void *end, char **str, gfp_t gfp)
>
> and return the length, or an error code? That avoids futzing with ERR_PTR
> and gives you the len a bit less awkwardly...
>
I opted to stick with my original prototype--returning the string--and
using the ERR_PTR() etc. I return the string because I *always* want
that. Only sometimes is the length needed.
-Alex
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html