Skip to content

Commit

Permalink
Merge pull request #8366 from yangdongsheng/trival
Browse files Browse the repository at this point in the history
build: fix compiling warnings

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
liewegas committed Apr 3, 2016
2 parents 370e4f7 + f6be50d commit 773d5ec
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
6 changes: 6 additions & 0 deletions src/os/filestore/FileStore.cc
Expand Up @@ -3325,7 +3325,13 @@ int FileStore::_zero(const coll_t& cid, const ghobject_t& oid, uint64_t offset,
ret = _write(cid, oid, offset, len, bl);
}

#ifdef CEPH_HAVE_FALLOCATE
# if !defined(DARWIN) && !defined(__FreeBSD__)
# ifdef FALLOC_FL_KEEP_SIZE
out:
# endif
# endif
#endif
dout(20) << "zero " << cid << "/" << oid << " " << offset << "~" << len << " = " << ret << dendl;
return ret;
}
Expand Down
20 changes: 10 additions & 10 deletions src/test/objectstore/store_test.cc
Expand Up @@ -1242,7 +1242,7 @@ TEST_P(StoreTest, SimpleCloneTest) {
ObjectStore::Transaction t;
t.remove(cid, hoid);
t.remove(cid, hoid2);
ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t)));
ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t)));
}
{
bufferlist final;
Expand Down Expand Up @@ -1271,7 +1271,7 @@ TEST_P(StoreTest, SimpleCloneTest) {
ObjectStore::Transaction t;
t.remove(cid, hoid);
t.remove(cid, hoid2);
ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t)));
ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t)));
}
{
bufferlist final;
Expand Down Expand Up @@ -1303,7 +1303,7 @@ TEST_P(StoreTest, SimpleCloneTest) {
ObjectStore::Transaction t;
t.remove(cid, hoid);
t.remove(cid, hoid2);
ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t)));
ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t)));
}
{
bufferlist final;
Expand All @@ -1324,7 +1324,7 @@ TEST_P(StoreTest, SimpleCloneTest) {
al.append(a);
final.append(a);
t.write(cid, hoid, 17000, a.length(), al);
ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t)));
ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t)));
bufferlist rl;
ASSERT_EQ((int)final.length(),
store->read(cid, hoid, 0, final.length(), rl));
Expand All @@ -1338,7 +1338,7 @@ TEST_P(StoreTest, SimpleCloneTest) {
ObjectStore::Transaction t;
t.remove(cid, hoid);
t.remove(cid, hoid2);
ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t)));
ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t)));
}
{
bufferptr p(1048576);
Expand All @@ -1353,7 +1353,7 @@ TEST_P(StoreTest, SimpleCloneTest) {
bufferlist al;
al.append(a);
t.write(cid, hoid, a.length(), a.length(), al);
ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t)));
ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t)));
bufferlist rl;
bufferlist final;
final.substr_of(pl, 0, al.length());
Expand All @@ -1373,7 +1373,7 @@ TEST_P(StoreTest, SimpleCloneTest) {
ObjectStore::Transaction t;
t.remove(cid, hoid);
t.remove(cid, hoid2);
ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t)));
ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t)));
}
{
bufferptr p(65536);
Expand All @@ -1388,7 +1388,7 @@ TEST_P(StoreTest, SimpleCloneTest) {
bufferlist al;
al.append(a);
t.write(cid, hoid, 32768, a.length(), al);
ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t)));
ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t)));
bufferlist rl;
bufferlist final;
final.substr_of(pl, 0, 32768);
Expand All @@ -1408,7 +1408,7 @@ TEST_P(StoreTest, SimpleCloneTest) {
ObjectStore::Transaction t;
t.remove(cid, hoid);
t.remove(cid, hoid2);
ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t)));
ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t)));
}
{
bufferptr p(65536);
Expand All @@ -1423,7 +1423,7 @@ TEST_P(StoreTest, SimpleCloneTest) {
bufferlist al;
al.append(a);
t.write(cid, hoid, 33768, a.length(), al);
ASSERT_EQ(0u, apply_transaction(store, &osr, std::move(t)));
ASSERT_EQ(0, apply_transaction(store, &osr, std::move(t)));
bufferlist rl;
bufferlist final;
final.substr_of(pl, 0, 33768);
Expand Down
3 changes: 2 additions & 1 deletion src/test/system/st_rados_create_pool.cc
Expand Up @@ -125,6 +125,7 @@ std::string get_temp_pool_name(const char* prefix)
char poolname[256];
ret = snprintf(poolname, sizeof(poolname),
"%s.%s-%d", prefix, hostname, getpid());
assert(ret < sizeof(poolname));
assert(ret > 0);
assert((unsigned int)ret < sizeof(poolname));
return poolname;
}

0 comments on commit 773d5ec

Please sign in to comment.