[lkml]   [2020]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: [PATCH 01/29] iov_iter: Switch to using a table of operations
From: David Howells
> Sent: 21 November 2020 14:14
> Switch to using a table of operations. In a future patch the individual
> methods will be split up by type. For the moment, however, the ops tables
> just jump directly to the old functions - which are now static. Inline
> wrappers are provided to jump through the hooks.

I was wondering if you could use a bit of 'cpp magic'
so the to call sites would be:
ITER_CALL(iter, action)(arg_list);

which might expand to:
in the function-table case.
But could also be an if-chain:
if (iter->type & foo)
else ...
with foo_action() being inlined.

If there is enough symmetry it might make the code easier to read.
Although I'm not sure what happens to 'iterate_all_kinds'.
OTOH that is already unreadable.


Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
 \ /
  Last update: 2020-11-22 23:50    [W:0.235 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site