X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fclient%2Fbarrier.h;fp=src%2Fceph%2Fsrc%2Fclient%2Fbarrier.h;h=0000000000000000000000000000000000000000;hb=7da45d65be36d36b880cc55c5036e96c24b53f00;hp=8ed3040fab5a760c928558bd5a6c03aa74d9d81b;hpb=691462d09d0987b47e112d6ee8740375df3c51b2;p=stor4nfv.git diff --git a/src/ceph/src/client/barrier.h b/src/ceph/src/client/barrier.h deleted file mode 100644 index 8ed3040..0000000 --- a/src/ceph/src/client/barrier.h +++ /dev/null @@ -1,101 +0,0 @@ -// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- -// vim: ts=8 sw=2 smarttab -/* - * - * Copyright (C) 2012 CohortFS, LLC. - * - * 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 BARRIER_H -#define BARRIER_H - -#include "include/types.h" -#include -#define BOOST_ICL_USE_STATIC_BOUNDED_INTERVALS -#include -#include "common/Mutex.h" -#include "common/Cond.h" - -class Client; - -typedef boost::icl::interval::type barrier_interval; - -using namespace std; - -/* - * we keep count of uncommitted writes on the inode, so that - * ll_commit_blocks can do the right thing. - * - * This is just a hacked copy of Ceph's sync callback. - */ - -enum CBlockSync_State -{ - CBlockSync_State_None, /* initial state */ - CBlockSync_State_Unclaimed, /* outstanding write */ - CBlockSync_State_Committing, /* commit in progress */ - CBlockSync_State_Completed, -}; - -class BarrierContext; - -class C_Block_Sync; - -typedef boost::intrusive::list< C_Block_Sync, - boost::intrusive::member_hook< - C_Block_Sync, - boost::intrusive::list_member_hook<>, - &C_Block_Sync::intervals_hook > - > BlockSyncList; - -class Barrier -{ -private: - Cond cond; - boost::icl::interval_set span; - BlockSyncList write_list; - -public: - boost::intrusive::list_member_hook<> active_commits_hook; - - Barrier(); - ~Barrier(); - - friend class BarrierContext; -}; - -typedef boost::intrusive::list< Barrier, - boost::intrusive::member_hook< - Barrier, - boost::intrusive::list_member_hook<>, - &Barrier::active_commits_hook > - > BarrierList; - -class BarrierContext -{ -private: - Client *cl; - uint64_t ino; - Mutex lock; - - // writes not claimed by a commit - BlockSyncList outstanding_writes; - - // commits in progress, with their claimed writes - BarrierList active_commits; - -public: - BarrierContext(Client *c, uint64_t ino); - void write_nobarrier(C_Block_Sync &cbs); - void write_barrier(C_Block_Sync &cbs); - void commit_barrier(barrier_interval &civ); - void complete(C_Block_Sync &cbs); - ~BarrierContext(); -}; - -#endif