Messages in this thread | | | Date | Mon, 13 Oct 2003 09:23:48 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: nfs fstat st_blocks overreporting |
| |
On Mon, 13 Oct 2003, Frank Cusack wrote: > > While you know I disagree that s_blocksize should be wtmult (ie, it > is wtmult?wtmult:512 and I think it should be MAX(rsize,wsize)), in > any event the blocks used reporting is incorrect in that it assumes > a 512 byte blocksize.
I agree with you that st_blocksize should very probably be different (in _no_ case has it got anything to do with just "wtmult", since the thing is used for reading too). However, the st_blocks calculations has _nothing_ to do with st_blocksize.
st_blocksize is "this is the preferred blocking for IO".
st_blocks is "this is how many 512-byte blocks the file has".
The names may be similar, but they have nothing in common. They are in totally different namespaces - one is in bytes, the other one in units of "traditional UNIX block size", aka sector, aka 512 bytes. Trying to mix the two is doomed.
Linus
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |