All of lore.kernel.org
 help / color / mirror / Atom feed
* Transaction struct Op
@ 2015-07-02 14:05 Dałek, Piotr
  2015-07-02 17:26 ` Haomai Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Dałek, Piotr @ 2015-07-02 14:05 UTC (permalink / raw)
  To: ceph-devel

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-07-03 14:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-02 14:05 Transaction struct Op Dałek, Piotr
2015-07-02 17:26 ` Haomai Wang
2015-07-03  6:31   ` Dałek, Piotr
2015-07-03 14:52     ` Matt W. Benjamin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.