Re: [PATCH v4 1/3] fs: configfs: add helpers for opening non-configfs paths
From: Christoph Hellwig
Date: Tue Sep 22 2026 - 09:57:37 EST
On Mon, Sep 21, 2026 at 05:05:57PM +0800, Runyu Xiao wrote:
> +bool configfs_path_is_configfs(const struct path *path)
> +{
> + return path->dentry->d_sb->s_type == &configfs_fs_type;
> +}
> +EXPORT_SYMBOL_GPL(configfs_path_is_configfs);
> +
> +struct file *configfs_open_root(const struct path *root, const char *name,
> + int flags, umode_t mode)
> +{
> + if (configfs_path_is_configfs(root))
> + return ERR_PTR(-EINVAL);
> +
> + return file_open_root(root, name, flags, mode);
> +}
> +EXPORT_SYMBOL_GPL(configfs_open_root);
These two aren't used outside this file, so they could be static,
or in case of configfs_path_is_configfs even be folded into the
only caller. Or do you plan to have other users?
> +struct file *configfs_file_open(const char *filename, int flags, umode_t mode)
Can you add a kerneldoc comment explaining how/why this should be used?