[lkml]   [2000]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: New entry in inode/stat

> > Date: Fri, 28 Jul 2000 01:57:03 +0200
> > From: Jan Kara <>
> >
> > As I mentioned in previous mail to account quotas in
> > bytes and not in blocks (needed for reiserfs) I need to
> > know something like i_blocks but in bytes. So I added
> > field i_bytes to inode. This field is used along with
> > i_blocks and means (number of used bytes) % 512 (size
> > of block used in i_blocks).
> > This solution has advantage that we added only 16-bits
> > to structure and we needn't to update any block oriented
> > filesystem...
> > Another thing needed is to propagate somehow this entry
> > to struct stat so quotacheck may account bytes properly.
> > Whom should I ask to propagate needed changes to libc?
> >
> >This is bogus! What's wrong with the existing i_size and st_size
> >fields?
> one problem I can see is that i_size isn't reflecting the on disk usage.
> fd = creat("file"...);
> ftruncate("file", 2*1024*1024*1024-1);
> i_size is now 2 giga but i_blocks is still zero if the fs support holes.
Thanks Andrea for replies.

Yes. i_size has problem that it doesn't show real disk usage and so
is unusable for quotas... i_blocks is what quota needs but reiserfs
has smaller objects than 512 bytes and if we accounted any single object
as 512 bytes it would be too imprecise (some objects are around 40 bytes
or so). So I see no other way than adding another field. If anybody
sees other reasonable solution I will gladly use it...


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:58    [W:0.097 / U:8.796 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site