On Mon, 25 Aug 2003 01:15:13 +1000 (EST)
James Morris [off-list ref] wrote:
On Sat, 23 Aug 2003, Hen, Shmulik wrote:
quoted
Also, instead of using a seq_file interface and using a
pointer to skip to the relevant part, we've used a different
proc creation interface that allows passing a pointer to bond
and thus retrieve just the relevant bond device's data.
Can you provide a pointer to this code?
seq_file is the standard and preferred way to do this kind of thing.
Using a pointer with seq_file was really easy.
init...
bond->bond_proc_file = create_proc_entry(dev->name,
S_IRUGO,
bond_proc_dir);
if (bond->bonc_proc_file) {
bond->bond_proc_file->data = bond;
bond->bond_proc_file->proc_fops = &bond_info_fops;
}
open...
rc = seq_open(file, &bond_info_seq_ops);
if (!rc) {
seq = file->private_data;
seq->private = PDE(inode)->data;
}