linux/fs/dlm/lockspace.c

// SPDX-License-Identifier: GPL-2.0-only
/******************************************************************************
*******************************************************************************
**
**  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
**  Copyright (C) 2004-2011 Red Hat, Inc.  All rights reserved.
**
**
*******************************************************************************
******************************************************************************/

#include <linux/module.h>

#include "dlm_internal.h"
#include "lockspace.h"
#include "member.h"
#include "recoverd.h"
#include "dir.h"
#include "midcomms.h"
#include "config.h"
#include "memory.h"
#include "lock.h"
#include "recover.h"
#include "requestqueue.h"
#include "user.h"
#include "ast.h"

static int			ls_count;
static struct mutex		ls_lock;
static struct list_head		lslist;
static spinlock_t		lslist_lock;

static ssize_t dlm_control_store(struct dlm_ls *ls, const char *buf, size_t len)
{}

static ssize_t dlm_event_store(struct dlm_ls *ls, const char *buf, size_t len)
{}

static ssize_t dlm_id_show(struct dlm_ls *ls, char *buf)
{}

static ssize_t dlm_id_store(struct dlm_ls *ls, const char *buf, size_t len)
{}

static ssize_t dlm_nodir_show(struct dlm_ls *ls, char *buf)
{}

static ssize_t dlm_nodir_store(struct dlm_ls *ls, const char *buf, size_t len)
{}

static ssize_t dlm_recover_status_show(struct dlm_ls *ls, char *buf)
{}

static ssize_t dlm_recover_nodeid_show(struct dlm_ls *ls, char *buf)
{}

struct dlm_attr {};

static struct dlm_attr dlm_attr_control =;

static struct dlm_attr dlm_attr_event =;

static struct dlm_attr dlm_attr_id =;

static struct dlm_attr dlm_attr_nodir =;

static struct dlm_attr dlm_attr_recover_status =;

static struct dlm_attr dlm_attr_recover_nodeid =;

static struct attribute *dlm_attrs[] =;
ATTRIBUTE_GROUPS();

static ssize_t dlm_attr_show(struct kobject *kobj, struct attribute *attr,
			     char *buf)
{}

static ssize_t dlm_attr_store(struct kobject *kobj, struct attribute *attr,
			      const char *buf, size_t len)
{}

static void lockspace_kobj_release(struct kobject *k)
{}

static const struct sysfs_ops dlm_attr_ops =;

static struct kobj_type dlm_ktype =;

static struct kset *dlm_kset;

static int do_uevent(struct dlm_ls *ls, int in)
{}

static int dlm_uevent(const struct kobject *kobj, struct kobj_uevent_env *env)
{}

static const struct kset_uevent_ops dlm_uevent_ops =;

int __init dlm_lockspace_init(void)
{}

void dlm_lockspace_exit(void)
{}

struct dlm_ls *dlm_find_lockspace_global(uint32_t id)
{}

struct dlm_ls *dlm_find_lockspace_local(dlm_lockspace_t *lockspace)
{}

struct dlm_ls *dlm_find_lockspace_device(int minor)
{}

void dlm_put_lockspace(struct dlm_ls *ls)
{}

static void remove_lockspace(struct dlm_ls *ls)
{}

static int threads_start(void)
{}

static int new_lockspace(const char *name, const char *cluster,
			 uint32_t flags, int lvblen,
			 const struct dlm_lockspace_ops *ops, void *ops_arg,
			 int *ops_result, dlm_lockspace_t **lockspace)
{}

static int __dlm_new_lockspace(const char *name, const char *cluster,
			       uint32_t flags, int lvblen,
			       const struct dlm_lockspace_ops *ops,
			       void *ops_arg, int *ops_result,
			       dlm_lockspace_t **lockspace)
{}

int dlm_new_lockspace(const char *name, const char *cluster, uint32_t flags,
		      int lvblen, const struct dlm_lockspace_ops *ops,
		      void *ops_arg, int *ops_result,
		      dlm_lockspace_t **lockspace)
{}

int dlm_new_user_lockspace(const char *name, const char *cluster,
			   uint32_t flags, int lvblen,
			   const struct dlm_lockspace_ops *ops,
			   void *ops_arg, int *ops_result,
			   dlm_lockspace_t **lockspace)
{}

static int lkb_idr_free(struct dlm_lkb *lkb)
{}

/* NOTE: We check the lkbxa here rather than the resource table.
   This is because there may be LKBs queued as ASTs that have been unlinked
   from their RSBs and are pending deletion once the AST has been delivered */

static int lockspace_busy(struct dlm_ls *ls, int force)
{}

static void rhash_free_rsb(void *ptr, void *arg)
{}

static int release_lockspace(struct dlm_ls *ls, int force)
{}

/*
 * Called when a system has released all its locks and is not going to use the
 * lockspace any longer.  We free everything we're managing for this lockspace.
 * Remaining nodes will go through the recovery process as if we'd died.  The
 * lockspace must continue to function as usual, participating in recoveries,
 * until this returns.
 *
 * Force has 4 possible values:
 * 0 - don't destroy lockspace if it has any LKBs
 * 1 - destroy lockspace if it has remote LKBs but not if it has local LKBs
 * 2 - destroy lockspace regardless of LKBs
 * 3 - destroy lockspace as part of a forced shutdown
 */

int dlm_release_lockspace(void *lockspace, int force)
{}

void dlm_stop_lockspaces(void)
{}