Bug #37378 » 0001-add-support-for-osd-copy-file-feature.patch
fs/ceph/file.c | ||
---|---|---|
CEPH_OSD_OP_FLAG_FADVISE_NOCACHE,
|
||
&dst_oid, &dst_oloc,
|
||
CEPH_OSD_OP_FLAG_FADVISE_SEQUENTIAL |
|
||
CEPH_OSD_OP_FLAG_FADVISE_DONTNEED, 0);
|
||
CEPH_OSD_OP_FLAG_FADVISE_DONTNEED,
|
||
dst_ci->i_truncate_seq, dst_ci->i_truncate_size,
|
||
CEPH_OSD_COPY_FROM_FLAG_TRUNCATE_SEQ);
|
||
if (err) {
|
||
dout("ceph_osdc_copy_from returned %d\n", err);
|
||
if (!ret)
|
include/linux/ceph/ceph_features.h | ||
---|---|---|
*/
|
||
#define CEPH_FEATURE_INCARNATION_1 (0ull)
|
||
#define CEPH_FEATURE_INCARNATION_2 (1ull<<57) // CEPH_FEATURE_SERVER_JEWEL
|
||
#define CEPH_FEATURE_INCARNATION_3 ((1ull<<57)|(1ull<<28)) // SERVER_MIMIC
|
||
#define DEFINE_CEPH_FEATURE(bit, incarnation, name) \
|
||
static const uint64_t CEPH_FEATURE_##name = (1ULL<<bit); \
|
||
... | ... | |
DEFINE_CEPH_FEATURE( 1, 1, NOSRCADDR)
|
||
DEFINE_CEPH_FEATURE_RETIRED( 2, 1, MONCLOCKCHECK, JEWEL, LUMINOUS)
|
||
DEFINE_CEPH_FEATURE( 2, 3, SERVER_NAUTILUS)
|
||
DEFINE_CEPH_FEATURE( 3, 1, FLOCK)
|
||
DEFINE_CEPH_FEATURE( 4, 1, SUBSCRIBE2)
|
||
DEFINE_CEPH_FEATURE( 5, 1, MONNAMES)
|
||
... | ... | |
DEFINE_CEPH_FEATURE_RETIRED(19, 1, CHUNKY_SCRUB, JEWEL, LUMINOUS)
|
||
DEFINE_CEPH_FEATURE_RETIRED(20, 1, MON_NULLROUTE, JEWEL, LUMINOUS)
|
||
DEFINE_CEPH_FEATURE(20, 2, OSD_COPY_FILE)
|
||
DEFINE_CEPH_FEATURE_RETIRED(21, 1, MON_GV, HAMMER, JEWEL)
|
||
DEFINE_CEPH_FEATURE(21, 2, SERVER_LUMINOUS)
|
||
... | ... | |
CEPH_FEATURE_MON_STATEFUL_SUB | \
|
||
CEPH_FEATURE_CRUSH_TUNABLES5 | \
|
||
CEPH_FEATURE_NEW_OSDOPREPLY_ENCODING | \
|
||
CEPH_FEATURE_CEPHX_V2)
|
||
CEPH_FEATURE_CEPHX_V2 | \
|
||
CEPH_FEATURE_OSD_COPY_FILE)
|
||
#define CEPH_FEATURES_REQUIRED_DEFAULT 0
|
||
include/linux/ceph/osd_client.h | ||
---|---|---|
struct ceph_object_id *dst_oid,
|
||
struct ceph_object_locator *dst_oloc,
|
||
u32 dst_fadvise_flags,
|
||
u32 truncate_seq, u64 truncate_size,
|
||
u8 copy_from_flags);
|
||
/* watch/notify */
|
include/linux/ceph/rados.h | ||
---|---|---|
CEPH_OSD_COPY_FROM_FLAG_MAP_SNAP_CLONE = 8, /* map snap direct to
|
||
* cloneid */
|
||
CEPH_OSD_COPY_FROM_FLAG_RWORDERED = 16, /* order with write */
|
||
CEPH_OSD_COPY_FROM_FLAG_TRUNCATE_SEQ = 32, /* send truncate_{seq,size} */
|
||
};
|
||
enum {
|
net/ceph/osd_client.c | ||
---|---|---|
ceph_monc_renew_subs(&osdc->client->monc);
|
||
}
|
||
static bool check_con_features(struct ceph_connection *con,
|
||
struct ceph_osd_request *req)
|
||
{
|
||
int i;
|
||
for (i = 0; i < req->r_num_ops; i++) {
|
||
switch (req->r_ops[i].op) {
|
||
case CEPH_OSD_OP_COPY_FROM:
|
||
if (!CEPH_HAVE_FEATURE(con->peer_features,
|
||
OSD_COPY_FILE))
|
||
return false;
|
||
break;
|
||
}
|
||
}
|
||
return true;
|
||
}
|
||
static void complete_request(struct ceph_osd_request *req, int err);
|
||
static void send_map_check(struct ceph_osd_request *req);
|
||
... | ... | |
}
|
||
mutex_lock(&osd->lock);
|
||
if (!check_con_features(&osd->o_con, req)) {
|
||
err = -EOPNOTSUPP;
|
||
need_send = false;
|
||
}
|
||
/*
|
||
* Assign the tid atomically with send_request() to protect
|
||
* multiple writes to the same object from racing with each
|
||
... | ... | |
struct ceph_object_locator *src_oloc,
|
||
u32 src_fadvise_flags,
|
||
u32 dst_fadvise_flags,
|
||
u32 truncate_seq, u64 truncate_size,
|
||
u8 copy_from_flags)
|
||
{
|
||
struct ceph_osd_req_op *op;
|
||
... | ... | |
end = p + PAGE_SIZE;
|
||
ceph_encode_string(&p, end, src_oid->name, src_oid->name_len);
|
||
encode_oloc(&p, end, src_oloc);
|
||
ceph_encode_32(&p, truncate_seq);
|
||
ceph_encode_64(&p, truncate_size);
|
||
op->indata_len = PAGE_SIZE - (end - p);
|
||
ceph_osd_data_pages_init(&op->copy_from.osd_data, pages,
|
||
... | ... | |
struct ceph_object_id *dst_oid,
|
||
struct ceph_object_locator *dst_oloc,
|
||
u32 dst_fadvise_flags,
|
||
u32 truncate_seq, u64 truncate_size,
|
||
u8 copy_from_flags)
|
||
{
|
||
struct ceph_osd_request *req;
|
||
... | ... | |
ret = osd_req_op_copy_from_init(req, src_snapid, src_version, src_oid,
|
||
src_oloc, src_fadvise_flags,
|
||
dst_fadvise_flags, copy_from_flags);
|
||
dst_fadvise_flags, truncate_seq,
|
||
truncate_size, copy_from_flags);
|
||
if (ret)
|
||
goto out;
|
||
- « Previous
- 1
- 2
- Next »