Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 345810
b: refs/heads/master
c: cf29c9d
h: refs/heads/master
v: v3
  • Loading branch information
Philipp Reisner committed Oct 14, 2011
1 parent 2b1e729 commit 08d6732
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 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: 8410da8f0e3ff5c97bce1b10627316be509ce476
refs/heads/master: cf29c9d8c8eff69885ee4c8ddf5f9db4dcc5ab6e
19 changes: 18 additions & 1 deletion trunk/drivers/block/drbd/drbd_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,10 @@ enum drbd_packet {
P_DELAY_PROBE = 0x27, /* is used on BOTH sockets */
P_OUT_OF_SYNC = 0x28, /* Mark as out of sync (Outrunning), data socket */
P_RS_CANCEL = 0x29, /* meta: Used to cancel RS_DATA_REQUEST packet by SyncSource */
P_CONN_ST_CHG_REQ = 0x2a, /* data sock: Connection wide state request */
P_CONN_ST_CHG_REPLY = 0x2b, /* meta sock: Connection side state req reply */

P_MAX_CMD = 0x2A,
P_MAX_CMD = 0x2c,
P_MAY_IGNORE = 0x100, /* Flag to test if (cmd > P_MAY_IGNORE) ... */
P_MAX_OPT_CMD = 0x101,

Expand Down Expand Up @@ -1177,6 +1179,8 @@ extern int drbd_send_uuids(struct drbd_conf *mdev);
extern int drbd_send_uuids_skip_initial_sync(struct drbd_conf *mdev);
extern int drbd_gen_and_send_sync_uuid(struct drbd_conf *mdev);
extern int drbd_send_sizes(struct drbd_conf *mdev, int trigger_reply, enum dds_flags flags);
extern int _conn_send_state_req(struct drbd_tconn *, int vnr, enum drbd_packet cmd,
union drbd_state, union drbd_state);
extern int _drbd_send_state(struct drbd_conf *mdev);
extern int drbd_send_state(struct drbd_conf *mdev);
extern int _conn_send_cmd(struct drbd_tconn *tconn, int vnr, struct socket *sock,
Expand Down Expand Up @@ -1896,6 +1900,19 @@ static inline int drbd_send_ping_ack(struct drbd_tconn *tconn)
return conn_send_cmd(tconn, 0, USE_META_SOCKET, P_PING_ACK, &h, sizeof(h));
}

static inline int drbd_send_state_req(struct drbd_conf *mdev,
union drbd_state mask, union drbd_state val)
{
return _conn_send_state_req(mdev->tconn, mdev->vnr, P_STATE_CHG_REQ, mask, val);
}

static inline int conn_send_state_req(struct drbd_tconn *tconn,
union drbd_state mask, union drbd_state val)
{
enum drbd_packet cmd = tconn->agreed_pro_version < 100 ? P_STATE_CHG_REQ : P_CONN_ST_CHG_REQ;
return _conn_send_state_req(tconn, 0, cmd, mask, val);
}

static inline void drbd_thread_stop(struct drbd_thread *thi)
{
_drbd_thread_stop(thi, false, true);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,15 +970,15 @@ int drbd_send_state(struct drbd_conf *mdev)
return ok;
}

int drbd_send_state_req(struct drbd_conf *mdev,
union drbd_state mask, union drbd_state val)
int _conn_send_state_req(struct drbd_tconn *tconn, int vnr, enum drbd_packet cmd,
union drbd_state mask, union drbd_state val)
{
struct p_req_state p;

p.mask = cpu_to_be32(mask.i);
p.val = cpu_to_be32(val.i);

return drbd_send_cmd(mdev, USE_DATA_SOCKET, P_STATE_CHG_REQ, &p.head, sizeof(p));
return conn_send_cmd(tconn, vnr, USE_DATA_SOCKET, cmd, &p.head, sizeof(p));
}

int drbd_send_sr_reply(struct drbd_conf *mdev, enum drbd_state_rv retcode)
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/block/drbd/drbd_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ struct after_state_chg_work {
struct completion *done;
};


extern void _tl_restart(struct drbd_conf *mdev, enum drbd_req_event what);
int drbd_send_state_req(struct drbd_conf *, union drbd_state, union drbd_state);
static int w_after_state_ch(struct drbd_work *w, int unused);
static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
union drbd_state ns, enum chg_state_flags flags);
Expand Down

0 comments on commit 08d6732

Please sign in to comment.