linux/fs/dlm/plock.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2005-2008 Red Hat, Inc.  All rights reserved.
 */

#include <linux/fs.h>
#include <linux/filelock.h>
#include <linux/miscdevice.h>
#include <linux/poll.h>
#include <linux/dlm.h>
#include <linux/dlm_plock.h>
#include <linux/slab.h>

#include <trace/events/dlm.h>

#include "dlm_internal.h"
#include "lockspace.h"

static DEFINE_SPINLOCK(ops_lock);
static LIST_HEAD(send_list);
static LIST_HEAD(recv_list);
static DECLARE_WAIT_QUEUE_HEAD(send_wq);
static DECLARE_WAIT_QUEUE_HEAD(recv_wq);

struct plock_async_data {};

struct plock_op {};

static inline void set_version(struct dlm_plock_info *info)
{}

static struct plock_op *plock_lookup_waiter(const struct dlm_plock_info *info)
{}

static int check_version(struct dlm_plock_info *info)
{}

static void dlm_release_plock_op(struct plock_op *op)
{}

static void send_op(struct plock_op *op)
{}

static int do_lock_cancel(const struct dlm_plock_info *orig_info)
{}

int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
		   int cmd, struct file_lock *fl)
{}
EXPORT_SYMBOL_GPL();

/* Returns failure iff a successful lock operation should be canceled */
static int dlm_plock_callback(struct plock_op *op)
{}

int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
		     struct file_lock *fl)
{}
EXPORT_SYMBOL_GPL();

/*
 * NOTE: This implementation can only handle async lock requests as nfs
 * do it. It cannot handle cancellation of a pending lock request sitting
 * in wait_event(), but for now only nfs is the only user local kernel
 * user.
 */
int dlm_posix_cancel(dlm_lockspace_t *lockspace, u64 number, struct file *file,
		     struct file_lock *fl)
{}
EXPORT_SYMBOL_GPL();

int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
		  struct file_lock *fl)
{}
EXPORT_SYMBOL_GPL();

/* a read copies out one plock request from the send list */
static ssize_t dev_read(struct file *file, char __user *u, size_t count,
			loff_t *ppos)
{}

/* a write copies in one plock result that should match a plock_op
   on the recv list */
static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
			 loff_t *ppos)
{}

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

static const struct file_operations dev_fops =;

static struct miscdevice plock_dev_misc =;

int dlm_plock_init(void)
{}

void dlm_plock_exit(void)
{}