]> git.proxmox.com Git - ceph.git/blame - ceph/src/mds/SimpleLock.cc
import ceph nautilus 14.2.2
[ceph.git] / ceph / src / mds / SimpleLock.cc
CommitLineData
7c673cae
FG
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3/*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2015 Red Hat
7 *
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.
12 *
13 */
14
15
16#include "SimpleLock.h"
17#include "Mutation.h"
18
19void SimpleLock::dump(Formatter *f) const {
11fdf7f2 20 ceph_assert(f != NULL);
7c673cae
FG
21 if (is_sync_and_unlocked()) {
22 return;
23 }
24
25 f->open_array_section("gather_set");
26 if (have_more()) {
94b18763
FG
27 for(const auto &i : more()->gather_set) {
28 f->dump_int("rank", i);
7c673cae
FG
29 }
30 }
31 f->close_section();
32
81eedcae 33 f->dump_string("state", get_state_name(get_state()));
b32b8144 34 f->dump_bool("is_leased", is_leased());
7c673cae
FG
35 f->dump_int("num_rdlocks", get_num_rdlocks());
36 f->dump_int("num_wrlocks", get_num_wrlocks());
37 f->dump_int("num_xlocks", get_num_xlocks());
38 f->open_object_section("xlock_by");
39 if (get_xlock_by()) {
40 get_xlock_by()->dump(f);
41 }
42 f->close_section();
43}