X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fos%2Fkstore%2Fkstore_types.h;fp=src%2Fceph%2Fsrc%2Fos%2Fkstore%2Fkstore_types.h;h=7cfb2475d1f2ff5ebc28ffa6c3f9f3375013ed2b;hb=812ff6ca9fcd3e629e49d4328905f33eee8ca3f5;hp=0000000000000000000000000000000000000000;hpb=15280273faafb77777eab341909a3f495cf248d9;p=stor4nfv.git diff --git a/src/ceph/src/os/kstore/kstore_types.h b/src/ceph/src/os/kstore/kstore_types.h new file mode 100644 index 0000000..7cfb247 --- /dev/null +++ b/src/ceph/src/os/kstore/kstore_types.h @@ -0,0 +1,68 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +/* + * Ceph - scalable distributed file system + * + * Copyright (C) 2014 Red Hat + * + * This is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software + * Foundation. See file COPYING. + * + */ + +#ifndef CEPH_OSD_KSTORE_TYPES_H +#define CEPH_OSD_KSTORE_TYPES_H + +#include +#include "include/types.h" +#include "include/interval_set.h" +#include "include/utime.h" +#include "common/hobject.h" + +namespace ceph { + class Formatter; +} +/// collection metadata +struct kstore_cnode_t { + uint32_t bits; ///< how many bits of coll pgid are significant + + explicit kstore_cnode_t(int b=0) : bits(b) {} + + void encode(bufferlist& bl) const; + void decode(bufferlist::iterator& p); + void dump(Formatter *f) const; + static void generate_test_instances(list& o); +}; +WRITE_CLASS_ENCODER(kstore_cnode_t) + +/// onode: per-object metadata +struct kstore_onode_t { + uint64_t nid; ///< numeric id (locally unique) + uint64_t size; ///< object size + map attrs; ///< attrs + uint64_t omap_head; ///< id for omap root node + uint32_t stripe_size; ///< stripe size + + uint32_t expected_object_size; + uint32_t expected_write_size; + uint32_t alloc_hint_flags; + + kstore_onode_t() + : nid(0), + size(0), + omap_head(0), + stripe_size(0), + expected_object_size(0), + expected_write_size(0), + alloc_hint_flags(0) {} + + void encode(bufferlist& bl) const; + void decode(bufferlist::iterator& p); + void dump(Formatter *f) const; + static void generate_test_instances(list& o); +}; +WRITE_CLASS_ENCODER(kstore_onode_t) + +#endif