Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

libceph: add CEPH_OSD_OP_ASSERT_VER support

...and record the user_version in the reply in a new field in
ceph_osd_request, so we can populate the assert_ver appropriately.
Shuffle the fields a bit too so that the new field fits in an
existing hole on x86_64.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

authored by

Jeff Layton and committed by
Ilya Dryomov
69dd3b39 77cdb7e1

+14 -1
+5 -1
include/linux/ceph/osd_client.h
··· 198 198 u32 src_fadvise_flags; 199 199 struct ceph_osd_data osd_data; 200 200 } copy_from; 201 + struct { 202 + u64 ver; 203 + } assert_ver; 201 204 }; 202 205 }; 203 206 ··· 255 252 struct ceph_osd_client *r_osdc; 256 253 struct kref r_kref; 257 254 bool r_mempool; 255 + bool r_linger; /* don't resend on failure */ 258 256 struct completion r_completion; /* private to osd_client.c */ 259 257 ceph_osdc_callback_t r_callback; 260 258 ··· 268 264 struct ceph_snap_context *r_snapc; /* for writes */ 269 265 struct timespec64 r_mtime; /* ditto */ 270 266 u64 r_data_offset; /* ditto */ 271 - bool r_linger; /* don't resend on failure */ 272 267 273 268 /* internal */ 269 + u64 r_version; /* data version sent in reply */ 274 270 unsigned long r_stamp; /* jiffies, send or check time */ 275 271 unsigned long r_start_stamp; /* jiffies */ 276 272 ktime_t r_start_latency; /* ktime_t */
+4
include/linux/ceph/rados.h
··· 524 524 __le64 cookie; 525 525 } __attribute__ ((packed)) notify; 526 526 struct { 527 + __le64 unused; 528 + __le64 ver; 529 + } __attribute__ ((packed)) assert_ver; 530 + struct { 527 531 __le64 offset, length; 528 532 __le64 src_offset; 529 533 } __attribute__ ((packed)) clonerange;
+5
net/ceph/osd_client.c
··· 1048 1048 dst->copy_from.src_fadvise_flags = 1049 1049 cpu_to_le32(src->copy_from.src_fadvise_flags); 1050 1050 break; 1051 + case CEPH_OSD_OP_ASSERT_VER: 1052 + dst->assert_ver.unused = cpu_to_le64(0); 1053 + dst->assert_ver.ver = cpu_to_le64(src->assert_ver.ver); 1054 + break; 1051 1055 default: 1052 1056 pr_err("unsupported osd opcode %s\n", 1053 1057 ceph_osd_op_name(src->op)); ··· 3863 3859 * one (type of) reply back. 3864 3860 */ 3865 3861 WARN_ON(!(m.flags & CEPH_OSD_FLAG_ONDISK)); 3862 + req->r_version = m.user_version; 3866 3863 req->r_result = m.result ?: data_len; 3867 3864 finish_request(req); 3868 3865 mutex_unlock(&osd->lock);