In a kernel module, we use fcheck_files() to get files_struct which further can be used to get absolute path by descriptor, see this answer for example. The problem with this function is that, It returns NULL if provided descriptor is for either empty directory or a file.
Is there any alternative way to get absolute path by fd for a file and/or empty directory in a kernel module?