]>
git.proxmox.com Git - ceph.git/blob - ceph/src/mds/Anchor.cc
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) 2018 Red Hat
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 #include "mds/Anchor.h"
17 #include "common/Formatter.h"
19 void Anchor::encode(bufferlist
&bl
) const
21 ENCODE_START(1, 1, bl
);
29 void Anchor::decode(bufferlist::const_iterator
&bl
)
39 void Anchor::dump(Formatter
*f
) const
41 f
->dump_unsigned("ino", ino
);
42 f
->dump_unsigned("dirino", dirino
);
43 f
->dump_string("d_name", d_name
);
44 f
->dump_unsigned("d_type", d_type
);
47 void Anchor::generate_test_instances(std::list
<Anchor
*>& ls
)
49 ls
.push_back(new Anchor
);
50 ls
.push_back(new Anchor
);
52 ls
.back()->dirino
= 2;
53 ls
.back()->d_name
= "hello";
54 ls
.back()->d_type
= DT_DIR
;
57 ostream
& operator<<(ostream
& out
, const Anchor
&a
)
59 return out
<< "a(" << a
.ino
<< " " << a
.dirino
<< "/'" << a
.d_name
<< "' " << a
.d_type
<< ")";