The only part of proc_dir_entry the code outside of fs/proc
really cares about is PDE(inode)->data. Provide a helper
for that; static inline for now, eventually will be moved
to fs/proc, along with the knowledge of struct proc_dir_entry
layout.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Some of the ->show_info() instances really spew a lot; it's not a problem
wrt correctness (seq_read() will grow buffer and call the sucker again),
but in this case it makes sense to start with a somewhat bigger one -
they often do exceed one page worth of output.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Same as single_open(), but preallocates the buffer of given size.
Doesn't make any sense for sizes up to PAGE_SIZE and doesn't make
sense if output of show() exceeds PAGE_SIZE only rarely - seq_read()
will take care of growing the buffer and redoing show(). If you
_know_ that it will be large, it might make more sense to look into
saner iterator, rather than go with single-shot one. If that's
impossible, single_open_size() might be for you.
Again, don't use that without a good reason; occasionally that's really
the best way to go, but very often there are better solutions.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
asc_prt_line() had been hiding several places where formats had not
matched the argument types. The previous commit has finally made them
visible...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
It's still an obsolete interface; don't introduce those in new drivers.
However, it's saner than the ->proc_info() and commits after this one
will convert the existing ->proc_info() users to it.
The read side is ->show_info(seq_file *, struct Scsi_Host *); use
seq_... for generating contents.
The write side is ->write_info(struct Scsi_Host *, char *, int).
Again, this is driven by procfs needs; we are going to kill ->write_proc()
and ->read_proc() and this is the main obstacle to burying that piece of
shit.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
It's a seriously rotten copy of parts of bp_mod.c; had been
ifdefed out all along, lacks a bunch of declarations that would
be needed if ifdef had been removed, all stuff in it is duplicated
in bp_mod.c anyway...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>