linux/fs/timerfd.c

// SPDX-License-Identifier: GPL-2.0
/*
 *  fs/timerfd.c
 *
 *  Copyright (C) 2007  Davide Libenzi <[email protected]>
 *
 *
 *  Thanks to Thomas Gleixner for code reviews and useful comments.
 *
 */

#include <linux/alarmtimer.h>
#include <linux/file.h>
#include <linux/poll.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/time.h>
#include <linux/hrtimer.h>
#include <linux/anon_inodes.h>
#include <linux/timerfd.h>
#include <linux/syscalls.h>
#include <linux/compat.h>
#include <linux/rcupdate.h>
#include <linux/time_namespace.h>

struct timerfd_ctx {};

static LIST_HEAD(cancel_list);
static DEFINE_SPINLOCK(cancel_lock);

static inline bool isalarm(struct timerfd_ctx *ctx)
{}

/*
 * This gets called when the timer event triggers. We set the "expired"
 * flag, but we do not re-arm the timer (in case it's necessary,
 * tintv != 0) until the timer is accessed.
 */
static void timerfd_triggered(struct timerfd_ctx *ctx)
{}

static enum hrtimer_restart timerfd_tmrproc(struct hrtimer *htmr)
{}

static enum alarmtimer_restart timerfd_alarmproc(struct alarm *alarm,
	ktime_t now)
{}

/*
 * Called when the clock was set to cancel the timers in the cancel
 * list. This will wake up processes waiting on these timers. The
 * wake-up requires ctx->ticks to be non zero, therefore we increment
 * it before calling wake_up_locked().
 */
void timerfd_clock_was_set(void)
{}

static void timerfd_resume_work(struct work_struct *work)
{}

static DECLARE_WORK(timerfd_work, timerfd_resume_work);

/*
 * Invoked from timekeeping_resume(). Defer the actual update to work so
 * timerfd_clock_was_set() runs in task context.
 */
void timerfd_resume(void)
{}

static void __timerfd_remove_cancel(struct timerfd_ctx *ctx)
{}

static void timerfd_remove_cancel(struct timerfd_ctx *ctx)
{}

static bool timerfd_canceled(struct timerfd_ctx *ctx)
{}

static void timerfd_setup_cancel(struct timerfd_ctx *ctx, int flags)
{}

static ktime_t timerfd_get_remaining(struct timerfd_ctx *ctx)
{}

static int timerfd_setup(struct timerfd_ctx *ctx, int flags,
			 const struct itimerspec64 *ktmr)
{}

static int timerfd_release(struct inode *inode, struct file *file)
{}

static __poll_t timerfd_poll(struct file *file, poll_table *wait)
{}

static ssize_t timerfd_read_iter(struct kiocb *iocb, struct iov_iter *to)
{}

#ifdef CONFIG_PROC_FS
static void timerfd_show(struct seq_file *m, struct file *file)
{}
#else
#define timerfd_show
#endif

#ifdef CONFIG_CHECKPOINT_RESTORE
static long timerfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{}
#else
#define timerfd_ioctl
#endif

static const struct file_operations timerfd_fops =;

static int timerfd_fget(int fd, struct fd *p)
{}

SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags)
{}

static int do_timerfd_settime(int ufd, int flags, 
		const struct itimerspec64 *new,
		struct itimerspec64 *old)
{}

static int do_timerfd_gettime(int ufd, struct itimerspec64 *t)
{}

SYSCALL_DEFINE4(timerfd_settime, int, ufd, int, flags,
		const struct __kernel_itimerspec __user *, utmr,
		struct __kernel_itimerspec __user *, otmr)
{}

SYSCALL_DEFINE2(timerfd_gettime, int, ufd, struct __kernel_itimerspec __user *, otmr)
{}

#ifdef CONFIG_COMPAT_32BIT_TIME
SYSCALL_DEFINE4(timerfd_settime32, int, ufd, int, flags,
		const struct old_itimerspec32 __user *, utmr,
		struct old_itimerspec32 __user *, otmr)
{}

SYSCALL_DEFINE2(timerfd_gettime32, int, ufd,
		struct old_itimerspec32 __user *, otmr)
{}
#endif