ceph/branches/riccardo/monitor2/mds/events/EMkdir.h
riccardo80 07ac5d3e74 creating branch for distributed monitor
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1068 29311d96-e01e-0410-9327-a35deaab8ce9
2007-02-01 05:43:23 +00:00

63 lines
1.3 KiB
C++

// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
/*
* Ceph - scalable distributed file system
*
* Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
*
* 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 __EMKDIR_H
#define __EMKDIR_H
#include <assert.h>
#include "config.h"
#include "include/types.h"
#include "ETrace.h"
#include "../MDS.h"
#include "../MDStore.h"
class EMkdir : public LogEvent {
protected:
ETrace trace;
//version_t pdirv;
public:
EMkdir(CDir *dir) : LogEvent(EVENT_MKDIR),
trace(dir->inode) {
//pdirv = dir->inode->get_parent_dir()->get_version();
}
EMkdir() : LogEvent(EVENT_MKDIR) { }
void print(ostream& out) {
out << "mkdir ";
trace.print(out);
}
virtual void encode_payload(bufferlist& bl) {
trace.encode(bl);
//bl.append((char*)&pdirv, sizeof(pdirv));
}
void decode_payload(bufferlist& bl, int& off) {
trace.decode(bl, off);
//bl.copy(off, sizeof(pdirv), (char*)&pdirv);
//off += sizeof(pdirv);
}
bool can_expire(MDS *mds);
void retire(MDS *mds, Context *c);
// recovery
bool has_happened(MDS *mds);
void replay(MDS *mds);
};
#endif