Skip to contentSkip to conversation

seq_file / proc_fs userdata issue

DISCUSSION John Belmonte 1 participant 1 message Nov 30, 2002

lore
Share & tools
lore
#0 lore raw

The proc_fs interface supports userdata, which can be used for an object-oriented style of programming. Used intelligently, this can eliminate a fair amount of code redundancy in drivers that handle many proc files.

Recently there has been work on the kernel to convert proc reads to use seq_file. The problem is, although seq_file also has userdata support, the userdata given to proc_fs is not automatically propagated to seq_file. The only way to set the seq_file userdata is in the open handler, which as far as I can tell does not have access to the proc_dir_entry. The result is a proliferation of nearly-identical functions and tables that could otherwise be generalized.

In summary, I'm suggesting that the proc_fs internals automatically
propagate the userdata placed in the proc_dir_entry to the seq_file instance, so that it is available in the read handler. After all, this is what we enjoyed before the move to seq_file.

Regards,
-John Belmonte