]> git.proxmox.com Git - ceph.git/blob - ceph/src/client/MetaRequest.cc
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / client / MetaRequest.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #include "include/types.h"
5 #include "client/MetaRequest.h"
6 #include "client/Dentry.h"
7 #include "client/Inode.h"
8 #include "messages/MClientReply.h"
9 #include "common/Formatter.h"
10
11 void MetaRequest::dump(Formatter *f) const
12 {
13 auto age = std::chrono::duration<double>(ceph_clock_now() - op_stamp);
14
15 f->dump_unsigned("tid", tid);
16 f->dump_string("op", ceph_mds_op_name(head.op));
17 f->dump_stream("path") << path;
18 f->dump_stream("path2") << path2;
19 if (_inode)
20 f->dump_stream("ino") << _inode->ino;
21 if (_old_inode)
22 f->dump_stream("old_ino") << _old_inode->ino;
23 if (_other_inode)
24 f->dump_stream("other_ino") << _other_inode->ino;
25 if (target)
26 f->dump_stream("target_ino") << target->ino;
27 if (_dentry)
28 f->dump_string("dentry", _dentry->name);
29 if (_old_dentry)
30 f->dump_string("old_dentry", _old_dentry->name);
31 f->dump_stream("hint_ino") << inodeno_t(head.ino);
32
33 f->dump_stream("sent_stamp") << sent_stamp;
34 f->dump_float("age", age.count());
35 f->dump_int("mds", mds);
36 f->dump_int("resend_mds", resend_mds);
37 f->dump_int("send_to_auth", send_to_auth);
38 f->dump_unsigned("sent_on_mseq", sent_on_mseq);
39 f->dump_int("retry_attempt", retry_attempt);
40
41 f->dump_int("got_unsafe", got_unsafe);
42
43 f->dump_unsigned("uid", head.caller_uid);
44 f->dump_unsigned("gid", head.caller_gid);
45
46 f->dump_unsigned("oldest_client_tid", head.oldest_client_tid);
47 f->dump_unsigned("mdsmap_epoch", head.mdsmap_epoch);
48 f->dump_unsigned("flags", head.flags);
49 f->dump_unsigned("num_retry", head.ext_num_retry);
50 f->dump_unsigned("num_fwd", head.ext_num_fwd);
51 f->dump_unsigned("num_releases", head.num_releases);
52
53 f->dump_int("abort_rc", abort_rc);
54 }
55
56 MetaRequest::~MetaRequest()
57 {
58 if (_dentry)
59 _dentry->put();
60 if (_old_dentry)
61 _old_dentry->put();
62 }
63
64 void MetaRequest::set_dentry(Dentry *d) {
65 ceph_assert(_dentry == NULL);
66 _dentry = d;
67 _dentry->get();
68 }
69 Dentry *MetaRequest::dentry() {
70 return _dentry;
71 }
72
73 void MetaRequest::set_old_dentry(Dentry *d) {
74 ceph_assert(_old_dentry == NULL);
75 _old_dentry = d;
76 _old_dentry->get();
77 }
78 Dentry *MetaRequest::old_dentry() {
79 return _old_dentry;
80 }