[OpenAFS-devel] [PATCH CVS] use seq_file interface for Linux /proc

Christopher Allen Wing wingc@engin.umich.edu
Mon, 25 Apr 2005 17:44:59 -0400 (EDT)


>> 	http://www-personal.engin.umich.edu/~wingc/openafs/patches/openafs-stable-1_4_x-20050422-seq_file.patch
>>
>>
>> This converts /proc/fs/openafs/CellServDB to use seq_file, and removes the
>> old csdbproc_read().

> Ok, but why is this preferred over the records-based (info
> method instead of read method) interface?


seq_file is now the standard helper interface for converting linked lists,
hash tables, etc. into text output in linux /proc. It takes care of doing
the necessary arithmetic on file offset for you (so you wouldn't need the
90 character long line hack) and provides its own sprintf() wrapper to
make things easy and avoid overflow.

I believe create_proc_info_entry() is a legacy interface pretty much used
only for files that contain a single record.


Thanks,

Chris
wingc@engin.umich.edu