static enum drbd_packet drbd_recv_fp(struct drbd_tconn *tconn, struct socket *sock)
{
- struct p_header80 *h = &tconn->data.rbuf.header.h80;
+ struct p_header80 *h = tconn->data.rbuf;
int rr;
rr = drbd_recv_short(sock, h, sizeof(*h), 0);
static int drbd_recv_header(struct drbd_tconn *tconn, struct packet_info *pi)
{
- struct p_header *h = &tconn->data.rbuf.header;
+ struct p_header *h = tconn->data.rbuf;
int err;
err = drbd_recv_all_warn(tconn, h, sizeof(*h));
unsigned int data_size)
{
int rv;
- struct p_barrier *p = &mdev->tconn->data.rbuf.barrier;
+ struct p_barrier *p = mdev->tconn->data.rbuf;
struct drbd_epoch *epoch;
inc_unacked(mdev);
struct drbd_request *req;
sector_t sector;
int err;
- struct p_data *p = &mdev->tconn->data.rbuf.data;
+ struct p_data *p = mdev->tconn->data.rbuf;
sector = be64_to_cpu(p->sector);
{
sector_t sector;
int err;
- struct p_data *p = &mdev->tconn->data.rbuf.data;
+ struct p_data *p = mdev->tconn->data.rbuf;
sector = be64_to_cpu(p->sector);
D_ASSERT(p->block_id == ID_SYNCER);
{
sector_t sector;
struct drbd_peer_request *peer_req;
- struct p_data *p = &mdev->tconn->data.rbuf.data;
+ struct p_data *p = mdev->tconn->data.rbuf;
u32 peer_seq = be32_to_cpu(p->seq_num);
int rw = WRITE;
u32 dp_flags;
struct digest_info *di = NULL;
int size, verb;
unsigned int fault_type;
- struct p_block_req *p = &mdev->tconn->data.rbuf.block_req;
+ struct p_block_req *p = mdev->tconn->data.rbuf;
sector = be64_to_cpu(p->sector);
size = be32_to_cpu(p->blksize);
static int receive_protocol(struct drbd_tconn *tconn, enum drbd_packet cmd,
unsigned int data_size)
{
- struct p_protocol *p = &tconn->data.rbuf.protocol;
+ struct p_protocol *p = tconn->data.rbuf;
int p_proto, p_after_sb_0p, p_after_sb_1p, p_after_sb_2p;
int p_want_lose, p_two_primaries, cf;
char p_integrity_alg[SHARED_SECRET_MAX] = "";
static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packet cmd,
unsigned int packet_size)
{
- struct p_rs_param_95 *p = &mdev->tconn->data.rbuf.rs_param_95;
+ struct p_rs_param_95 *p = mdev->tconn->data.rbuf;
unsigned int header_size, data_size, exp_max_sz;
struct crypto_hash *verify_tfm = NULL;
struct crypto_hash *csums_tfm = NULL;
static int receive_sizes(struct drbd_conf *mdev, enum drbd_packet cmd,
unsigned int data_size)
{
- struct p_sizes *p = &mdev->tconn->data.rbuf.sizes;
+ struct p_sizes *p = mdev->tconn->data.rbuf;
enum determine_dev_size dd = unchanged;
sector_t p_size, p_usize, my_usize;
int ldsc = 0; /* local disk size changed */
static int receive_uuids(struct drbd_conf *mdev, enum drbd_packet cmd,
unsigned int data_size)
{
- struct p_uuids *p = &mdev->tconn->data.rbuf.uuids;
+ struct p_uuids *p = mdev->tconn->data.rbuf;
u64 *p_uuid;
int i, updated_uuids = 0;
static int receive_req_state(struct drbd_conf *mdev, enum drbd_packet cmd,
unsigned int data_size)
{
- struct p_req_state *p = &mdev->tconn->data.rbuf.req_state;
+ struct p_req_state *p = mdev->tconn->data.rbuf;
union drbd_state mask, val;
enum drbd_state_rv rv;
static int receive_req_conn_state(struct drbd_tconn *tconn, enum drbd_packet cmd,
unsigned int data_size)
{
- struct p_req_state *p = &tconn->data.rbuf.req_state;
+ struct p_req_state *p = tconn->data.rbuf;
union drbd_state mask, val;
enum drbd_state_rv rv;
static int receive_state(struct drbd_conf *mdev, enum drbd_packet cmd,
unsigned int data_size)
{
- struct p_state *p = &mdev->tconn->data.rbuf.state;
+ struct p_state *p = mdev->tconn->data.rbuf;
union drbd_state os, ns, peer_state;
enum drbd_disk_state real_peer_disk;
enum chg_state_flags cs_flags;
static int receive_sync_uuid(struct drbd_conf *mdev, enum drbd_packet cmd,
unsigned int data_size)
{
- struct p_rs_uuid *p = &mdev->tconn->data.rbuf.rs_uuid;
+ struct p_rs_uuid *p = mdev->tconn->data.rbuf;
wait_event(mdev->misc_wait,
mdev->state.conn == C_WF_SYNC_UUID ||
struct bm_xfer_ctx c;
void *buffer;
int err;
- struct p_header *h = &mdev->tconn->data.rbuf.header;
+ struct p_header *h = mdev->tconn->data.rbuf;
struct packet_info pi;
drbd_bm_lock(mdev, "receive bitmap", BM_LOCKED_SET_ALLOWED);
static int receive_out_of_sync(struct drbd_conf *mdev, enum drbd_packet cmd,
unsigned int data_size)
{
- struct p_block_desc *p = &mdev->tconn->data.rbuf.block_desc;
+ struct p_block_desc *p = mdev->tconn->data.rbuf;
switch (mdev->state.conn) {
case C_WF_SYNC_UUID:
[P_CONN_ST_CHG_REQ] = { 0, sizeof(struct p_req_state), CONN, { .conn_fn = receive_req_conn_state } },
};
-/* All handler functions that expect a sub-header get that sub-heder in
- mdev->tconn->data.rbuf.header.head.payload.
-
- Usually in mdev->tconn->data.rbuf.header.head the callback can find the usual
- p_header, but they may not rely on that. Since there is also p_header95 !
- */
-
static void drbdd(struct drbd_tconn *tconn)
{
- struct p_header *header = &tconn->data.rbuf.header;
+ struct p_header *header = tconn->data.rbuf;
struct packet_info pi;
size_t shs; /* sub header size */
int err;
static int drbd_do_handshake(struct drbd_tconn *tconn)
{
/* ASSERT current == tconn->receiver ... */
- struct p_handshake *p = &tconn->data.rbuf.handshake;
+ struct p_handshake *p = tconn->data.rbuf;
const int expect = sizeof(struct p_handshake) - sizeof(struct p_header80);
struct packet_info pi;
int err;
static int got_conn_RqSReply(struct drbd_tconn *tconn, enum drbd_packet cmd)
{
- struct p_req_state_reply *p = &tconn->meta.rbuf.req_state_reply;
+ struct p_req_state_reply *p = tconn->meta.rbuf;
int retcode = be32_to_cpu(p->retcode);
if (retcode >= SS_SUCCESS) {
static int got_RqSReply(struct drbd_conf *mdev, enum drbd_packet cmd)
{
- struct p_req_state_reply *p = &mdev->tconn->meta.rbuf.req_state_reply;
+ struct p_req_state_reply *p = mdev->tconn->meta.rbuf;
int retcode = be32_to_cpu(p->retcode);
if (retcode >= SS_SUCCESS) {
static int got_IsInSync(struct drbd_conf *mdev, enum drbd_packet cmd)
{
- struct p_block_ack *p = &mdev->tconn->meta.rbuf.block_ack;
+ struct p_block_ack *p = mdev->tconn->meta.rbuf;
sector_t sector = be64_to_cpu(p->sector);
int blksize = be32_to_cpu(p->blksize);
static int got_BlockAck(struct drbd_conf *mdev, enum drbd_packet cmd)
{
- struct p_block_ack *p = &mdev->tconn->meta.rbuf.block_ack;
+ struct p_block_ack *p = mdev->tconn->meta.rbuf;
sector_t sector = be64_to_cpu(p->sector);
int blksize = be32_to_cpu(p->blksize);
enum drbd_req_event what;
static int got_NegAck(struct drbd_conf *mdev, enum drbd_packet cmd)
{
- struct p_block_ack *p = &mdev->tconn->meta.rbuf.block_ack;
+ struct p_block_ack *p = mdev->tconn->meta.rbuf;
sector_t sector = be64_to_cpu(p->sector);
int size = be32_to_cpu(p->blksize);
bool missing_ok = mdev->tconn->net_conf->wire_protocol == DRBD_PROT_A ||
static int got_NegDReply(struct drbd_conf *mdev, enum drbd_packet cmd)
{
- struct p_block_ack *p = &mdev->tconn->meta.rbuf.block_ack;
+ struct p_block_ack *p = mdev->tconn->meta.rbuf;
sector_t sector = be64_to_cpu(p->sector);
update_peer_seq(mdev, be32_to_cpu(p->seq_num));
{
sector_t sector;
int size;
- struct p_block_ack *p = &mdev->tconn->meta.rbuf.block_ack;
+ struct p_block_ack *p = mdev->tconn->meta.rbuf;
sector = be64_to_cpu(p->sector);
size = be32_to_cpu(p->blksize);
static int got_BarrierAck(struct drbd_conf *mdev, enum drbd_packet cmd)
{
- struct p_barrier_ack *p = &mdev->tconn->meta.rbuf.barrier_ack;
+ struct p_barrier_ack *p = mdev->tconn->meta.rbuf;
tl_release(mdev->tconn, p->barrier, be32_to_cpu(p->set_size));
static int got_OVResult(struct drbd_conf *mdev, enum drbd_packet cmd)
{
- struct p_block_ack *p = &mdev->tconn->meta.rbuf.block_ack;
+ struct p_block_ack *p = mdev->tconn->meta.rbuf;
struct drbd_work *w;
sector_t sector;
int size;
int drbd_asender(struct drbd_thread *thi)
{
struct drbd_tconn *tconn = thi->tconn;
- struct p_header *h = &tconn->meta.rbuf.header;
+ struct p_header *h = tconn->meta.rbuf;
struct asender_cmd *cmd = NULL;
struct packet_info pi;
int rv;