答复: about print_disksize

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

 



Steven,

	Thanks for your reply. I found a possible reason,

	+ /* Give size in megabytes (MB), not mebibytes (MiB). */ 
	+ /* We compute the exact rounded value, avoiding overflow. */ 
	+ printk (" (%ld MB)", (capacity - capacity/625 + 974)/1950);

	that is found in http://www.gossamer-threads.com/lists/linux/kernel/129337

Cheers

-----邮件原件-----
发件人: stgt-owner@xxxxxxxxxxxxxxx [mailto:stgt-owner@xxxxxxxxxxxxxxx] 代表 Steven Graf
发送时间: 2015年9月30日 20:40
收件人: yangruifeng 09209 (RD)
抄送: stgt@xxxxxxxxxxxxxxx; zhengbin 08747 (RD)
主题: Re: about print_disksize

Yang,

I believe your computation has over simplified the calculation taking place.  A megabyte is actually 1024 * 1024.  Furthermore the calculation is being run against an existing number so the result is the existing number expressed as MB.  Lastly the calculations seem very deliberate so my assumption is that there is some additional data is in band with the underlying data and needs to be stripped from the calculation.

Cheers,

-S

Sent from your iPhone

> On Sep 28, 2015, at 11:38 PM, "yangruifeng.09209@xxxxxxx" <yangruifeng.09209@xxxxxxx> wrote:
> 
> Hi All£¬
> 
> In print_disksize(target.c)
> mb = ((size / 512) - (((size / 512) / 625) - 974)) / 1950;
> 
> Why this? 
> 512¡¢625¡¢974¡¢1950 mean what?
> 
> Why not like this,
> Mb = size / (1000 * 1000)?Simpler and easier to understand
> 
> Thanks£¬
> Ruifeng Yang
> èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébë§²æìr¸›zË`¶)í…æèw*jg¬±¨¶‰šŽŠÝ¢j/êäz¹Þ–Š
> à2ŠÞ™¨è­Ú&¢)ß¡«a¶Úþø®G«éh®æj:+v‰¨Šwè†Ù¥
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

Resolutech, LLC, PO Box 650991, Sterling, VA 20165, www.resolutech.net
--
To unsubscribe from this list: send the line "unsubscribe stgt" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at  http://vger.kernel.org/majordomo-info.html
��.n��������+%������w��{.n�������{ay�ʇڙ���f���h������_�(�階�ݢj"��������G����?���&��




[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux