Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/librmb/rados-metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <sstream>
#include <rados/librados.hpp>

typedef unsigned int uint;

namespace librmb {

class RadosMetadata {
Expand Down
10 changes: 8 additions & 2 deletions src/librmb/rados-storage-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,13 @@ int RadosStorageImpl::move(std::string &src_oid, const char *src_ns, std::string
dest_io_ctx = io_ctx;

if (strcmp(src_ns, dest_ns) != 0) {
uint32_t src_fadvise_flags = LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL | LIBRADOS_OP_FLAG_FADVISE_NOCACHE;
uint32_t dest_fadvise_flags = LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL | LIBRADOS_OP_FLAG_FADVISE_DONTNEED;
src_io_ctx.dup(dest_io_ctx);
src_io_ctx.set_namespace(src_ns);
dest_io_ctx.set_namespace(dest_ns);
write_op.copy_from(src_oid, src_io_ctx, 0);
write_op.copy_from(src_oid, src_io_ctx, 0, src_fadvise_flags);
write_op.set_op_flags2(dest_fadvise_flags);

} else {
src_io_ctx = dest_io_ctx;
Expand Down Expand Up @@ -335,7 +338,10 @@ int RadosStorageImpl::copy(std::string &src_oid, const char *src_ns, std::string
} else {
src_io_ctx = dest_io_ctx;
}
write_op.copy_from(src_oid, src_io_ctx, 0);
uint32_t src_fadvise_flags = LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL | LIBRADOS_OP_FLAG_FADVISE_NOCACHE;
uint32_t dest_fadvise_flags = LIBRADOS_OP_FLAG_FADVISE_SEQUENTIAL | LIBRADOS_OP_FLAG_FADVISE_DONTNEED;
write_op.copy_from(src_oid, src_io_ctx, 0, src_fadvise_flags);
write_op.set_op_flags2(dest_fadvise_flags);

// because we create a copy, save date needs to be updated
// as an alternative we could use &ctx->data.save_date here if we save it to xattribute in write_metadata
Expand Down
2 changes: 1 addition & 1 deletion src/storage-rbox/ostream-bufferlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static ssize_t o_stream_buffer_sendv(struct ostream_private *stream, const struc
}
for (i = 0; i < iov_count; i++) {
// use unsigned char* for binary data!
bstream->buf->append(reinterpret_cast<const unsigned char *>(iov[i].iov_base), iov[i].iov_len);
bstream->buf->append(reinterpret_cast<const char *>(iov[i].iov_base), iov[i].iov_len);
stream->ostream.offset += iov[i].iov_len;
ret += iov[i].iov_len;
}
Expand Down
2 changes: 1 addition & 1 deletion src/storage-rbox/rbox-mail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ int rbox_get_guid_metadata(struct rbox_mail *mail, const char **value_r) {
}
// lost for some reason, use fallback
// index is empty. we have to check the object attributes do we have to tell someone that the index is broken?
if (rbox_mail_metadata_get(mail, rbox_metadata_key::RBOX_METADATA_GUID, value_r) < 0) {
if (rbox_mail_metadata_get(mail, rbox_metadata_key::RBOX_METADATA_GUID, const_cast<char**>(value_r)) < 0) {
return -1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/storage-rbox/rbox-save.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void init_output_stream(mail_save_context *_ctx) {
// create buffer ( delete is in wait_for_write_operations)
r_ctx->rados_mail->set_mail_buffer(new librados::bufferlist());
r_ctx->output_stream =
o_stream_create_bufferlist(r_ctx->rados_mail, &r_ctx->rados_storage, rbox->storage->config->is_write_chunks());
o_stream_create_bufferlist(r_ctx->rados_mail, const_cast<librmb::RadosStorage*>(&r_ctx->rados_storage), rbox->storage->config->is_write_chunks());
o_stream_cork(r_ctx->output_stream);
_ctx->data.output = r_ctx->output_stream;

Expand Down
2 changes: 1 addition & 1 deletion src/storage-rbox/typeof-def.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/* replacement for MODULE_CONTEXT (v 2.3, assigned void or long int, this is not allowed with c++) */
#define RBOX_MODULE_CONTEXT(obj, id_ctx) \
(module_get_context_id(&(id_ctx).id) < array_count(&(obj)->module_contexts) \
? (*((void **)array_idx_modifiable(&(obj)->module_contexts, module_get_context_id(&(id_ctx).id)) + \
? (*((index_mailbox_context **)array_idx_modifiable(&(obj)->module_contexts, module_get_context_id(&(id_ctx).id)) + \
OBJ_REGISTER_COMPATIBLE(obj, id_ctx))) \
: NULL)

Expand Down