Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
  dlm: linux/{dlm,dlm_device}.h: cleanup for userspace
  dlm: common max length definitions
  dlm: move plock code from gfs2
  dlm: recover nodes that are removed and re-added
  dlm: save master info after failed no-queue request
  dlm: make dlm_print_rsb() static
  dlm: match signedness between dlm_config_info and cluster_set
This commit is contained in:
Linus Torvalds
2008-04-22 13:44:23 -07:00
20 changed files with 277 additions and 162 deletions

View File

@@ -100,7 +100,7 @@ header-y += ixjuser.h
header-y += jffs2.h
header-y += keyctl.h
header-y += limits.h
header-y += lock_dlm_plock.h
header-y += dlm_plock.h
header-y += magic.h
header-y += major.h
header-y += matroxfb.h

View File

@@ -21,10 +21,7 @@
/* Lock levels and flags are here */
#include <linux/dlmconstants.h>
#define DLM_RESNAME_MAXLEN 64
#include <linux/types.h>
typedef void dlm_lockspace_t;
@@ -63,7 +60,7 @@ typedef void dlm_lockspace_t;
struct dlm_lksb {
int sb_status;
uint32_t sb_lkid;
__u32 sb_lkid;
char sb_flags;
char * sb_lvbptr;
};

View File

@@ -11,10 +11,16 @@
*******************************************************************************
******************************************************************************/
#ifndef _LINUX_DLM_DEVICE_H
#define _LINUX_DLM_DEVICE_H
/* This is the device interface for dlm, most users will use a library
* interface.
*/
#include <linux/dlm.h>
#include <linux/types.h>
#define DLM_USER_LVB_LEN 32
/* Version of the device interface */
@@ -94,10 +100,9 @@ struct dlm_lock_result {
#define DLM_USER_PURGE 6
#define DLM_USER_DEADLOCK 7
/* Arbitrary length restriction */
#define MAX_LS_NAME_LEN 64
/* Lockspace flags */
#define DLM_USER_LSFLG_AUTOFREE 1
#define DLM_USER_LSFLG_FORCEFREE 2
#endif

50
include/linux/dlm_plock.h Normal file
View File

@@ -0,0 +1,50 @@
/*
* Copyright (C) 2005-2008 Red Hat, Inc. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU General Public License v.2.
*/
#ifndef __DLM_PLOCK_DOT_H__
#define __DLM_PLOCK_DOT_H__
#define DLM_PLOCK_MISC_NAME "dlm_plock"
#define DLM_PLOCK_VERSION_MAJOR 1
#define DLM_PLOCK_VERSION_MINOR 1
#define DLM_PLOCK_VERSION_PATCH 0
enum {
DLM_PLOCK_OP_LOCK = 1,
DLM_PLOCK_OP_UNLOCK,
DLM_PLOCK_OP_GET,
};
struct dlm_plock_info {
__u32 version[3];
__u8 optype;
__u8 ex;
__u8 wait;
__u8 pad;
__u32 pid;
__s32 nodeid;
__s32 rv;
__u32 fsid;
__u64 number;
__u64 start;
__u64 end;
__u64 owner;
};
#ifdef __KERNEL__
int dlm_posix_lock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
int cmd, struct file_lock *fl);
int dlm_posix_unlock(dlm_lockspace_t *lockspace, u64 number, struct file *file,
struct file_lock *fl);
int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file,
struct file_lock *fl);
#endif /* __KERNEL__ */
#endif

View File

@@ -18,6 +18,10 @@
* Constants used by DLM interface.
*/
#define DLM_LOCKSPACE_LEN 64
#define DLM_RESNAME_MAXLEN 64
/*
* Lock Modes
*/

View File

@@ -1,41 +0,0 @@
/*
* Copyright (C) 2005 Red Hat, Inc. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU General Public License v.2.
*/
#ifndef __LOCK_DLM_PLOCK_DOT_H__
#define __LOCK_DLM_PLOCK_DOT_H__
#define GDLM_PLOCK_MISC_NAME "lock_dlm_plock"
#define GDLM_PLOCK_VERSION_MAJOR 1
#define GDLM_PLOCK_VERSION_MINOR 1
#define GDLM_PLOCK_VERSION_PATCH 0
enum {
GDLM_PLOCK_OP_LOCK = 1,
GDLM_PLOCK_OP_UNLOCK,
GDLM_PLOCK_OP_GET,
};
struct gdlm_plock_info {
__u32 version[3];
__u8 optype;
__u8 ex;
__u8 wait;
__u8 pad;
__u32 pid;
__s32 nodeid;
__s32 rv;
__u32 fsid;
__u64 number;
__u64 start;
__u64 end;
__u64 owner;
};
#endif