In several files the iostream wasn't being used, so it got removed.
In other files the iostream inclusion was replaced by including iosfwd
(for forward declarations), which is much smaller header than iostream,
so in theory should reduce compilation time.
To make this work some of the functions must have been moved from .h to .cc file.
3 functions also needed to have inline removed - this shouldn't affect
performance in any way: two of them are
probably too long to have been inlined anyway and the third one is for
error reporting, so probably won't be called too often.
test/Makefile-client.am: added linker libs
This was required to avoid linker error when linking
src/test/cls_rbd/test_cls_rbd.cc file. Makefile was specyfing
libcommon.a as a part of a linker command even though this wasn't
required and wasn't being linked against. When inline functions from
buffer.h were moved to buffer.cc(and inline was removed) the
libcommon.a library became necessary. This wouldn't link without also
including additional libraries(CRYPTO_LIBS and EXTRA_LIBS)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
+#include <iostream>
#include "include/buffer.h"
#include "common/errno.h"
#include "include/int_types.h"
#include <deque>
-#include <iostream>
+#include <iosfwd>
#include <list>
#include <vector>
-#include <ostream>
#include <sstream>
#include <stdarg.h>
#include <string>
#include <sys/uio.h>
#include <limits.h>
+#include <ostream>
namespace ceph {
#ifdef BUFFER_DEBUG
return out << "buffer::raw(" << (void*)r.data << " len " << r.len << " nref " << r.nref.read() << ")";
}
+std::ostream& operator<<(std::ostream& out, const buffer::ptr& bp) {
+ if (bp.have_raw())
+ out << "buffer::ptr(" << bp.offset() << "~" << bp.length()
+ << " " << (void*)bp.c_str()
+ << " in raw " << (void*)bp.raw_c_str()
+ << " len " << bp.raw_length()
+ << " nref " << bp.raw_nref() << ")";
+ else
+ out << "buffer:ptr(" << bp.offset() << "~" << bp.length() << " no raw)";
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const buffer::list& bl) {
+ out << "buffer::list(len=" << bl.length() << "," << std::endl;
+
+ std::list<buffer::ptr>::const_iterator it = bl.buffers().begin();
+ while (it != bl.buffers().end()) {
+ out << "\t" << *it;
+ if (++it == bl.buffers().end()) break;
+ out << "," << std::endl;
+ }
+ out << std::endl << ")";
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, buffer::error& e)
+{
+ return out << e.what();
+}
}
#ifndef CEPH_CEPHCONTEXT_H
#define CEPH_CEPHCONTEXT_H
-#include <iostream>
+#include <iosfwd>
#include <stdint.h>
#include <string>
#include <set>
#ifndef CEPH_JSON_H
#define CEPH_JSON_H
-#include <iostream>
+#include <iosfwd>
#include <include/types.h>
#include <list>
#include <set>
#include <string>
-#include <iostream> //for testing, remove
+#include <iosfwd>
#include "include/types.h"
#include <errno.h>
#include <vector>
#include <algorithm>
+#include <ostream>
#include "common/strtol.h"
#include "ErasureCode.h"
#include <map>
#include <set>
#include <vector>
+#include <iostream>
#include "include/memory.h"
#include "include/buffer.h"
#include "common/ceph_context.h"
-#include <iostream>
#include <stdint.h>
struct md_config_t;
#include <list>
#include <set>
-#include <iostream>
#include "include/assert.h"
#include "include/memory.h"
# include <sys/mman.h>
#endif
-#include <iostream>
-#include <istream>
+#include <iosfwd>
#include <iomanip>
#include <list>
#include <string>
}
-inline std::ostream& operator<<(std::ostream& out, const buffer::ptr& bp) {
- if (bp.have_raw())
- out << "buffer::ptr(" << bp.offset() << "~" << bp.length()
- << " " << (void*)bp.c_str()
- << " in raw " << (void*)bp.raw_c_str()
- << " len " << bp.raw_length()
- << " nref " << bp.raw_nref() << ")";
- else
- out << "buffer:ptr(" << bp.offset() << "~" << bp.length() << " no raw)";
- return out;
-}
+std::ostream& operator<<(std::ostream& out, const buffer::ptr& bp);
-inline std::ostream& operator<<(std::ostream& out, const buffer::list& bl) {
- out << "buffer::list(len=" << bl.length() << "," << std::endl;
- std::list<buffer::ptr>::const_iterator it = bl.buffers().begin();
- while (it != bl.buffers().end()) {
- out << "\t" << *it;
- if (++it == bl.buffers().end()) break;
- out << "," << std::endl;
- }
- out << std::endl << ")";
- return out;
-}
+std::ostream& operator<<(std::ostream& out, const buffer::list& bl);
-inline std::ostream& operator<<(std::ostream& out, buffer::error& e)
-{
- return out << e.what();
-}
+
+std::ostream& operator<<(std::ostream& out, buffer::error& e);
inline bufferhash& operator<<(bufferhash& l, bufferlist &r) {
l.update(r);
return l;
}
-
}
#endif
*/
-#include <iostream>
+#include <iosfwd>
#include <string>
#include <vector>
using namespace std;
#include <stdint.h>
#include <stdio.h>
-#include <iostream>
+#include <iosfwd>
#include <iomanip>
using namespace std;
*/
#include <map>
-#include <iostream>
using namespace std;
//typedef int T;
#include "include/int_types.h"
#include "include/buffer.h"
#include "include/encoding.h"
-#include <iostream>
+#include <iosfwd>
#include <list>
#include <string>
#include <boost/variant.hpp>
#include "common/config.h"
#include "common/DecayCounter.h"
-#include <iostream>
+#include <iosfwd>
#include <list>
#include <set>
#include <list>
#include <set>
#include <map>
-//#include <iostream>
class Context;
class CDentry;
#include <stdint.h>
#include "libxio.h"
}
-#include <iostream>
#include <vector>
#include "include/atomic.h"
#include "common/likely.h"
#include <map>
#include <string>
-#include <iostream>
#include <include/types.h>
#include "common/debug.h"
return true;
}
+void ACLOwner_S3::to_xml(ostream& out) {
+ if (id.empty())
+ return;
+ out << "<Owner>" << "<ID>" << id << "</ID>";
+ if (!display_name.empty())
+ out << "<DisplayName>" << display_name << "</DisplayName>";
+ out << "</Owner>";
+}
+
bool ACLGrant_S3::xml_end(const char *el) {
ACLGrantee_S3 *acl_grantee;
ACLID_S3 *acl_id;
return true;
}
+void RGWAccessControlList_S3::to_xml(ostream& out) {
+ multimap<string, ACLGrant>::iterator iter;
+ out << "<AccessControlList>";
+ for (iter = grant_map.begin(); iter != grant_map.end(); ++iter) {
+ ACLGrant_S3& grant = static_cast<ACLGrant_S3 &>(iter->second);
+ grant.to_xml(cct, out);
+ }
+ out << "</AccessControlList>";
+}
+
struct s3_acl_header {
int rgw_perm;
const char *http_header;
return true;
}
+void RGWAccessControlPolicy_S3::to_xml(ostream& out) {
+ out << "<AccessControlPolicy xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">";
+ ACLOwner_S3& _owner = static_cast<ACLOwner_S3 &>(owner);
+ RGWAccessControlList_S3& _acl = static_cast<RGWAccessControlList_S3 &>(acl);
+ _owner.to_xml(out);
+ _acl.to_xml(out);
+ out << "</AccessControlPolicy>";
+}
+
static const s3_acl_header acl_header_perms[] = {
{RGW_PERM_READ, "HTTP_X_AMZ_GRANT_READ"},
{RGW_PERM_WRITE, "HTTP_X_AMZ_GRANT_WRITE"},
#include <map>
#include <string>
-#include <iostream>
+#include <iosfwd>
#include <include/types.h>
#include <expat.h>
~RGWAccessControlList_S3() {}
bool xml_end(const char *el);
- void to_xml(ostream& out) {
- multimap<string, ACLGrant>::iterator iter;
- out << "<AccessControlList>";
- for (iter = grant_map.begin(); iter != grant_map.end(); ++iter) {
- ACLGrant_S3& grant = static_cast<ACLGrant_S3 &>(iter->second);
- grant.to_xml(cct, out);
- }
- out << "</AccessControlList>";
- }
+ void to_xml(ostream& out);
int create_canned(ACLOwner& owner, ACLOwner& bucket_owner, const string& canned_acl);
int create_from_grants(std::list<ACLGrant>& grants);
~ACLOwner_S3() {}
bool xml_end(const char *el);
- void to_xml(ostream& out) {
- if (id.empty())
- return;
- out << "<Owner>" << "<ID>" << id << "</ID>";
- if (!display_name.empty())
- out << "<DisplayName>" << display_name << "</DisplayName>";
- out << "</Owner>";
- }
+ void to_xml(ostream& out);
};
class RGWEnv;
bool xml_end(const char *el);
- void to_xml(ostream& out) {
- out << "<AccessControlPolicy xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">";
- ACLOwner_S3& _owner = static_cast<ACLOwner_S3 &>(owner);
- RGWAccessControlList_S3& _acl = static_cast<RGWAccessControlList_S3 &>(acl);
- _owner.to_xml(out);
- _acl.to_xml(out);
- out << "</AccessControlPolicy>";
- }
+ void to_xml(ostream& out);
int rebuild(RGWRados *store, ACLOwner *owner, RGWAccessControlPolicy& dest);
bool compare_group_name(string& id, ACLGroupTypeEnum group);
#include <map>
#include <string>
-#include <iostream>
#include <vector>
#include <include/types.h>
#include <map>
#include <string>
-#include <iostream>
#include <include/types.h>
#define RGW_CORS_GET 0x1
#include <map>
#include <string>
-#include <iostream>
+#include <iosfwd>
#include <expat.h>
#include <include/types.h>
#include <map>
#include <string>
-#include <iostream>
#include <vector>
#include <include/types.h>
#include <include/str_list.h>
#include <map>
#include <string>
-#include <iostream>
+#include <iosfwd>
#include <include/types.h>
#include <expat.h>
ceph_test_cls_rbd_SOURCES = test/cls_rbd/test_cls_rbd.cc
ceph_test_cls_rbd_LDADD = \
$(LIBRADOS) libcls_rbd_client.la libcls_lock_client.la \
- $(LIBCOMMON) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
+ $(LIBCOMMON) $(UNITTEST_LDADD) $(RADOS_TEST_LDADD) $(CRYPTO_LIBS) \
+ $(EXTRALIBS)
ceph_test_cls_rbd_CXXFLAGS = $(UNITTEST_CXXFLAGS)
bin_DEBUGPROGRAMS += ceph_test_cls_rbd
#include <string>
#include <time.h>
#include <unistd.h>
+#include <iostream>
using namespace librados;
#include <list>
#include <map>
#include <set>
+#include <iostream>
#include "Object.h"