]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add OMAP flag to object_info_t
authorSage Weil <sage@inktank.com>
Sat, 8 Feb 2014 02:03:19 +0000 (18:03 -0800)
committerSage Weil <sage@inktank.com>
Sun, 16 Feb 2014 06:09:39 +0000 (22:09 -0800)
Set a flag if we ever set or update OMAP content on an object.  This gives
us an easy indicator for the cache agent (without actually querying the
ObjectStore) so that we can avoid trying to flush omap to EC pools.

Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/ReplicatedPG.cc
src/osd/osd_types.h

index 8e958c5bce9a2d4d516e17cdcd89a0239791dfaf..f166a99cedf27d9eea6eff7dfd33c78fed73958a 100644 (file)
@@ -4168,6 +4168,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        t->omap_setkeys(soid, to_set);
        ctx->delta_stats.num_wr++;
       }
+      obs.oi.set_flag(object_info_t::FLAG_OMAP);
       break;
 
     case CEPH_OSD_OP_OMAPSETHEADER:
@@ -4186,6 +4187,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        t->omap_setheader(soid, osd_op.indata);
        ctx->delta_stats.num_wr++;
       }
+      obs.oi.set_flag(object_info_t::FLAG_OMAP);
       break;
 
     case CEPH_OSD_OP_OMAPCLEAR:
@@ -4204,6 +4206,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        t->omap_clear(soid);
        ctx->delta_stats.num_wr++;
       }
+      obs.oi.set_flag(object_info_t::FLAG_OMAP);
       break;
 
     case CEPH_OSD_OP_OMAPRMKEYS:
@@ -4230,6 +4233,7 @@ int ReplicatedPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        t->omap_rmkeys(soid, to_rm);
        ctx->delta_stats.num_wr++;
       }
+      obs.oi.set_flag(object_info_t::FLAG_OMAP);
       break;
 
     case CEPH_OSD_OP_COPY_GET_CLASSIC:
index 8c1b49106af03e5c655e5ce2460d0c4864f59b05..b0521b7d8818ab64ac213c3e9adcbead98aca758 100644 (file)
@@ -2330,6 +2330,7 @@ struct object_info_t {
     FLAG_LOST     = 1<<0,
     FLAG_WHITEOUT = 1<<1,  // object logically does not exist
     FLAG_DIRTY    = 1<<2,  // object has been modified since last flushed or undirtied
+    FLAG_OMAP     = 1 << 3,  // has (or may have) some/any omap data
     // ...
     FLAG_USES_TMAP = 1<<8,  // deprecated; no longer used.
   } flag_t;
@@ -2346,6 +2347,8 @@ struct object_info_t {
       s += "|dirty";
     if (flags & FLAG_USES_TMAP)
       s += "|uses_tmap";
+    if (flags & FLAG_OMAP)
+      s += "|omap";
     if (s.length())
       return s.substr(1);
     return s;