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) 2015 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 "include/encoding.h"
18 * Value class for the xattr we'll use to accumulate
19 * the highest object seen for a given inode
30 ObjCeiling(uint64_t id_
, uint64_t size_
)
31 : id(id_
), size(size_
)
34 bool operator >(ObjCeiling
const &rhs
) const
39 void encode(ceph::buffer::list
&bl
) const
41 ENCODE_START(1, 1, bl
);
47 void decode(ceph::buffer::list::const_iterator
&p
)
55 WRITE_CLASS_ENCODER(ObjCeiling
)
63 std::string obj_xattr_name
;
64 std::string mtime_xattr_name
;
65 std::string obj_size_xattr_name
;
71 const std::string
&obj_xattr_name_
,
72 const std::string
&mtime_xattr_name_
,
73 const std::string
&obj_size_xattr_name_
)
74 : obj_index(obj_index_
),
77 obj_xattr_name(obj_xattr_name_
),
78 mtime_xattr_name(mtime_xattr_name_
),
79 obj_size_xattr_name(obj_size_xattr_name_
)
83 : obj_index(0), obj_size(0), mtime(0)
86 void encode(ceph::buffer::list
&bl
) const
88 ENCODE_START(1, 1, bl
);
89 encode(obj_xattr_name
, bl
);
90 encode(mtime_xattr_name
, bl
);
91 encode(obj_size_xattr_name
, bl
);
92 encode(obj_index
, bl
);
98 void decode(ceph::buffer::list::const_iterator
&bl
)
101 decode(obj_xattr_name
, bl
);
102 decode(mtime_xattr_name
, bl
);
103 decode(obj_size_xattr_name
, bl
);
104 decode(obj_index
, bl
);
105 decode(obj_size
, bl
);
111 class InodeTagFilterArgs
114 std::string scrub_tag
;
116 void encode(ceph::buffer::list
&bl
) const
118 ENCODE_START(1, 1, bl
);
119 encode(scrub_tag
, bl
);
123 void decode(ceph::buffer::list::const_iterator
&bl
)
126 decode(scrub_tag
, bl
);
131 class AccumulateResult
134 // Index of the highest-indexed object seen
135 uint64_t ceiling_obj_index
;
136 // Size of the highest-index object seen
137 uint64_t ceiling_obj_size
;
138 // Largest object seen
139 uint64_t max_obj_size
;
140 // Non-default object pool id seen
142 // Highest mtime seen
146 : ceiling_obj_index(0), ceiling_obj_size(0), max_obj_size(0),
147 obj_pool_id(-1), max_mtime(0)