Yes, some fields only used for special ops. But union may increase the complexity of stuct. And the extra memory may not a problem because "Ops" in one transaction should be within ten. On Thu, Jul 2, 2015 at 10:05 PM, Dałek, Piotr <Piotr.Dalek@xxxxxxxxxxxxxx> wrote: > Hello, > > In ObjectStore.h we have the following stuct: > > struct Op { > __le32 op; > __le32 cid; > __le32 oid; > __le64 off; > __le64 len; > __le32 dest_cid; > __le32 dest_oid; //OP_CLONE, OP_CLONERANGE > __le64 dest_off; //OP_CLONERANGE > __le32 hint_type; //OP_COLL_HINT > __le64 expected_object_size; //OP_SETALLOCHINT > __le64 expected_write_size; //OP_SETALLOCHINT > __le32 split_bits; //OP_SPLIT_COLLECTION2 > __le32 split_rem; //OP_SPLIT_COLLECTION2 > } __attribute__ ((packed)) ; > > Some of the fields (like hint_type and split_rem) are totally unused in certain ops, and they eat up space anyway. Maybe we should use unions here, and re-use some of the fields for other purposes? Right now the structure is 72 bytes in size, and for most ops, at least 32 bytes are always wasted. > > > With best regards / Pozdrawiam > Piotr Dałek > > -- Best Regards, Wheat -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html