Пример #1
0
static int posix_clock_fasync(int fd, struct file *fp, int on)
{
    struct posix_clock *clk = get_posix_clock(fp);
    int err = 0;

    if (!clk)
        return -ENODEV;

    if (clk->ops.fasync)
        err = clk->ops.fasync(clk, fd, fp, on);

    put_posix_clock(clk);

    return err;
}
Пример #2
0
static int posix_clock_mmap(struct file *fp, struct vm_area_struct *vma)
{
    struct posix_clock *clk = get_posix_clock(fp);
    int err = -ENODEV;

    if (!clk)
        return -ENODEV;

    if (clk->ops.mmap)
        err = clk->ops.mmap(clk, vma);

    put_posix_clock(clk);

    return err;
}
Пример #3
0
static unsigned int posix_clock_poll(struct file *fp, poll_table *wait)
{
    struct posix_clock *clk = get_posix_clock(fp);
    int result = 0;

    if (!clk)
        return -ENODEV;

    if (clk->ops.poll)
        result = clk->ops.poll(clk, fp, wait);

    put_posix_clock(clk);

    return result;
}
Пример #4
0
static __poll_t posix_clock_poll(struct file *fp, poll_table *wait)
{
	struct posix_clock *clk = get_posix_clock(fp);
	__poll_t result = 0;

	if (!clk)
		return EPOLLERR;

	if (clk->ops.poll)
		result = clk->ops.poll(clk, fp, wait);

	put_posix_clock(clk);

	return result;
}
Пример #5
0
static ssize_t posix_clock_read(struct file *fp, char __user *buf,
                                size_t count, loff_t *ppos)
{
    struct posix_clock *clk = get_posix_clock(fp);
    int err = -EINVAL;

    if (!clk)
        return -ENODEV;

    if (clk->ops.read)
        err = clk->ops.read(clk, fp->f_flags, buf, count);

    put_posix_clock(clk);

    return err;
}
Пример #6
0
static long posix_clock_compat_ioctl(struct file *fp,
                                     unsigned int cmd, unsigned long arg)
{
    struct posix_clock *clk = get_posix_clock(fp);
    int err = -ENOTTY;

    if (!clk)
        return -ENODEV;

    if (clk->ops.ioctl)
        err = clk->ops.ioctl(clk, cmd, arg);

    put_posix_clock(clk);

    return err;
}
Пример #7
0
static void put_clock_desc(struct posix_clock_desc *cd)
{
    put_posix_clock(cd->clk);
    fput(cd->fp);
}