Skip to content

fs/seq_file: Add seq_open_init()

Rob Jones linux-fsdevel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2fs/seq_file: Create new function seq_open_init()fs/seq_file.c include/linux/seq_file.h+23 -127 replies
2/2Documentation/filesystem/seq_file: document seq_open_init()Documentation/filesystems/seq_file.txt+39 -190 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchKees Cook
SeriesA-b
1/2
2/2

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 RESUBMIT 0/2] fs/seq_file: Add seq_open_init()

Series resubmitted due to a typo in an email address.

This patch series implements and documents a new interface function for seq_file.

The existing set of open functions: seq_open(), seq_open_private() and __seq_open_private() satisfy the majority of use cases however there is one more use case that is also very common that this new function addresses.

This case is where the iterator needs information that is available only at the time the seq_file is opened but does not need any space allocated, e.g. access to the inode structure. This type of open occurs, by my best estimate, in well over 40 places.

Using the new function saves at least two lines of boilerplate code per instance as well as making the code easier to follow. The additional code in seq_file.c to implement the function is minimal as the first place that code can be removed is within seq_file.c itself.

Once this patch is accepted, the instances of boilerplate code can be addressed.

The documentation of seq_open() and its variants has been re-worked to try to guide users towards the most appropriate variant for their application.

Rob Jones (2):
fs/seq_file: Create new function seq_open_init() Documentation/filesystem/seq_file: document seq_open_init()

 Documentation/filesystems/seq_file.txt |   58 +++++++++++++++++++++-----------
 fs/seq_file.c                          |   34 ++++++++++++-------
 include/linux/seq_file.h               |    1 +
 3 files changed, 62 insertions(+), 31 deletions(-)
Signature · 1 line
1.7.10.4