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.
15 #ifndef CEPH_SNAPCLIENT_H
16 #define CEPH_SNAPCLIENT_H
18 #include "MDSTableClient.h"
21 class MDSInternalContextBase;
25 class SnapClient : public MDSTableClient {
27 explicit SnapClient(MDSRank *m) : MDSTableClient(m, TABLE_SNAP) {}
29 void resend_queries() override {}
30 void handle_query_result(MMDSTableRequest *m) override {}
32 void prepare_create(inodeno_t dirino, const string& name, utime_t stamp,
33 version_t *pstid, bufferlist *pbl, MDSInternalContextBase *onfinish) {
35 __u32 op = TABLE_OP_CREATE;
40 _prepare(bl, pstid, pbl, onfinish);
43 void prepare_create_realm(inodeno_t ino, version_t *pstid, bufferlist *pbl, MDSInternalContextBase *onfinish) {
45 __u32 op = TABLE_OP_CREATE;
48 _prepare(bl, pstid, pbl, onfinish);
51 void prepare_destroy(inodeno_t ino, snapid_t snapid, version_t *pstid, bufferlist *pbl, MDSInternalContextBase *onfinish) {
53 __u32 op = TABLE_OP_DESTROY;
57 _prepare(bl, pstid, pbl, onfinish);
60 void prepare_update(inodeno_t ino, snapid_t snapid, const string& name, utime_t stamp,
61 version_t *pstid, bufferlist *pbl, MDSInternalContextBase *onfinish) {
63 __u32 op = TABLE_OP_UPDATE;
69 _prepare(bl, pstid, pbl, onfinish);