]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: only make handlers set *prval if EIO
authorSage Weil <sage@inktank.com>
Thu, 10 Oct 2013 14:05:46 +0000 (07:05 -0700)
committerSage Weil <sage@inktank.com>
Fri, 11 Oct 2013 16:23:10 +0000 (09:23 -0700)
The normal Objecter handlers set *prval for each operation; we only need to
(re)set it if we have a special reason (like a decoding error).

Signed-off-by: Sage Weil <sage@inktank.com>
src/osdc/Objecter.h

index 1196633276d4374491548444f5676ca43bfe8f33..8a6c243d339adf74b8ec2af3b1ff0e2d150f7149 100644 (file)
@@ -617,10 +617,9 @@ struct ObjectOperation {
        }
        ::decode(*cursor, p);
       } catch (buffer::error& e) {
-       r = -EIO;
+       if (prval)
+         *prval = -EIO;
       }
-      if (prval)
-       *prval = r;
     }
   };
 
@@ -664,10 +663,9 @@ struct ObjectOperation {
        if (pisdirty)
          *pisdirty = isdirty;
       } catch (buffer::error& e) {
-       r = -EIO;
+       if (prval)
+         *prval = -EIO;
       }
-      if (prval)
-       *prval = r;
     }
   };