The maintainer has a lot more experience writing
kernel code than you do and has a better grasp of
how this update will impact other parts of the code.
Is his version better?
Presumably, it is in the kernel source now?
It would be interesting to see them side by side.
If he just took your implementation, stuck his name on it
and pushed it, that would clearly be an asshole move.
If he read your description, looked at your implementation and
wrote a much better one, then that is beneficial for the codebase
and Linux.
In which case proper credit was given.
Writing kernel code is hard.
Very few people get their first contribution into the kernel.
which sucks for the ego of someone making a contribution, but it
makes the codebase better.
In a generous light, the maintainer recognized that you were
interested in helping the kernel and he saw you had some talent,
so he offered you a new task as a step to learn more and
building your skills as a kernel developer.
He could have communicated it in a more verbose and polite manner
for sure.
Is his version better? Presumably, it is in the kernel source now? It would be interesting to see them side by side.
If he just took your implementation, stuck his name on it and pushed it, that would clearly be an asshole move.
If he read your description, looked at your implementation and wrote a much better one, then that is beneficial for the codebase and Linux.
In which case proper credit was given.
Writing kernel code is hard. Very few people get their first contribution into the kernel. which sucks for the ego of someone making a contribution, but it makes the codebase better.
In a generous light, the maintainer recognized that you were interested in helping the kernel and he saw you had some talent, so he offered you a new task as a step to learn more and building your skills as a kernel developer.
He could have communicated it in a more verbose and polite manner for sure.