linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] introduce list_for_each_entry_del
@ 2013-06-03 17:28 Joern Engel
  2013-06-03 17:28 ` [PATCH 1/2] list: add list_for_each_entry_del Joern Engel
                   ` (4 more replies)
  0 siblings, 5 replies; 30+ messages in thread
From: Joern Engel @ 2013-06-03 17:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Chris Mason, linux-btrfs, Joern Engel

A purely janitorial patchset.  A fairly common pattern is to take a
list, remove every object from it and do something with this object -
usually kfree() some variant.  A stupid grep identified roughly 300
instances, with many more hidden behind more complicated patterns to
achieve the same end results.

This patchset moves the boilerplate code into list.h and uses it in a
few example places.  Diffstat is pretty clear and imo the code is
improved as well.

Drawback is that object size is growing.  I think an ideal compiler
should be able to optimize all the overhead away, but 4.7 just isn't
there yet.  Or maybe I just messed up - patches are only
compile-tested after all.  Comments/ideas are welcome.

Joern Engel (2):
  list: add list_for_each_entry_del
  btrfs: use list_for_each_entry_del

 fs/btrfs/backref.c      |   15 +++------------
 fs/btrfs/compression.c  |    4 +---
 fs/btrfs/disk-io.c      |    6 +-----
 fs/btrfs/extent-tree.c  |   17 +++--------------
 fs/btrfs/extent_io.c    |    8 ++------
 fs/btrfs/inode.c        |   16 +++-------------
 fs/btrfs/ordered-data.c |    7 +------
 fs/btrfs/qgroup.c       |   22 ++++------------------
 fs/btrfs/relocation.c   |    6 +-----
 fs/btrfs/scrub.c        |    9 +++------
 fs/btrfs/transaction.c  |    5 +----
 fs/btrfs/volumes.c      |   11 ++---------
 include/linux/list.h    |   33 +++++++++++++++++++++++++++++++++
 13 files changed, 58 insertions(+), 101 deletions(-)

-- 
1.7.10.4


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

end of thread, other threads:[~2013-07-15 19:06 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-03 17:28 [PATCH 0/2] introduce list_for_each_entry_del Joern Engel
2013-06-03 17:28 ` [PATCH 1/2] list: add list_for_each_entry_del Joern Engel
2013-06-06 19:32   ` Andy Shevchenko
2013-06-06 18:12     ` Jörn Engel
2013-06-06 19:49       ` Andy Shevchenko
2013-06-07 16:36         ` Jörn Engel
2013-06-07 18:30           ` Andy Shevchenko
2013-06-07 18:48             ` Jörn Engel
2013-06-08  0:03               ` Andy Shevchenko
2013-06-03 17:28 ` [PATCH 2/2] btrfs: use list_for_each_entry_del Joern Engel
2013-06-03 18:07 ` [PATCH 0/2] introduce list_for_each_entry_del Jörn Engel
2013-06-03 20:49 ` Christoph Hellwig
2013-06-03 19:36   ` Jörn Engel
2013-06-03 19:55     ` Jörn Engel
2013-06-04 14:48       ` Christoph Hellwig
2013-06-04 14:53         ` Chris Mason
2013-06-04 20:09           ` Arne Jansen
2013-06-04 18:44             ` Jörn Engel
2013-06-05  2:03               ` [PATCH 1/2] list: add while_list_drain_entry Jörn Engel
2013-06-05 14:32                 ` David Sterba
2013-06-05  2:04               ` [PATCH 2/2] btrfs: use while_list_drain_entry Jörn Engel
2013-06-05  2:09               ` [PATCH 0/2] introduce list_for_each_entry_del Jörn Engel
2013-06-05  6:53                 ` Arne Jansen
2013-06-05 14:25                   ` David Sterba
2013-07-05 20:41 ` Jörn Engel
2013-07-05 20:41   ` [PATCH 1/2] list: add list_del_each_entry Jörn Engel
2013-07-05 22:38     ` Filipe David Manana
2013-07-15 17:35       ` Jörn Engel
2013-07-05 20:41   ` [PATCH 2/2] btrfs: use list_del_each_entry Jörn Engel
2013-07-08  4:37   ` [PATCH 0/2] introduce list_for_each_entry_del Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).