req->r_osdc = osdc;
req->r_mempool = use_mempool;
req->r_num_ops = num_ops;
+ req->r_snapid = CEPH_NOSNAP;
+ req->r_snapc = ceph_get_snap_context(snapc);
kref_init(&req->r_kref);
init_completion(&req->r_completion);
unsigned int i;
req->r_snapid = snap_id;
- req->r_snapc = ceph_get_snap_context(snapc);
+ WARN_ON(snapc != req->r_snapc);
/* encode request */
msg->hdr.version = cpu_to_le16(4);
ceph_encode_64(&p, req->r_snapc ? req->r_snapc->seq : 0);
ceph_encode_32(&p, req->r_snapc ? req->r_snapc->num_snaps : 0);
if (req->r_snapc) {
- for (i = 0; i < snapc->num_snaps; i++) {
+ for (i = 0; i < req->r_snapc->num_snaps; i++) {
ceph_encode_64(&p, req->r_snapc->snaps[i]);
}
}