]> www.infradead.org Git - users/jedix/linux-maple.git/commit
posix-clock: Store file pointer in struct posix_clock_context
authorWojtek Wasko <wwasko@nvidia.com>
Mon, 3 Mar 2025 16:13:43 +0000 (18:13 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Mar 2025 12:43:54 +0000 (12:43 +0000)
commite859d375d1694488015e6804bfeea527a0b25b9f
treede5445bf5fc8d18fd280b06e77639b685fc5528d
parentf252f23ab657cd224cb8334ba69966396f3f629b
posix-clock: Store file pointer in struct posix_clock_context

File descriptor based pc_clock_*() operations of dynamic posix clocks
have access to the file pointer and implement permission checks in the
generic code before invoking the relevant dynamic clock callback.

Character device operations (open, read, poll, ioctl) do not implement a
generic permission control and the dynamic clock callbacks have no
access to the file pointer to implement them.

Extend struct posix_clock_context with a struct file pointer and
initialize it in posix_clock_open(), so that all dynamic clock callbacks
can access it.

Acked-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Wojtek Wasko <wwasko@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/posix-clock.h
kernel/time/posix-clock.c