[ATM]: seq_file conversion of /proc/net/atm [7/8]
seq_file support for /proc/net/atm/lec: - lec_info(): seq_printf/seq_putc replaces sprintf; - traversal of the lec structure needs to walk: -> the lec interfaces -> the tables of arp tables(lec_arp_tables); -> the arp tables themselves -> the misc tables (lec_arp_empty_ones/lec_no_forward/mcast_fwds) Sum up of the call tree: atm_lec_seq_start()/atm_lec_seq_next() -> atm_lec_get_idx() -> atm_lec_itf_walk() (responsible for dev_lec/dev_put handling) -> atm_lec_priv_walk() (responsible for lec_priv locking) -> atm_lec_arp_walk() -> atm_lec_tbl_walk() -> atm_lec_misc_walk() -> atm_lec_tbl_walk() Each of the dedicated functions follows the same convention: return NULL as long as the seq_file cursor hasn't been digested (i.e. until < 0). Locking is only done when an entry (i.e. a lec_arp_table) is referenced. atm_lec_seq_stop()/atm_lec_itf_walk()/atm_lec_priv_walk() are responsible for getting this point right. - module refcounting is done in atm_lec_seq_open()/atm_lec_seq_release(); - atm_lec_info() is removed. Chas's suggestions applied since last version: - atm_seq_lec_fops renamed to lec_seq_fops; - change in state handling: it wasn't correctly set to its reset value after a complete interface walk; - lec_arp_get_status_string() bugfix.
Showing
Please register or sign in to comment