Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282923
b: refs/heads/master
c: 757a427
h: refs/heads/master
i:
  282921: 1836554
  282919: d41d22b
v: v3
  • Loading branch information
David Teigland committed Jan 4, 2012
1 parent 02594fb commit 27d4aa6
Show file tree
Hide file tree
Showing 8 changed files with 481 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f95a34c66554235b70a681fcd9feebc195f7ec0e
refs/heads/master: 757a42719635495779462514458bbfbf12a37dac
48 changes: 46 additions & 2 deletions trunk/fs/dlm/dlm_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ struct dlm_member {
struct list_head list;
int nodeid;
int weight;
int slot;
int slot_prev;
uint32_t generation;
};

/*
* low nodeid saves array of these in ls_slots
*/

struct dlm_slot {
int nodeid;
int slot;
};

/*
Expand Down Expand Up @@ -337,7 +349,9 @@ static inline int rsb_flag(struct dlm_rsb *r, enum rsb_flags flag)
/* dlm_header is first element of all structs sent between nodes */

#define DLM_HEADER_MAJOR 0x00030000
#define DLM_HEADER_MINOR 0x00000000
#define DLM_HEADER_MINOR 0x00000001

#define DLM_HEADER_SLOTS 0x00000001

#define DLM_MSG 1
#define DLM_RCOM 2
Expand Down Expand Up @@ -425,10 +439,34 @@ union dlm_packet {
struct dlm_rcom rcom;
};

#define DLM_RSF_NEED_SLOTS 0x00000001

/* RCOM_STATUS data */
struct rcom_status {
__le32 rs_flags;
__le32 rs_unused1;
__le64 rs_unused2;
};

/* RCOM_STATUS_REPLY data */
struct rcom_config {
__le32 rf_lvblen;
__le32 rf_lsflags;
__le64 rf_unused;

/* DLM_HEADER_SLOTS adds: */
__le32 rf_flags;
__le16 rf_our_slot;
__le16 rf_num_slots;
__le32 rf_generation;
__le32 rf_unused1;
__le64 rf_unused2;
};

struct rcom_slot {
__le32 ro_nodeid;
__le16 ro_slot;
__le16 ro_unused1;
__le64 ro_unused2;
};

struct rcom_lock {
Expand All @@ -455,6 +493,7 @@ struct dlm_ls {
struct list_head ls_list; /* list of lockspaces */
dlm_lockspace_t *ls_local_handle;
uint32_t ls_global_id; /* global unique lockspace ID */
uint32_t ls_generation;
uint32_t ls_exflags;
int ls_lvblen;
int ls_count; /* refcount of processes in
Expand Down Expand Up @@ -493,6 +532,11 @@ struct dlm_ls {
int ls_total_weight;
int *ls_node_array;

int ls_slot;
int ls_num_slots;
int ls_slots_size;
struct dlm_slot *ls_slots;

struct dlm_rsb ls_stub_rsb; /* for returning errors */
struct dlm_lkb ls_stub_lkb; /* for returning errors */
struct dlm_message ls_stub_ms; /* for faking a reply */
Expand Down
5 changes: 5 additions & 0 deletions trunk/fs/dlm/lockspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,11 @@ static int new_lockspace(const char *name, int namelen, void **lockspace,
if (!ls->ls_recover_buf)
goto out_dirfree;

ls->ls_slot = 0;
ls->ls_num_slots = 0;
ls->ls_slots_size = 0;
ls->ls_slots = NULL;

INIT_LIST_HEAD(&ls->ls_recover_list);
spin_lock_init(&ls->ls_recover_list_lock);
ls->ls_recover_list_count = 0;
Expand Down
Loading

0 comments on commit 27d4aa6

Please sign in to comment.