📄 evms_ecr.h
字号:
/* * * Copyright (c) International Business Machines Corp., 2000 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See * the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *//* * linux/include/linux/evms_ecr.h * * EVMS Cluster enablement kernel header file * */#ifndef __EVMS_ECR__#define __EVMS_ECR__#define ECR_SUCCESS 0#define ECR_FAIL -1/* * Beginning of group messaging API */typedef int ecr_group_t;typedef int ecr_nodeid_t;typedef void ecr_cred_t;typedef void ecr_instance_t;typedef void ecr_message_t;typedef enum ecr_type_s { ECR_GROUP_START, /* 0th entry is reserved */ ECR_P2P, /* Point to Point message type */ ECR_BROADCAST, /* Broadcast message type */ ECR_ATOMIC_EXECUTE, /* Atomic execute type */ ECR_GROUP_LAST /* Just a last enum type, not a message type */} ecr_type_t;typedef struct ecr_table_s { void (*join) (ecr_nodeid_t, uint, ecr_nodeid_t *, ecr_instance_t *); int (*can_join)(ecr_nodeid_t, ecr_cred_t *, size_t, ecr_instance_t *); void (*leave) (ecr_nodeid_t, ecr_instance_t *); void (*recover)(ecr_nodeid_t, ecr_instance_t *); void (*message)(ecr_message_t *, ecr_type_t, ecr_nodeid_t, void *, size_t, ecr_instance_t *); void (*vol_leave)(ecr_nodeid_t, ecr_instance_t *);} ecr_table_t;#define ECR_GROUPNAME_MAX_SIZE NAME_SIZE /* maximum size of a group name */ecr_group_t ecr_group_join(char *, ecr_table_t *, ecr_cred_t *, size_t, ecr_instance_t *);void ecr_group_leave(ecr_group_t);int ecr_group_send(ecr_group_t, ecr_nodeid_t, void *, size_t, ecr_instance_t *, void callback(int, ecr_instance_t *));int ecr_group_send_wait(ecr_group_t, ecr_nodeid_t, void *, size_t, int *);int ecr_group_broadcast(ecr_group_t, void *, size_t, ecr_instance_t *, void callback(u_char, ecr_instance_t *));int ecr_group_broadcast_wait(ecr_group_t, void *, size_t, u_char *);int ecr_group_atomic_execute(ecr_group_t, void *, size_t, ecr_instance_t *, void callback(ecr_instance_t *));int ecr_group_atomic_execute_wait(ecr_group_t, void *, size_t);void ecr_group_success_response(ecr_message_t *);void ecr_group_failure_response(ecr_message_t *, int);/* * Beginning of distributed lock API */typedef int ecr_lock_t;typedef enum ecr_lock_mode_s { ECR_LOCK_START, /* 0th entry is reserved */ ECR_LOCK_CONCURRENT, /* concurrent access */ ECR_LOCK_EXCLUSIVE, /* exclusive access */ ECR_LOCK_LAST /* Just a last enum type, not a lock type */} ecr_lock_mode_t;typedef u_char ecr_mode_t;#define ECR_LOCKNAME_MAX_SIZE NAME_SIZE /* maximum size of a lock name */#define ECR_BLOCK 1 /* waitflag set */ecr_lock_t ecr_lock_create(char * /* lock name */);int ecr_lock(ecr_lock_t, u_int64_t, u_int64_t, ecr_lock_mode_t, u_char /*waitflag*/);int ecr_unlock(ecr_lock_t, u_int64_t, u_int64_t);#endif /* __EVMS_ECR__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -