X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fmds%2FScrubHeader.h;fp=src%2Fceph%2Fsrc%2Fmds%2FScrubHeader.h;h=18c68ae8f9d475f2f5d30169e509a9b788d7c025;hb=812ff6ca9fcd3e629e49d4328905f33eee8ca3f5;hp=0000000000000000000000000000000000000000;hpb=15280273faafb77777eab341909a3f495cf248d9;p=stor4nfv.git diff --git a/src/ceph/src/mds/ScrubHeader.h b/src/ceph/src/mds/ScrubHeader.h new file mode 100644 index 0000000..18c68ae --- /dev/null +++ b/src/ceph/src/mds/ScrubHeader.h @@ -0,0 +1,59 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab +/* + * Ceph - scalable distributed file system + * + * Copyright (C) 2016 Red Hat Inc + * + * 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 SCRUB_HEADER_H_ +#define SCRUB_HEADER_H_ + +class CInode; + +/** + * Externally input parameters for a scrub, associated with the root + * of where we are doing a recursive scrub + */ +class ScrubHeader { +public: + ScrubHeader(const std::string &tag_, bool force_, bool recursive_, + bool repair_, Formatter *f_) + : tag(tag_), force(force_), recursive(recursive_), repair(repair_), + formatter(f_), origin(nullptr) + { + assert(formatter != nullptr); + } + + // Set after construction because it won't be known until we've + // started resolving path and locking + void set_origin(CInode *origin_) { origin = origin_; } + + bool get_recursive() const { return recursive; } + bool get_repair() const { return repair; } + bool get_force() const { return force; } + const CInode *get_origin() const { return origin; } + const std::string &get_tag() const { return tag; } + Formatter &get_formatter() const { return *formatter; } + +protected: + const std::string tag; + const bool force; + const bool recursive; + const bool repair; + Formatter * const formatter; + CInode *origin; +}; + +typedef ceph::shared_ptr ScrubHeaderRef; +typedef ceph::shared_ptr ScrubHeaderRefConst; + +#endif // SCRUB_HEADER_H_ +