]> git.proxmox.com Git - ceph.git/blame - ceph/src/rgw/services/svc_meta_be_otp.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rgw / services / svc_meta_be_otp.h
CommitLineData
9f95a23c
TL
1
2
3// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
4// vim: ts=8 sw=2 smarttab ft=cpp
5
6/*
7 * Ceph - scalable distributed file system
8 *
9 * Copyright (C) 2019 Red Hat, Inc.
10 *
11 * This is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License version 2.1, as published by the Free Software
14 * Foundation. See file COPYING.
15 *
16 */
17
18
19#pragma once
20
1e59de90 21#include "rgw_service.h"
9f95a23c
TL
22
23#include "svc_cls.h"
24#include "svc_meta_be.h"
25#include "svc_meta_be_sobj.h"
26#include "svc_sys_obj.h"
27
28
29using RGWSI_MBOTP_Handler_Module = RGWSI_MBSObj_Handler_Module;
30using RGWSI_MetaBackend_Handler_OTP = RGWSI_MetaBackend_Handler_SObj;
31
20effc67 32using otp_devices_list_t = std::list<rados::cls::otp::otp_info_t>;
9f95a23c
TL
33
34struct RGWSI_MBOTP_GetParams : public RGWSI_MetaBackend::GetParams {
35 otp_devices_list_t *pdevices{nullptr};
36};
37
38struct RGWSI_MBOTP_PutParams : public RGWSI_MetaBackend::PutParams {
39 otp_devices_list_t devices;
40};
41
42using RGWSI_MBOTP_RemoveParams = RGWSI_MBSObj_RemoveParams;
43
44class RGWSI_MetaBackend_OTP : public RGWSI_MetaBackend_SObj
45{
46 RGWSI_Cls *cls_svc{nullptr};
47
48public:
49 struct Context_OTP : public RGWSI_MetaBackend_SObj::Context_SObj {
50 otp_devices_list_t devices;
9f95a23c
TL
51 };
52
53 RGWSI_MetaBackend_OTP(CephContext *cct);
54 virtual ~RGWSI_MetaBackend_OTP();
55
56 RGWSI_MetaBackend::Type get_type() {
57 return MDBE_OTP;
58 }
59
20effc67 60 static std::string get_meta_key(const rgw_user& user);
9f95a23c
TL
61
62 void init(RGWSI_SysObj *_sysobj_svc,
63 RGWSI_MDLog *_mdlog_svc,
64 RGWSI_Cls *_cls_svc) {
65 RGWSI_MetaBackend_SObj::init(_sysobj_svc, _mdlog_svc);
66 cls_svc = _cls_svc;
67 }
68
69 RGWSI_MetaBackend_Handler *alloc_be_handler() override;
70 RGWSI_MetaBackend::Context *alloc_ctx() override;
71
72 int call_with_get_params(ceph::real_time *pmtime, std::function<int(RGWSI_MetaBackend::GetParams&)> cb) override;
73
74 int get_entry(RGWSI_MetaBackend::Context *ctx,
20effc67 75 const std::string& key,
9f95a23c
TL
76 RGWSI_MetaBackend::GetParams& _params,
77 RGWObjVersionTracker *objv_tracker,
b3b6e05e 78 optional_yield y,
39ae355f
TL
79 const DoutPrefixProvider *dpp,
80 bool get_raw_attrs=false);
b3b6e05e
TL
81 int put_entry(const DoutPrefixProvider *dpp,
82 RGWSI_MetaBackend::Context *ctx,
20effc67 83 const std::string& key,
9f95a23c
TL
84 RGWSI_MetaBackend::PutParams& _params,
85 RGWObjVersionTracker *objv_tracker,
86 optional_yield y);
87};
88
89