stgt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* about print_disksize
@ 2015-09-29  3:38 yangruifeng.09209
  2015-09-30 12:39 ` Steven Graf
  0 siblings, 1 reply; 3+ messages in thread
From: yangruifeng.09209 @ 2015-09-29  3:38 UTC (permalink / raw)
  To: stgt; +Cc: zhengbin.08747

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: about print_disksize
  2015-09-29  3:38 about print_disksize yangruifeng.09209
@ 2015-09-30 12:39 ` Steven Graf
  2015-10-09 11:10   ` 答复: " yangruifeng.09209
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Graf @ 2015-09-30 12:39 UTC (permalink / raw)
  To: yangruifeng.09209; +Cc: stgt, zhengbin.08747

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 1709 bytes --]

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@h3c.com" <yangruifeng.09209@h3c.com> 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
> \x04èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébë§²æìr¸›zË`¶)í…æèw*\x1fjg¬±¨\x1e¶‰šŽŠÝ¢j/êäz¹Þ–Šà2ŠÞ™¨è­Ú&¢)ß¡«a¶Ú\x7fþø\x1e®G«éh®\x0fæ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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* 答复: about print_disksize
  2015-09-30 12:39 ` Steven Graf
@ 2015-10-09 11:10   ` yangruifeng.09209
  0 siblings, 0 replies; 3+ messages in thread
From: yangruifeng.09209 @ 2015-10-09 11:10 UTC (permalink / raw)
  To: Steven Graf; +Cc: stgt

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="windows-1254", Size: 2528 bytes --]

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@vger.kernel.org [mailto:stgt-owner@vger.kernel.org] 代表 Steven Graf
发送时间: 2015年9月30日 20:40
收件人: yangruifeng 09209 (RD)
抄送: stgt@vger.kernel.org; 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@h3c.com" <yangruifeng.09209@h3c.com> 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
> \x04èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébë§²æìr¸›zË`¶)í…æèw*jg¬±¨\x1e¶‰šŽŠÝ¢j/êäz¹Þ–Š
> à2ŠÞ™¨è­Ú&¢)ß¡«a¶Ú\x7fþø\x1e®G«éh®\x0fæ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@vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-09 11:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-29  3:38 about print_disksize yangruifeng.09209
2015-09-30 12:39 ` Steven Graf
2015-10-09 11:10   ` 答复: " yangruifeng.09209

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).