]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MOSDPGCreate.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) 2004-2006 Sage Weil <sage@newdream.net>
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.
16 #ifndef CEPH_MOSDPGCREATE_H
17 #define CEPH_MOSDPGCREATE_H
19 #include "msg/Message.h"
20 #include "osd/osd_types.h"
23 * PGCreate - instruct an OSD to create a pg, if it doesn't already exist
26 struct MOSDPGCreate
: public Message
{
28 const static int HEAD_VERSION
= 3;
29 const static int COMPAT_VERSION
= 3;
32 map
<pg_t
,pg_create_t
> mkpg
;
33 map
<pg_t
,utime_t
> ctimes
;
36 : Message(MSG_OSD_PG_CREATE
, HEAD_VERSION
, COMPAT_VERSION
) {}
37 MOSDPGCreate(epoch_t e
)
38 : Message(MSG_OSD_PG_CREATE
, HEAD_VERSION
, COMPAT_VERSION
),
41 ~MOSDPGCreate() override
{}
44 const char *get_type_name() const override
{ return "pg_create"; }
46 void encode_payload(uint64_t features
) override
{
47 ::encode(epoch
, payload
);
48 ::encode(mkpg
, payload
);
49 ::encode(ctimes
, payload
);
51 void decode_payload() override
{
52 bufferlist::iterator p
= payload
.begin();
58 void print(ostream
& out
) const override
{
59 out
<< "osd_pg_create(e" << epoch
;
60 for (map
<pg_t
,pg_create_t
>::const_iterator i
= mkpg
.begin();
63 out
<< " " << i
->first
<< ":" << i
->second
.created
;