]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Resolve gcc warnings.
authorJosh Pieper <jjp@pobox.com>
Fri, 11 Nov 2011 13:19:02 +0000 (08:19 -0500)
committerSage Weil <sage@newdream.net>
Mon, 14 Nov 2011 21:23:18 +0000 (13:23 -0800)
These should have no functional changes:
 * Check errors from functions that currently cannot return any
 * Initialize variables that gcc can't determine will be initialized
   in a following function call
 * Remove unused variables

Signed-off-by: Josh Pieper <jjp@pobox.com>
Signed-off-by: Sage Weil <sage@newdream.net>
src/client/fuse_ll.cc
src/include/encoding.h
src/librados.cc
src/mount/mount.ceph.c
src/msg/SimpleMessenger.cc
src/msg/msg_types.cc
src/os/IndexManager.cc
src/osd/PG.cc
src/osd/ReplicatedPG.cc

index 2c766c22f96af1b949a6acc5cee4aa252b9465ce..bbfab9d04b9e1b0217160fdd5a3100c84f5f262f 100644 (file)
@@ -423,7 +423,11 @@ static void ceph_ll_readdir(fuse_req_t req, fuse_ino_t ino, size_t size,
   int r;
   r = client->readdir_r_cb(dirp, ceph_ll_add_dirent, &rc);
 
-  fuse_reply_buf(req, rc.buf, rc.pos);
+  if (r == 0) {
+    fuse_reply_buf(req, rc.buf, rc.pos);
+  } else {
+    fuse_reply_err(req, -r);
+  }
   delete[] rc.buf;
 }
 
index bbbac8f394398b3d1ce2d95b2f21214b23d68d8f..67150d5b0abff7d9257a85cc9349be806d892b4a 100644 (file)
@@ -525,7 +525,7 @@ inline void decode(std::multimap<T,U>& m, bufferlist::iterator& p)
   decode(n, p);
   m.clear();
   while (n--) {
-    typename std::pair<T,U> tu;
+    typename std::pair<T,U> tu = std::pair<T,U>();
     decode(tu.first, p);
     typename std::multimap<T,U>::iterator it = m.insert(tu);
     decode(it->second, p);
index 713ba50ffc77f3b2bfd2566c17da39fe5092f28d..aa746c267e0910d04b216cd8ec5e865d750ec693 100644 (file)
@@ -4006,6 +4006,8 @@ extern "C" int rados_objects_list_next(rados_list_ctx_t listctx, const char **en
 
   if (h->list.empty()) {
     ret = lh->ctx->client->list(lh->lc, RADOS_LIST_MAX_ENTRIES);
+    if (ret < 0)
+      return ret;
     if (h->list.empty())
       return -ENOENT;
   }
index e7a247dfaef83c963535cfc79f06e74ddb2c9d7b..46dd2e2b9c273a5b9c713b60bf58ca13319e874b 100755 (executable)
@@ -86,7 +86,6 @@ static char *parse_options(const char *data, int *filesys_flags)
        int word_len;
        int skip;
        int pos = 0;
-       char *newdata = 0;
        char secret[MAX_SECRET_LEN];
        char *saw_name = NULL;
        char *saw_secret = NULL;
@@ -99,7 +98,6 @@ static char *parse_options(const char *data, int *filesys_flags)
                if(*data == 0)
                        break;
                next_keyword = strchr(data,',');
-               newdata = 0;
        
                /* temporarily null terminate end of keyword=value pair */
                if(next_keyword)
index d96a460eb6f3d953cf3356bf33075c7b6b32ce75..82ab3f39e59e6f34b16122aede864f1cec2c3305 100644 (file)
@@ -700,7 +700,6 @@ int SimpleMessenger::Pipe::accept()
   // this should roughly mirror pseudocode at
   //  http://ceph.newdream.net/wiki/Messaging_protocol
   int reply_tag = 0;
-  bool replace = false;
   uint64_t existing_seq = -1;
   while (1) {
     rc = tcp_read(msgr->cct, sd, (char*)&connect, sizeof(connect), msgr->timeout);
@@ -893,7 +892,6 @@ int SimpleMessenger::Pipe::accept()
   }
   
  replace:
-  replace = true;
   if (connect.features & CEPH_FEATURE_RECONNECT_SEQ) {
     reply_tag = CEPH_MSGR_TAG_SEQ;
     existing_seq = existing->in_seq;
index 7e361d5afc259eca9be12407574c623fd7db85bc..1fb645f93e42e7bb11db447c1e1618753a2c6b75 100644 (file)
@@ -11,11 +11,9 @@ bool entity_addr_t::parse(const char *s, const char **end)
 
   const char *start = s;
   bool brackets = false;
-  bool ipv6 = false;
   if (*start == '[') {
     start++;
     brackets = true;
-    ipv6 = true;
   }
   
   // inet_pton() requires a null terminated input, so let's fill two
index 50d53ff5b254afca4a0cbe03d392f9efbc47f804..0fab6fe6bd2d2d830ad02a6eb02129cb18c8a445 100644 (file)
@@ -83,7 +83,7 @@ int IndexManager::build_index(coll_t c, const char *path, Index *index) {
   int r;
   if (g_conf->filestore_update_collections) {
     // Need to check the collection generation
-    uint32_t version;
+    uint32_t version = 0;
     r = get_version(path, &version);
     if (r < 0)
       return r;
index 87c304791baf751c7e2c672c37590a374ba654f6..384a5eb852196f06b8ecb6805d27e8c1123d8c25 100644 (file)
@@ -4870,7 +4870,6 @@ PG::PriorSet::PriorSet(const OSDMap &osdmap,
     // interesting), or lost (down, but we won't wait for it).
     bool any_up_now = false;    // any candidates up now
     bool any_down_now = false;  // any candidates down now (that might have useful data)
-    bool any_lost_now = false;  // any candidates lost now (that we will ignore)
 
     // consider ACTING osds
     for (unsigned i=0; i<interval.acting.size(); i++) {
@@ -4887,11 +4886,9 @@ PG::PriorSet::PriorSet(const OSDMap &osdmap,
       } else if (!pinfo) {
        dout(10) << "build_prior  prior osd." << o << " no longer exists" << dendl;
        down.insert(o);
-       any_lost_now = true;
       } else if (pinfo->lost_at > interval.first) {
        dout(10) << "build_prior  prior osd." << o << " is down, but lost_at " << pinfo->lost_at << dendl;
        down.insert(o);
-       any_lost_now = true;
       } else {
        dout(10) << "build_prior  prior osd." << o << " is down" << dendl;
        down.insert(o);
index 614d5e9edf1095bae2c0cf73b9755ea630db147a..d277016692bde79240b1f54ef16b34eed16e9e3a 100644 (file)
@@ -2440,7 +2440,6 @@ void ReplicatedPG::do_osd_op_effects(OpContext *ctx)
          osd->client_messenger->send_message(notify_msg, s->con);
        } else {
          // unconnected
-         utime_t now = ceph_clock_now(g_ceph_context);
          entity_name_t name = i->first;
          notif->add_watcher(name, Watch::WATCHER_PENDING);
        }
@@ -4576,7 +4575,6 @@ void ReplicatedPG::mark_all_unfound_lost(int what)
   C_PG_MarkUnfoundLost *c = new C_PG_MarkUnfoundLost(this);
 
   utime_t mtime = ceph_clock_now(g_ceph_context);
-  eversion_t old_last_update = info.last_update;
   info.last_update.epoch = get_osdmap()->get_epoch();
   map<hobject_t, Missing::item>::iterator m = missing.missing.begin();
   map<hobject_t, Missing::item>::iterator mend = missing.missing.end();