Re: [PATCH 1/2] Btrfs-progs: make pretty_sizes() works less error prone

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

 



On Thu, Jul 04, 2013 at 12:07:37AM +0800, Wang Shilong wrote:
> From: Wang Shilong <wangsl-fnst@xxxxxxxxxxxxxx>
> 
> In the original code, pretty_sizes() may return NULL in two cases:
> <1> Allocating memory dynamically fails

Turning it into static allocation looks much better than calling
malloc for ~30 bytes.

> <2> Overflow happens(size exceeds YB)

However we're limited to 16 EiB both theoretically and practically due
to everything being 64bit, we can drop the zetta- and yotta- suffixes
eventually.

thanks,
david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux