Re: [PATCH] vfs: replace ints with enum component_type for LAST_XXX
From: Jan Kara
Date: Tue Mar 31 2026 - 17:27:29 EST
On Tue 31-03-26 19:37:22, Jori Koolstra wrote:
> Several functions in namei.c take an "int *type" parameter, such as
> filename_parentat(). To know what values this can take you have to find
> the anonymous struct that defines the LAST_XXX values. I would argue
> that the readability of the code is improved by making this an explicit
> type. Also, when we have this "enum component_type" is does not really
> make sense anymore to talk about LAST_XXX, but we should just use XXX,
> as there is nothing specific about the component type showing up at the
> end of a path.
>
> Signed-off-by: Jori Koolstra <jkoolstra@xxxxxxxxx>
Looks fine to me besides one whitespace damage. Feel free to add:
Reviewed-by: Jan Kara <jack@xxxxxxx>
> @@ -3009,12 +3010,13 @@ struct dentry *kern_path_parent(const char *name, struct path *path)
> CLASS(filename_kernel, filename)(name);
> struct dentry *d;
> struct qstr last;
> - int type, error;
> + enum component_type type;
Damaged whitespace here...
Honza
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR