[lkml]   [2000]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: New entry in inode/stat
> On Monday August 7, wrote:
> > >
> > > 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...
> >
> > Bye
> > Honza
> >
> Well.... it depends on what you mean by "reasonable" but..
You misunderstood me a bit. There isn't problem with struct dquot..
The problem is when somebody does chgrp or chown on some file. Then
the function just gets inode and you need to substract space used by
file from quota of previous owner and add it to quota of new owner.
But currently there is *no* way how to get space used by file in bytes.
Only blocks are available in i_blocks but that is not usable for reiserfs.

> It is (should be) entirely appropriate for a filesystem to do all
> disc-usage calculations internally. It just registers it's own
> "struct dquot_operations" in sb->qd_op at read_super time.
> Then you could account any way that you like, and just provide numbers
> in the appropriate units to the quotactl syscall.
> Looking at the code though, I'm not at all sure it is as easy as it
> should be, as "struct dquot" only stores blocks, not bytes, and so
> your filesystem would have to duplicate all the "struct dquot"
> management.
> What I would probably do:
> Assert that "struct dquot" stored bytes.
> As sb->s_quotasize to the superblock which defaults to
> sb->s_blocksize
> Change DQUOT_ALLOC_BLOCK to mutiply "nr" by
> sb->s_quotasize instead of sb->s_blocksize, and not to divide by
> BLOCK_SIZE (done by fs_to_dq_blocks in quota.h)
> Add new operations to dquot_operations to read/write the quota file.
> change sys_quotactl to convert between bytes (as stored in struct
> dquot) and blocks are reported to use-space.
> Then reiserfs can register it's own dquot_operations that includes
> read/write operations which stores bytecounts in the quota file, and
> it can set s_quotasize to '1' and can pass byte counts to
> I feel that I have probably missed something significant here, but I
> think you get the idea.
OK. I took a bit different approach but generally with the same
results :-). Anyway thanks for ideas. I'll think about them.


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.049 / U:19.224 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site