Assuming that the interface for your kernel module is a character device driver, then you have a private_data field in the file structure (which is similar to a user space file descriptor) for that.
Just select and assign a pointer to your selection structure when working with an open file.
This is not exactly a thread or a local process, but in most cases, matching a single file descriptor with your process is true, and it may be enough for you.
gby
source share