]> bbs.cooldavid.org Git - net-next-2.6.git/blame - fs/ocfs2/stackglue.h
ocfs2: Use -errno instead of dlm_status for ocfs2_dlm_lock/unlock() API.
[net-next-2.6.git] / fs / ocfs2 / stackglue.h
CommitLineData
24ef1815
JB
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * stackglue.h
5 *
6 * Glue to the underlying cluster stack.
7 *
8 * Copyright (C) 2007 Oracle. All rights reserved.
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public
12 * License as published by the Free Software Foundation, version 2.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 */
19
20
21#ifndef STACKGLUE_H
22#define STACKGLUE_H
23
bd3e7610
JB
24#include <linux/types.h>
25#include <linux/list.h>
26#include <linux/dlmconstants.h>
27
28/*
29 * dlmconstants.h does not have a LOCAL flag. We hope to remove it
30 * some day, but right now we need it. Let's fake it. This value is larger
31 * than any flag in dlmconstants.h.
32 */
33#define DLM_LKF_LOCAL 0x00100000
34
35#include "dlm/dlmapi.h"
36
24ef1815
JB
37struct ocfs2_locking_protocol {
38 void (*lp_lock_ast)(void *astarg);
39 void (*lp_blocking_ast)(void *astarg, int level);
7431cd7e 40 void (*lp_unlock_ast)(void *astarg, int error);
24ef1815
JB
41};
42
7431cd7e 43int ocfs2_dlm_lock(struct dlm_ctxt *dlm,
24ef1815
JB
44 int mode,
45 struct dlm_lockstatus *lksb,
46 u32 flags,
47 void *name,
48 unsigned int namelen,
49 void *astarg);
7431cd7e 50int ocfs2_dlm_unlock(struct dlm_ctxt *dlm,
24ef1815
JB
51 struct dlm_lockstatus *lksb,
52 u32 flags,
53 void *astarg);
54
55void o2cb_get_stack(struct ocfs2_locking_protocol *proto);
56void o2cb_put_stack(void);
57
58#endif /* STACKGLUE_H */