Skip to content

Make common helpers for seq_files that work with list_head-s (v2)

Pavel Emelianov lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest15 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15The helper functions itselvesfs/seq_file.c include/linux/seq_file.h+45 -01 reply
2/15Make AFS use seq_list_xxx helpersfs/afs/proc.c+11 -700 replies
3/15Make ATM driver use seq_list_xxx helpersnet/atm/br2684.c+4 -180 replies
4/15Make block layer /proc files use seq_list_xxx helpersblock/genhd.c+14 -260 replies
5/15Make crypto API use seq_list_xxx helperscrypto/proc.c+3 -141 reply
6/15Make input layer use seq_list_xxx helpersdrivers/input/input.c+4 -250 replies
7/15Make ISDN CAPI use seq_list_xxx helpersdrivers/isdn/capi/kcapi_proc.c+4 -240 replies
8/15Make /proc/misc use seq_list_xxx helpersdrivers/char/misc.c+3 -150 replies
9/15Make /proc/modules use seq_list_xxx helperskernel/module.c+2 -150 replies
10/15Make some network-related proc files use seq_list_xxx helpersnet/core/sock.c net/rxrpc/ar-proc.c+10 -771 reply
11/15Make some netfilter-related proc files use seq_list_xxx helpersnet/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c net/netfilter/nf_conntrack_expect.c+8 -460 replies
12/15Make NFS client use seq_list_xxx helpersfs/nfs/client.c+6 -481 reply
13/15Make /proc/tty/drivers use seq_list_xxx helpersfs/proc/proc_tty.c+3 -120 replies
14/15Make /proc/slabinfo use seq_list_xxx helpersmm/slab.c+5 -230 replies
15/15Make /proc/self/mounts(tats) use seq_list_xxx helpersfs/namespace.c+5 -110 replies

Reviews trailers per patch

2 of 15 patches have a Reviewed-by or Acked-by.

PatchDavid S. MillerTrond Myklebust
1/15
2/15
3/15
4/15
5/15
6/15
7/15
8/15
9/15
10/15A-b
11/15
12/15A-b
13/15
14/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/15] Make common helpers for seq_files that work with list_head-s (v2)

Many places in kernel use seq_file API to iterate over a regular list_head. The code for such iteration is identical in all the places, so it's worth introducing a common helpers.

This makes code about 300 lines smaller:

 block/genhd.c                                         |   40 +++-----
 crypto/proc.c                                         |   17 ---
 drivers/char/misc.c                                   |   18 ----
 drivers/input/input.c                                 |   29 ------
 drivers/isdn/capi/kcapi_proc.c                        |   28 ------
 fs/afs/proc.c                                         |   81 ++----------------
 fs/namespace.c                                        |   14 ---
 fs/nfs/client.c                                       |   54 +-----------
 fs/proc/proc_tty.c                                    |   15 ---
 fs/seq_file.c                                         |   34 +++++++
 include/linux/seq_file.h                              |   11 ++
 kernel/module.c                                       |   17 ---
 mm/slab.c                                             |   28 +-----
 net/atm/br2684.c                                      |   22 ----
 net/core/sock.c                                       |   39 --------
 net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c |   27 ------
 net/netfilter/nf_conntrack_expect.c                   |   27 ------
 net/rxrpc/ar-proc.c                                   |   48 +---------
 18 files changed, 126 insertions(+), 423 deletions(-)

The first version of this patch made the helper functions static inline in the seq_file.h header. This patch moves them to the fs/seq_file.c as Andrew proposed. The vmlinux .text section sizes are as follows:

2.6.22-rc1-mm1:              0x001794d5
with the previous version:   0x00179505
with this patch:             0x00179135

The config file used was make allnoconfig with the "y" inclusion of all the possible options to make the files modified by the patch compile plus drivers I have on the test node.