]>
git.proxmox.com Git - ceph.git/blob - ceph/src/os/kstore/kstore_types.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2014 Red Hat
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
15 #ifndef CEPH_OSD_KSTORE_TYPES_H
16 #define CEPH_OSD_KSTORE_TYPES_H
19 #include "include/types.h"
20 #include "include/interval_set.h"
21 #include "include/utime.h"
22 #include "common/hobject.h"
27 /// collection metadata
28 struct kstore_cnode_t
{
29 uint32_t bits
; ///< how many bits of coll pgid are significant
31 explicit kstore_cnode_t(int b
=0) : bits(b
) {}
33 void encode(bufferlist
& bl
) const;
34 void decode(bufferlist::iterator
& p
);
35 void dump(Formatter
*f
) const;
36 static void generate_test_instances(list
<kstore_cnode_t
*>& o
);
38 WRITE_CLASS_ENCODER(kstore_cnode_t
)
40 /// onode: per-object metadata
41 struct kstore_onode_t
{
42 uint64_t nid
; ///< numeric id (locally unique)
43 uint64_t size
; ///< object size
44 map
<string
, bufferptr
> attrs
; ///< attrs
45 uint64_t omap_head
; ///< id for omap root node
46 uint32_t stripe_size
; ///< stripe size
48 uint32_t expected_object_size
;
49 uint32_t expected_write_size
;
50 uint32_t alloc_hint_flags
;
57 expected_object_size(0),
58 expected_write_size(0),
59 alloc_hint_flags(0) {}
61 void encode(bufferlist
& bl
) const;
62 void decode(bufferlist::iterator
& p
);
63 void dump(Formatter
*f
) const;
64 static void generate_test_instances(list
<kstore_onode_t
*>& o
);
66 WRITE_CLASS_ENCODER(kstore_onode_t
)