Re: Linux-2.5.17

Martin Dalecki (dalecki@evision-ventures.com)
Wed, 22 May 2002 18:08:59 +0200


Uz.ytkownik Jan Kara napisa?:
>>Uz.ytkownik Linus Torvalds napisa?:
>>
>>>On Wed, 22 May 2002, Russell King wrote:
>>>
>>>
>>>>/proc/sys has a clean and clear purpose.
>>>
>>>
>>>Yes, but it _:would_ be good to make the quota stuff use the existign
>>>helper functions to make it much cleaner.
>>>
>>>And some of those helper functions are definitely from sysctl's: splitting
>>>up the quota file into multiple sysctls (_and_ moving it to /proc/sys/fs)
>>>sounds like a good idea to me.
>>
>>Well I'm actually coding this right now :-).
>
> Thanks. I'll update quota tools to use your new files if you send me
> new layout of interface...

I'm not ready right now but...
Well actually I went the cheapest way possible:

Here is the layout of the /proc/sys/fs/dquotas array:

/*
* Statistics about disc quota.
*/
enum {
DQSTATS_LOOKUPS,
DQSTATS_DROPS,
DQSTATS_READS,
DQSTATS_WRITES,
DQSTATS_CACHE_HITS,
DQSTATS_ALLOCATED, // formerly known as nr_dquts inside kernel.
DQSTATS_FREE, // formerly known as nr_free_dquots inside kernel.
DQSTATS_SYNCS,
DQSTATS_SIZE
};

extern __u32 dqstats_array[DQSTATS_SIZE];

And here is the allocated sysctl id number:

FS_DQSTATS=16, /* int: disc quota suage statistics *

All of this appears under:

static ctl_table fs_table[] = {
{FS_DQSTATS, "dqstats", dqstats_array, sizeof(dqstats_array), 0444, NULL,
&proc_dointvec},
{},
};

inside /proc/sys/fs/dqstats

I dodn't think the particular fields are subject to change soon
so I wen't for the array.
If yes - please feel rather free to complain :-).
Switch over to sysctl() and see the client code
melting down :-).

BTW> Since I got already my "required flame dosis" for toady I would
rather like to express that the rest of the new quota
handling code is, well, quite nice IMHO of course :-).

-
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/