All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESUBMIT 0/2] fs/seq_file: Add seq_open_init()
@ 2014-09-24 11:15 Rob Jones
  2014-09-24 11:15 ` [PATCH RESUBMIT 1/2] fs/seq_file: Create new function seq_open_init() Rob Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Rob Jones @ 2014-09-24 11:15 UTC (permalink / raw)
  To: rdunlap, viro
  Cc: linux-doc, linux-fsdevel, linux-kernel, linux-kernel, akpm,
	keescook, penguin-kernel, rob.jones

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(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-09-25 18:07 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-24 11:15 [PATCH RESUBMIT 0/2] fs/seq_file: Add seq_open_init() Rob Jones
2014-09-24 11:15 ` [PATCH RESUBMIT 1/2] fs/seq_file: Create new function seq_open_init() Rob Jones
2014-09-24 21:39   ` Andrew Morton
2014-09-25  9:10     ` Rob Jones
2014-09-25 14:49       ` Randy Dunlap
2014-09-25 17:39         ` Rob Jones
2014-09-25 17:50       ` Andrew Morton
2014-09-25 17:54         ` Rob Jones
2014-09-25 18:07           ` Andrew Morton
2014-09-24 11:15 ` [PATCH RESUBMIT 2/2] Documentation/filesystem/seq_file: document seq_open_init() Rob Jones
2014-09-24 18:06 ` [PATCH RESUBMIT 0/2] fs/seq_file: Add seq_open_init() Kees Cook
2014-09-25  8:57   ` Rob Jones
2014-09-25 16:09     ` Kees Cook
2014-09-25 17:36       ` Rob Jones
2014-09-25 17:40         ` Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.