Re: regarding mem_0filled, iov_0filled and memdup

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

 



On Fri, May 22, 2015 at 09:57:17AM +0530, Pranith Kumar Karampuri wrote:
> hi,
>    These functions return 0 when 0filled and non-zero value when not
> 0filled. This is quite unintuitive as people think that it should return
> _gf_true when 0filled and false when it is not 0filled. This comes up as bug
> in reviews quite a few times, so decided may be it is better to change the
> api itself. What do you say?

Oh, yes, I would like that! The function names mem_0filled() and
iov_0filled() suggest that they return _gf_true when the contents is all
0's. If the logic is the other way around, it surely confuses me.

>    Along the same lines is memdup. It is a function in common-utils which
> does GF_CALLOC, so the memory needs to be freed with GF_FREE. But since it
> sounds so much like standard api, I have seen people do free instead of
> GF_FREE. May be it is better to change it to gf_memdup?

Yeah, +1 for renaming memdup() to gf_memdup().

Thanks,
Niels
_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://www.gluster.org/mailman/listinfo/gluster-devel




[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux