Lines Matching refs:recon_state
4183 static int send_reconnect_partial(struct ceph_reconnect_state *recon_state) in send_reconnect_partial() argument
4191 if (!recon_state->allow_multi) in send_reconnect_partial()
4195 BUG_ON(!recon_state->nr_caps == !recon_state->nr_realms); in send_reconnect_partial()
4211 if (recon_state->nr_caps) { in send_reconnect_partial()
4213 err = ceph_pagelist_encode_32(recon_state->pagelist, 0); in send_reconnect_partial()
4223 err = ceph_pagelist_encode_8(recon_state->pagelist, 1); in send_reconnect_partial()
4227 page = list_first_entry(&recon_state->pagelist->head, struct page, lru); in send_reconnect_partial()
4229 if (recon_state->nr_caps) { in send_reconnect_partial()
4231 *addr = cpu_to_le32(recon_state->nr_caps); in send_reconnect_partial()
4234 *(addr + 1) = cpu_to_le32(recon_state->nr_realms); in send_reconnect_partial()
4241 reply->hdr.data_len = cpu_to_le32(recon_state->pagelist->length); in send_reconnect_partial()
4242 ceph_msg_data_add_pagelist(reply, recon_state->pagelist); in send_reconnect_partial()
4244 ceph_con_send(&recon_state->session->s_con, reply); in send_reconnect_partial()
4245 ceph_pagelist_release(recon_state->pagelist); in send_reconnect_partial()
4247 recon_state->pagelist = _pagelist; in send_reconnect_partial()
4248 recon_state->nr_caps = 0; in send_reconnect_partial()
4249 recon_state->nr_realms = 0; in send_reconnect_partial()
4250 recon_state->msg_version = 5; in send_reconnect_partial()
4303 struct ceph_reconnect_state *recon_state = arg; in reconnect_caps_cb() local
4304 struct ceph_pagelist *pagelist = recon_state->pagelist; in reconnect_caps_cb()
4316 recon_state->msg_version >= 2); in reconnect_caps_cb()
4352 if (recon_state->msg_version >= 2) { in reconnect_caps_cb()
4381 if (recon_state->msg_version >= 2) { in reconnect_caps_cb()
4417 if (recon_state->msg_version >= 3) { in reconnect_caps_cb()
4438 err = send_reconnect_partial(recon_state); in reconnect_caps_cb()
4441 pagelist = recon_state->pagelist; in reconnect_caps_cb()
4449 if (recon_state->msg_version >= 3) { in reconnect_caps_cb()
4477 recon_state->nr_caps++; in reconnect_caps_cb()
4482 struct ceph_reconnect_state *recon_state) in encode_snap_realms() argument
4485 struct ceph_pagelist *pagelist = recon_state->pagelist; in encode_snap_realms()
4488 if (recon_state->msg_version >= 4) { in encode_snap_realms()
4504 if (recon_state->msg_version >= 4) { in encode_snap_realms()
4509 err = send_reconnect_partial(recon_state); in encode_snap_realms()
4512 pagelist = recon_state->pagelist; in encode_snap_realms()
4534 recon_state->nr_realms++; in encode_snap_realms()
4557 struct ceph_reconnect_state recon_state = { in send_mds_reconnect() local
4564 recon_state.pagelist = ceph_pagelist_alloc(GFP_NOFS); in send_mds_reconnect()
4565 if (!recon_state.pagelist) in send_mds_reconnect()
4614 err = ceph_pagelist_encode_32(recon_state.pagelist, 0); in send_mds_reconnect()
4619 recon_state.msg_version = 3; in send_mds_reconnect()
4620 recon_state.allow_multi = true; in send_mds_reconnect()
4622 recon_state.msg_version = 3; in send_mds_reconnect()
4624 recon_state.msg_version = 2; in send_mds_reconnect()
4627 err = ceph_iterate_session_caps(session, reconnect_caps_cb, &recon_state); in send_mds_reconnect()
4639 recon_state.pagelist->length + in send_mds_reconnect()
4642 if (recon_state.msg_version >= 4) { in send_mds_reconnect()
4650 if (!recon_state.allow_multi) { in send_mds_reconnect()
4654 if (recon_state.nr_caps) { in send_mds_reconnect()
4655 err = send_reconnect_partial(&recon_state); in send_mds_reconnect()
4659 recon_state.msg_version = 5; in send_mds_reconnect()
4663 err = encode_snap_realms(mdsc, &recon_state); in send_mds_reconnect()
4667 if (recon_state.msg_version >= 5) { in send_mds_reconnect()
4668 err = ceph_pagelist_encode_8(recon_state.pagelist, 0); in send_mds_reconnect()
4673 if (recon_state.nr_caps || recon_state.nr_realms) { in send_mds_reconnect()
4675 list_first_entry(&recon_state.pagelist->head, in send_mds_reconnect()
4678 if (recon_state.nr_caps) { in send_mds_reconnect()
4679 WARN_ON(recon_state.nr_realms != mdsc->num_snap_realms); in send_mds_reconnect()
4680 *addr = cpu_to_le32(recon_state.nr_caps); in send_mds_reconnect()
4681 } else if (recon_state.msg_version >= 4) { in send_mds_reconnect()
4682 *(addr + 1) = cpu_to_le32(recon_state.nr_realms); in send_mds_reconnect()
4687 reply->hdr.version = cpu_to_le16(recon_state.msg_version); in send_mds_reconnect()
4688 if (recon_state.msg_version >= 4) in send_mds_reconnect()
4691 reply->hdr.data_len = cpu_to_le32(recon_state.pagelist->length); in send_mds_reconnect()
4692 ceph_msg_data_add_pagelist(reply, recon_state.pagelist); in send_mds_reconnect()
4703 ceph_pagelist_release(recon_state.pagelist); in send_mds_reconnect()
4711 ceph_pagelist_release(recon_state.pagelist); in send_mds_reconnect()