[CRIU] [PATCH 14/18] proc_parse: Add parsing of fanotify entries

Pavel Emelyanov xemul at parallels.com
Mon Jan 14 04:38:30 EST 2013


On 01/11/2013 08:58 PM, Cyrill Gorcunov wrote:
> 
> Since fanotify entries do need more than one @id
> passed across the calls we define struct fsnotify_params
> which will hold @id and flags needed for fanotify entries.
> 
> As Pavel mentioned instead of one big inlined slab of
> code which parses fsnotify objects we introduce
> handle_fsnotify_fields general helper and call it from
> 
> if (fdinfo_field(str, ...)) {
> }
> 
> template.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  fsnotify.c         |  10 +++-
>  include/fsnotify.h |   6 +++
>  proc_parse.c       | 131 ++++++++++++++++++++++++++++++++++++++++-------------
>  3 files changed, 114 insertions(+), 33 deletions(-)
> 


This is horrible. Don't touch existing scanf-s, just add explicit
set of fdinfo_field-s ifs even if it results in code duplication.


More information about the CRIU mailing list