]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: separate CEPH_OSD_OP_* and FLAGS_* namespaces
authorSage Weil <sage@newdream.net>
Tue, 24 Mar 2009 21:02:35 +0000 (14:02 -0700)
committerSage Weil <sage@newdream.net>
Tue, 24 Mar 2009 21:02:35 +0000 (14:02 -0700)
Ops and op flags are separate namespaces; fix the naming.

13 files changed:
src/client/Client.cc
src/include/ceph_fs.h
src/kernel/addr.c
src/kernel/file.c
src/kernel/osd_client.c
src/messages/MOSDOp.h
src/messages/MOSDOpReply.h
src/messages/MOSDSubOpReply.h
src/osd/OSD.cc
src/osd/PG.cc
src/osd/ReplicatedPG.cc
src/osdc/Journaler.cc
src/osdc/Objecter.cc

index 0762ba0f76b4e106d867f9668188ae2e8f023f58..f595a820c2963fa36ed1f5bb393d1d71d2397caa 100644 (file)
@@ -3764,7 +3764,7 @@ int Client::_read(Fh *f, __s64 offset, __u64 size, bufferlist *bl)
     // do sync read
     int flags = 0;
     if (in->hack_balance_reads || g_conf.client_hack_balance_reads)
-      flags |= CEPH_OSD_OP_BALANCE_READS;
+      flags |= CEPH_OSD_FLAG_BALANCE_READS;
     filer->read(in->inode.ino, &in->inode.layout, in->snapid,
                offset, size, bl, flags, onfinish);
 
index 843540c636fb8f4f290db81200e1ced80316feea..fc49addffe3fbee3440a1ffbedf3501ae0182835 100644 (file)
@@ -1335,15 +1335,15 @@ static inline const char *ceph_osd_op_name(int op)
  * osd op flags
  */
 enum {
-       CEPH_OSD_OP_ACK = 1,          /* want (or is) "ack" ack */
-       CEPH_OSD_OP_ONNVRAM = 2,      /* want (or is) "onnvram" ack */
-       CEPH_OSD_OP_ONDISK = 4,       /* want (or is) "ondisk" ack */
-       CEPH_OSD_OP_RETRY = 8,        /* resend attempt */
-       CEPH_OSD_OP_INCLOCK_FAIL = 16, /* fail on inclock collision */
-       CEPH_OSD_OP_MODIFY = 32,      /* op is/was a mutation */
-       CEPH_OSD_OP_ORDERSNAP = 64,   /* EOLDSNAP if snapc is out of order */
-       CEPH_OSD_OP_PEERSTAT = 128,   /* msg includes osd_peer_stat */
-       CEPH_OSD_OP_BALANCE_READS = 256,
+       CEPH_OSD_FLAG_ACK = 1,          /* want (or is) "ack" ack */
+       CEPH_OSD_FLAG_ONNVRAM = 2,      /* want (or is) "onnvram" ack */
+       CEPH_OSD_FLAG_ONDISK = 4,       /* want (or is) "ondisk" ack */
+       CEPH_OSD_FLAG_RETRY = 8,        /* resend attempt */
+       CEPH_OSD_FLAG_INCLOCK_FAIL = 16, /* fail on inclock collision */
+       CEPH_OSD_FLAG_MODIFY = 32,      /* op is/was a mutation */
+       CEPH_OSD_FLAG_ORDERSNAP = 64,   /* EOLDSNAP if snapc is out of order */
+       CEPH_OSD_FLAG_PEERSTAT = 128,   /* msg includes osd_peer_stat */
+       CEPH_OSD_FLAG_BALANCE_READS = 256,
 };
 
 #define EOLDSNAPC    ERESTART  /* ORDERSNAP flag set and writer has old snap context*/
index 116e0935200c13ac7f0177a638bfa739c8e3b0c6..c32f14aff1d69d2f78ea64569f36f87e63a52587 100644 (file)
@@ -734,8 +734,8 @@ get_more_pages:
                                            ceph_vino(inode),
                                            offset, &len,
                                            CEPH_OSD_OP_WRITE,
-                                           CEPH_OSD_OP_MODIFY |
-                                                   CEPH_OSD_OP_ONDISK,
+                                           CEPH_OSD_FLAG_MODIFY |
+                                                   CEPH_OSD_FLAG_ONDISK,
                                            snapc, do_sync,
                                            ci->i_truncate_seq,
                                            ci->i_truncate_size,
index a6c737d2281e248c14e3e0d531b81b8027b38377..a4d0622e8b0b5aeaff2d7296d5a9fa16b91fc260 100644 (file)
@@ -513,11 +513,11 @@ static ssize_t ceph_sync_write(struct file *file, const char __user *data,
        else
                pos = *offset;
 
-       flags = CEPH_OSD_OP_ORDERSNAP |
-               CEPH_OSD_OP_ONDISK |
-               CEPH_OSD_OP_MODIFY;
+       flags = CEPH_OSD_FLAG_ORDERSNAP |
+               CEPH_OSD_FLAG_ONDISK |
+               CEPH_OSD_FLAG_MODIFY;
        if ((file->f_flags & (O_SYNC|O_DIRECT)) == 0)
-               flags |= CEPH_OSD_OP_ACK;
+               flags |= CEPH_OSD_FLAG_ACK;
        else
                do_sync = 1;
 
index 0f968feb8d715411d27ee2dbcc153b9f3a8249ec..66b034e7abe38c22d71302d24324bee21dd95d43 100644 (file)
@@ -113,7 +113,7 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
        init_completion(&req->r_completion);
        init_completion(&req->r_safe_completion);
        INIT_LIST_HEAD(&req->r_unsafe_item);
-       req->r_flags = flags & CEPH_OSD_OP_MODIFY;
+       req->r_flags = flags & CEPH_OSD_FLAG_MODIFY;
        req->r_last_osd = -1;
 
        /* create message */
@@ -131,7 +131,7 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
 
        head->client_inc = cpu_to_le32(1); /* always, for now. */
        head->flags = cpu_to_le32(flags);
-       if (flags & CEPH_OSD_OP_MODIFY)
+       if (flags & CEPH_OSD_FLAG_MODIFY)
                ceph_encode_timespec(&head->mtime, mtime);
        head->num_ops = cpu_to_le16(num_op);
        op->op = cpu_to_le16(opcode);
@@ -143,7 +143,7 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc,
        calc_layout(osdc, vino, layout, off, plen, req);
        req->r_pgid.pg64 = le64_to_cpu(head->layout.ol_pgid);
 
-       if (flags & CEPH_OSD_OP_MODIFY) {
+       if (flags & CEPH_OSD_FLAG_MODIFY) {
                req->r_request->hdr.data_off = cpu_to_le16(off);
                req->r_request->hdr.data_len = cpu_to_le32(*plen);
        }
@@ -448,7 +448,7 @@ void ceph_osdc_handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg)
 
                /* in case we need to replay this op, */
                req->r_reassert_version = rhead->reassert_version;
-       } else if ((flags & CEPH_OSD_OP_ONDISK) == 0) {
+       } else if ((flags & CEPH_OSD_FLAG_ONDISK) == 0) {
                dout(10, "handle_reply tid %llu dup ack\n", tid);
                goto done;
        }
@@ -456,8 +456,8 @@ void ceph_osdc_handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg)
        dout(10, "handle_reply tid %llu flags %d\n", tid, flags);
 
        /* either this is a read, or we got the safe response */
-       if ((flags & CEPH_OSD_OP_ONDISK) ||
-           ((flags & CEPH_OSD_OP_MODIFY) == 0))
+       if ((flags & CEPH_OSD_FLAG_ONDISK) ||
+           ((flags & CEPH_OSD_FLAG_MODIFY) == 0))
                __unregister_request(osdc, req);
 
        mutex_unlock(&osdc->request_mutex);
@@ -467,7 +467,7 @@ void ceph_osdc_handle_reply(struct ceph_osd_client *osdc, struct ceph_msg *msg)
        else
                complete(&req->r_completion);
 
-       if (flags & CEPH_OSD_OP_ONDISK) {
+       if (flags & CEPH_OSD_FLAG_ONDISK) {
                if (req->r_safe_callback)
                        req->r_safe_callback(req);
                complete(&req->r_safe_completion);  /* fsync waiter */
@@ -530,7 +530,7 @@ static void kick_requests(struct ceph_osd_client *osdc,
                mutex_unlock(&osdc->request_mutex);
                req->r_request = ceph_msg_maybe_dup(req->r_request);
                if (!req->r_aborted) {
-                       req->r_flags |= CEPH_OSD_OP_RETRY;
+                       req->r_flags |= CEPH_OSD_FLAG_RETRY;
                        send_request(osdc, req);
                }
                ceph_osdc_put_request(req);
@@ -803,7 +803,7 @@ void ceph_osdc_sync(struct ceph_osd_client *osdc)
                       break;
 
               next_tid = req->r_tid + 1;
-              if ((req->r_flags & CEPH_OSD_OP_MODIFY) == 0)
+              if ((req->r_flags & CEPH_OSD_FLAG_MODIFY) == 0)
                       continue;
 
               ceph_osdc_get_request(req);
@@ -939,8 +939,8 @@ int ceph_osdc_writepages(struct ceph_osd_client *osdc, struct ceph_vino vino,
        BUG_ON(vino.snap != CEPH_NOSNAP);
        req = ceph_osdc_new_request(osdc, layout, vino, off, &len,
                                    CEPH_OSD_OP_WRITE,
-                                   flags | CEPH_OSD_OP_ONDISK |
-                                   CEPH_OSD_OP_MODIFY,
+                                   flags | CEPH_OSD_FLAG_ONDISK |
+                                   CEPH_OSD_FLAG_MODIFY,
                                    snapc, do_sync,
                                    truncate_seq, truncate_size, mtime);
        if (IS_ERR(req))
index ba8331fae0f37e41dadf99ced987be5286c749a7..a68754687078bb13f63e0fb1aa58c176473a5102 100644 (file)
@@ -58,16 +58,16 @@ public:
   
   utime_t get_mtime() { return head.mtime; }
   
-  bool is_modify() { return head.flags & CEPH_OSD_OP_MODIFY; }
+  bool is_modify() { return head.flags & CEPH_OSD_FLAG_MODIFY; }
 
   unsigned get_inc_lock() const { return head.inc_lock; }
 
   void set_peer_stat(const osd_peer_stat_t& stat) {
     peer_stat = stat;
-    head.flags = (head.flags | CEPH_OSD_OP_PEERSTAT);
+    head.flags = (head.flags | CEPH_OSD_FLAG_PEERSTAT);
   }
   const osd_peer_stat_t& get_peer_stat() {
-    assert(head.flags & CEPH_OSD_OP_PEERSTAT);
+    assert(head.flags & CEPH_OSD_FLAG_PEERSTAT);
     return peer_stat; 
   }
 
@@ -133,20 +133,20 @@ public:
   // flags
   int get_flags() const { return head.flags; }
 
-  bool wants_ack() const { return get_flags() & CEPH_OSD_OP_ACK; }
-  bool wants_ondisk() const { return get_flags() & CEPH_OSD_OP_ONDISK; }
-  bool wants_onnvram() const { return get_flags() & CEPH_OSD_OP_ONNVRAM; }
+  bool wants_ack() const { return get_flags() & CEPH_OSD_FLAG_ACK; }
+  bool wants_ondisk() const { return get_flags() & CEPH_OSD_FLAG_ONDISK; }
+  bool wants_onnvram() const { return get_flags() & CEPH_OSD_FLAG_ONNVRAM; }
 
-  void set_want_ack(bool b) { head.flags = get_flags() | CEPH_OSD_OP_ACK; }
-  void set_want_onnvram(bool b) { head.flags = get_flags() | CEPH_OSD_OP_ONNVRAM; }
-  void set_want_ondisk(bool b) { head.flags = get_flags() | CEPH_OSD_OP_ONDISK; }
+  void set_want_ack(bool b) { head.flags = get_flags() | CEPH_OSD_FLAG_ACK; }
+  void set_want_onnvram(bool b) { head.flags = get_flags() | CEPH_OSD_FLAG_ONNVRAM; }
+  void set_want_ondisk(bool b) { head.flags = get_flags() | CEPH_OSD_FLAG_ONDISK; }
 
-  bool is_retry_attempt() const { return get_flags() & CEPH_OSD_OP_RETRY; }
+  bool is_retry_attempt() const { return get_flags() & CEPH_OSD_FLAG_RETRY; }
   void set_retry_attempt(bool a) { 
     if (a)
-      head.flags = head.flags | CEPH_OSD_OP_RETRY;
+      head.flags = head.flags | CEPH_OSD_FLAG_RETRY;
     else
-      head.flags = head.flags & ~CEPH_OSD_OP_RETRY;
+      head.flags = head.flags & ~CEPH_OSD_FLAG_RETRY;
   }
 
   // marshalling
@@ -156,7 +156,7 @@ public:
     ::encode(head, payload);
     ::encode_nohead(ops, payload);
     ::encode_nohead(snaps, payload);
-    if (head.flags & CEPH_OSD_OP_PEERSTAT)
+    if (head.flags & CEPH_OSD_FLAG_PEERSTAT)
       ::encode(peer_stat, payload);
   }
 
@@ -165,7 +165,7 @@ public:
     ::decode(head, p);
     decode_nohead(head.num_ops, ops, p);
     decode_nohead(head.num_snaps, snaps, p);
-    if (head.flags & CEPH_OSD_OP_PEERSTAT)
+    if (head.flags & CEPH_OSD_FLAG_PEERSTAT)
       ::decode(peer_stat, p);
   }
 
index 54e8de7ce77c45b8171f1abfea96eef716c318ef..f13d51c04f0a7497d83ca19af9f7dba8f5071ce3 100644 (file)
@@ -39,13 +39,13 @@ class MOSDOpReply : public Message {
   pg_t     get_pg() { return pg_t(head.layout.ol_pgid); }
   int      get_flags() { return head.flags; }
 
-  bool     is_ondisk() { return get_flags() & CEPH_OSD_OP_ONDISK; }
-  bool     is_onnvram() { return get_flags() & CEPH_OSD_OP_ONNVRAM; }
+  bool     is_ondisk() { return get_flags() & CEPH_OSD_FLAG_ONDISK; }
+  bool     is_onnvram() { return get_flags() & CEPH_OSD_FLAG_ONNVRAM; }
   
   __s32 get_result() { return head.result; }
   eversion_t get_version() { return head.reassert_version; }
 
-  bool is_modify() { return head.flags & CEPH_OSD_OP_MODIFY; }
+  bool is_modify() { return head.flags & CEPH_OSD_FLAG_MODIFY; }
 
   void set_result(int r) { head.result = r; }
   void set_version(eversion_t v) { head.reassert_version = v; }
@@ -66,7 +66,7 @@ public:
     ops = req->ops;
     head.result = result;
     head.flags =
-      (req->head.flags & ~(CEPH_OSD_OP_ONDISK|CEPH_OSD_OP_ONNVRAM|CEPH_OSD_OP_ACK)) | acktype;
+      (req->head.flags & ~(CEPH_OSD_FLAG_ONDISK|CEPH_OSD_FLAG_ONNVRAM|CEPH_OSD_FLAG_ACK)) | acktype;
     head.oid = req->head.oid;
     head.layout = req->head.layout;
     head.osdmap_epoch = e;
index 110ae555286da2a349b8e969bb13a912bf1abb75..d4a20383946b46e595e678b206e38fb5d4fe22e5 100644 (file)
@@ -86,8 +86,8 @@ public:
   pobject_t get_poid() { return poid; }
 
   int get_ack_type() { return ack_type; }
-  bool is_ondisk() { return ack_type & CEPH_OSD_OP_ONDISK; }
-  bool is_onnvram() { return ack_type & CEPH_OSD_OP_ONNVRAM; }
+  bool is_ondisk() { return ack_type & CEPH_OSD_FLAG_ONDISK; }
+  bool is_onnvram() { return ack_type & CEPH_OSD_FLAG_ONNVRAM; }
 
   int get_result() { return result; }
 
@@ -121,11 +121,11 @@ public:
     out << "osd_sub_op_reply(" << reqid
        << " " << pgid 
        << " " << poid << " " << ops;
-    if (ack_type & CEPH_OSD_OP_ONDISK)
+    if (ack_type & CEPH_OSD_FLAG_ONDISK)
       out << " ondisk";
-    if (ack_type & CEPH_OSD_OP_ONNVRAM)
+    if (ack_type & CEPH_OSD_FLAG_ONNVRAM)
       out << " onnvram";
-    if (ack_type & CEPH_OSD_OP_ACK)
+    if (ack_type & CEPH_OSD_FLAG_ACK)
       out << " ack";
     out << " = " << result;
     out << ")";
index 3c6c8ec9c93828321e84368f1c7bbe4d69a8ad63..cfa9cbcd1df903838c76f7db618c584857560261 100644 (file)
@@ -3296,7 +3296,7 @@ void OSD::defer_recovery(PG *pg)
 
 void OSD::reply_op_error(MOSDOp *op, int err)
 {
-  MOSDOpReply *reply = new MOSDOpReply(op, err, osdmap->get_epoch(), CEPH_OSD_OP_ACK);
+  MOSDOpReply *reply = new MOSDOpReply(op, err, osdmap->get_epoch(), CEPH_OSD_FLAG_ACK);
   messenger->send_message(reply, op->get_orig_source_inst());
   delete op;
 }
index 29b744a8f628802a99e9e0b70d4b9be1ce3cfe1d..a6b356c7804a8dbcdde630ebb37b044461fa8b42 100644 (file)
@@ -1889,7 +1889,7 @@ void PG::sub_op_scrub(MOSDSubOp *op)
   ScrubMap map;
   build_scrub_map(map);
 
-  MOSDSubOpReply *reply = new MOSDSubOpReply(op, 0, osd->osdmap->get_epoch(), CEPH_OSD_OP_ACK); 
+  MOSDSubOpReply *reply = new MOSDSubOpReply(op, 0, osd->osdmap->get_epoch(), CEPH_OSD_FLAG_ACK); 
   ::encode(map, reply->get_data());
   osd->messenger->send_message(reply, op->get_source_inst());
 
index d82536d844ccb4fde39313963a01bb9f2936e857..e69f84b9af92c14dff28c0b3b3dc6dce1101c3fa 100644 (file)
@@ -174,7 +174,7 @@ bool ReplicatedPG::preprocess_op(MOSDOp *op, utime_t now)
                                 oid,
                                 layout,
                                 osd->osdmap->get_epoch(),
-                                CEPH_OSD_OP_MODIFY);
+                                CEPH_OSD_FLAG_MODIFY);
        pop->add_simple_op(CEPH_OSD_OP_BALANCEREADS, 0, 0);
        do_op(pop);
       }
@@ -189,7 +189,7 @@ bool ReplicatedPG::preprocess_op(MOSDOp *op, utime_t now)
                                 oid,
                                 layout,
                                 osd->osdmap->get_epoch(),
-                                CEPH_OSD_OP_MODIFY);
+                                CEPH_OSD_FLAG_MODIFY);
        pop->add_simple_op(CEPH_OSD_OP_UNBALANCEREADS, 0, 0);
        do_op(pop);
       }
@@ -664,7 +664,7 @@ void ReplicatedPG::op_read(MOSDOp *op)
        op->get_source().num() == get_primary()) {
       // read was shed to me by the primary
       int from = op->get_source().num();
-      assert(op->get_flags() & CEPH_OSD_OP_PEERSTAT);
+      assert(op->get_flags() & CEPH_OSD_FLAG_PEERSTAT);
       osd->take_peer_stat(from, op->get_peer_stat());
       dout(10) << "read shed IN from " << op->get_source() 
                << " " << op->get_reqid()
@@ -830,7 +830,7 @@ void ReplicatedPG::op_read(MOSDOp *op)
   
  done:
   // reply
-  MOSDOpReply *reply = new MOSDOpReply(op, 0, osd->osdmap->get_epoch(), CEPH_OSD_OP_ACK); 
+  MOSDOpReply *reply = new MOSDOpReply(op, 0, osd->osdmap->get_epoch(), CEPH_OSD_FLAG_ACK); 
   reply->set_data(data);
   reply->get_header().data_off = data_off;
   reply->set_result(result);
@@ -1429,7 +1429,7 @@ void ReplicatedPG::eval_repop(RepGather *repop)
   if (repop->can_send_disk()) {
     if (repop->op->wants_ondisk()) {
       // send commit.
-      MOSDOpReply *reply = new MOSDOpReply(repop->op, 0, osd->osdmap->get_epoch(), CEPH_OSD_OP_ONDISK);
+      MOSDOpReply *reply = new MOSDOpReply(repop->op, 0, osd->osdmap->get_epoch(), CEPH_OSD_FLAG_ONDISK);
       dout(10) << " sending commit on " << *repop << " " << reply << dendl;
       osd->messenger->send_message(reply, repop->op->get_orig_source_inst());
       repop->sent_disk = true;
@@ -1440,7 +1440,7 @@ void ReplicatedPG::eval_repop(RepGather *repop)
   else if (repop->can_send_nvram()) {
     if (repop->op->wants_onnvram()) {
       // send commit.
-      MOSDOpReply *reply = new MOSDOpReply(repop->op, 0, osd->osdmap->get_epoch(), CEPH_OSD_OP_ONNVRAM);
+      MOSDOpReply *reply = new MOSDOpReply(repop->op, 0, osd->osdmap->get_epoch(), CEPH_OSD_FLAG_ONNVRAM);
       dout(10) << " sending onnvram on " << *repop << " " << reply << dendl;
       osd->messenger->send_message(reply, repop->op->get_orig_source_inst());
       repop->sent_nvram = true;
@@ -1455,7 +1455,7 @@ void ReplicatedPG::eval_repop(RepGather *repop)
 
     if (repop->op->wants_ack()) {
       // send ack
-      MOSDOpReply *reply = new MOSDOpReply(repop->op, 0, osd->osdmap->get_epoch(), CEPH_OSD_OP_ACK);
+      MOSDOpReply *reply = new MOSDOpReply(repop->op, 0, osd->osdmap->get_epoch(), CEPH_OSD_FLAG_ACK);
       dout(10) << " sending ack on " << *repop << " " << reply << dendl;
       osd->messenger->send_message(reply, repop->op->get_orig_source_inst());
       repop->sent_ack = true;
@@ -1504,7 +1504,7 @@ void ReplicatedPG::issue_repop(RepGather *repop, int dest, utime_t now)
           << dendl;
   
   // forward the write/update/whatever
-  int acks_wanted = CEPH_OSD_OP_ACK | CEPH_OSD_OP_ONDISK;
+  int acks_wanted = CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK;
   MOSDSubOp *wr = new MOSDSubOp(repop->op->get_reqid(), info.pgid, poid,
                                repop->op->ops, repop->noop, acks_wanted,
                                osd->osdmap->get_epoch(), 
@@ -1563,7 +1563,7 @@ void ReplicatedPG::repop_ack(RepGather *repop, int result, int ack_type,
          << " from osd" << fromosd
           << dendl;
   
-  if (ack_type & CEPH_OSD_OP_ONDISK) {
+  if (ack_type & CEPH_OSD_FLAG_ONDISK) {
     // disk
     if (repop->waitfor_disk.count(fromosd)) {
       repop->waitfor_disk.erase(fromosd);
@@ -1571,7 +1571,7 @@ void ReplicatedPG::repop_ack(RepGather *repop, int result, int ack_type,
       repop->waitfor_ack.erase(fromosd);
       repop->pg_complete_thru[fromosd] = pg_complete_thru;
     }
-  } else if (ack_type & CEPH_OSD_OP_ONNVRAM) {
+  } else if (ack_type & CEPH_OSD_FLAG_ONNVRAM) {
     // nvram
     repop->waitfor_nvram.erase(fromosd);
     repop->waitfor_ack.erase(fromosd);
@@ -1730,7 +1730,7 @@ void ReplicatedPG::op_modify(MOSDOp *op)
            << dendl;  
 
   // verify snap ordering
-  if ((op->get_flags() & CEPH_OSD_OP_ORDERSNAP) &&
+  if ((op->get_flags() & CEPH_OSD_FLAG_ORDERSNAP) &&
       snapc.seq < pinfo->oi.snapset.seq) {
     dout(10) << " ORDERSNAP flag set and snapc seq " << snapc.seq << " < snapset seq " << pinfo->oi.snapset.seq
             << " on " << poid << dendl;
@@ -1907,7 +1907,7 @@ void ReplicatedPG::sub_op_modify(MOSDSubOp *op)
   }
   
   // send ack to acker
-  MOSDSubOpReply *ack = new MOSDSubOpReply(op, 0, osd->osdmap->get_epoch(), CEPH_OSD_OP_ACK);
+  MOSDSubOpReply *ack = new MOSDSubOpReply(op, 0, osd->osdmap->get_epoch(), CEPH_OSD_FLAG_ACK);
   ack->set_peer_stat(osd->get_my_stat_for(g_clock.now(), ackerosd));
   osd->messenger->send_message(ack, osd->osdmap->get_inst(ackerosd));
   
@@ -1922,7 +1922,7 @@ void ReplicatedPG::sub_op_modify_ondisk(MOSDSubOp *op, int ackerosd, eversion_t
            << ", sending commit to osd" << ackerosd
            << dendl;
   if (osd->osdmap->is_up(ackerosd)) {
-    MOSDSubOpReply *commit = new MOSDSubOpReply(op, 0, osd->osdmap->get_epoch(), CEPH_OSD_OP_ONDISK);
+    MOSDSubOpReply *commit = new MOSDSubOpReply(op, 0, osd->osdmap->get_epoch(), CEPH_OSD_FLAG_ONDISK);
     commit->set_pg_complete_thru(last_complete);
     commit->set_peer_stat(osd->get_my_stat_for(g_clock.now(), ackerosd));
     osd->messenger->send_message(commit, osd->osdmap->get_inst(ackerosd));
@@ -2133,7 +2133,7 @@ bool ReplicatedPG::pull(pobject_t poid)
   tid_t tid = osd->get_tid();
   vector<ceph_osd_op> pull(1);
   pull[0].op = CEPH_OSD_OP_PULL;
-  MOSDSubOp *subop = new MOSDSubOp(rid, info.pgid, poid, pull, false, CEPH_OSD_OP_ACK,
+  MOSDSubOp *subop = new MOSDSubOp(rid, info.pgid, poid, pull, false, CEPH_OSD_FLAG_ACK,
                                   osd->osdmap->get_epoch(), tid, v);
   subop->data_subset.swap(data_subset);
   // do not include clone_subsets in pull request; we will recalculate this
@@ -2532,7 +2532,7 @@ void ReplicatedPG::sub_op_push(MOSDSubOp *op)
 
   } else {
     // ack if i'm a replica and being pushed to.
-    MOSDSubOpReply *reply = new MOSDSubOpReply(op, 0, osd->osdmap->get_epoch(), CEPH_OSD_OP_ACK); 
+    MOSDSubOpReply *reply = new MOSDSubOpReply(op, 0, osd->osdmap->get_epoch(), CEPH_OSD_FLAG_ACK); 
     osd->messenger->send_message(reply, op->get_source_inst());
   }
 
index 41bd10e7b8a246b7c41377208c459ef80ddffd84..26b96274ccb02664104d042c9c15b20ba80bcad9 100644 (file)
@@ -84,7 +84,7 @@ void Journaler::recover(Context *onread)
   C_ReadHead *fin = new C_ReadHead(this);
   vector<snapid_t> snaps;
   filer.read(ino, &layout, CEPH_NOSNAP,
-            0, sizeof(Header), &fin->bl, CEPH_OSD_OP_INCLOCK_FAIL, fin);
+            0, sizeof(Header), &fin->bl, CEPH_OSD_FLAG_INCLOCK_FAIL, fin);
 }
 
 void Journaler::_finish_read_head(int r, bufferlist& bl)
@@ -116,7 +116,7 @@ void Journaler::_finish_read_head(int r, bufferlist& bl)
   state = STATE_PROBING;
   C_ProbeEnd *fin = new C_ProbeEnd(this);
   filer.probe(ino, &layout, CEPH_NOSNAP,
-             h.write_pos, (__u64 *)&fin->end, true, CEPH_OSD_OP_INCLOCK_FAIL, fin);
+             h.write_pos, (__u64 *)&fin->end, true, CEPH_OSD_FLAG_INCLOCK_FAIL, fin);
 }
 
 void Journaler::_finish_probe_end(int r, __s64 end)
@@ -174,7 +174,7 @@ void Journaler::write_head(Context *oncommit)
   ::encode(last_written, bl);
   SnapContext snapc;
   filer.write(ino, &layout, snapc,
-             0, bl.length(), bl, g_clock.now(), CEPH_OSD_OP_INCLOCK_FAIL,
+             0, bl.length(), bl, g_clock.now(), CEPH_OSD_FLAG_INCLOCK_FAIL,
              NULL, 
              new C_WriteHead(this, last_written, oncommit));
 }
@@ -354,7 +354,7 @@ void Journaler::_do_flush()
 
   filer.write(ino, &layout, snapc,
              flush_pos, len, write_buf, g_clock.now(),
-             CEPH_OSD_OP_INCLOCK_FAIL,
+             CEPH_OSD_FLAG_INCLOCK_FAIL,
              onack, onsafe);
   
  
@@ -553,7 +553,7 @@ void Journaler::_issue_read(__s64 len)
           << dendl;
   
   filer.read(ino, &layout, CEPH_NOSNAP,
-            requested_pos, len, &reading_buf, CEPH_OSD_OP_INCLOCK_FAIL,
+            requested_pos, len, &reading_buf, CEPH_OSD_FLAG_INCLOCK_FAIL,
             new C_Read(this));
   requested_pos += len;
 }
@@ -739,7 +739,7 @@ void Journaler::trim()
   
   SnapContext snapc;
   filer.remove(ino, &layout, snapc,
-              trimming_pos, trim_to-trimming_pos, g_clock.now(), CEPH_OSD_OP_INCLOCK_FAIL, 
+              trimming_pos, trim_to-trimming_pos, g_clock.now(), CEPH_OSD_FLAG_INCLOCK_FAIL, 
               NULL, new C_Trim(this, trim_to));
   trimming_pos = trim_to;  
 }
index 35198b19471f042424c79562591fb9a027cffdf3..5f2ac3267dd49608e4bd3af545b6580096bd9b19 100644 (file)
@@ -381,7 +381,7 @@ tid_t Objecter::read_submit(ReadOp *rd)
   } else if (pg.acker() >= 0) {
     int flags = rd->flags;
     if (rd->onfinish)
-      flags |= CEPH_OSD_OP_ACK;
+      flags |= CEPH_OSD_FLAG_ACK;
     MOSDOp *m = new MOSDOp(client_inc, last_tid,
                           rd->oid, rd->layout, osdmap->get_epoch(), 
                           flags);
@@ -393,7 +393,7 @@ tid_t Objecter::read_submit(ReadOp *rd)
     m->set_retry_attempt(rd->attempts++);
     
     int who = pg.acker();
-    if (rd->flags & CEPH_OSD_OP_BALANCE_READS) {
+    if (rd->flags & CEPH_OSD_FLAG_BALANCE_READS) {
       int replica = messenger->get_myname().num() % pg.acting.size();
       who = pg.acting[replica];
       dout(-10) << "read_submit reading from random replica " << replica
@@ -430,7 +430,7 @@ void Objecter::handle_osd_read_reply(MOSDOpReply *m)
   
   // fail?
   if (m->get_result() == -EINCLOCKED &&
-      rd->flags & CEPH_OSD_OP_INCLOCK_FAIL) {
+      rd->flags & CEPH_OSD_FLAG_INCLOCK_FAIL) {
     dout(7) << " got -EINCLOCKED, failing" << dendl;
     if (rd->onfinish) {
       rd->onfinish->finish(-EINCLOCKED);
@@ -492,13 +492,13 @@ tid_t Objecter::modify_submit(ModifyOp *wr)
   // add to gather set(s)
   int flags = wr->flags;
   if (wr->onack) {
-    flags |= CEPH_OSD_OP_ACK;
+    flags |= CEPH_OSD_FLAG_ACK;
     ++num_unacked;
   } else {
     dout(20) << " note: not requesting ack" << dendl;
   }
   if (wr->oncommit) {
-    flags |= CEPH_OSD_OP_ONDISK;
+    flags |= CEPH_OSD_FLAG_ONDISK;
     ++num_uncommitted;
   } else {
     dout(20) << " note: not requesting commit" << dendl;
@@ -521,7 +521,7 @@ tid_t Objecter::modify_submit(ModifyOp *wr)
   } else if (pg.primary() >= 0) {
     MOSDOp *m = new MOSDOp(client_inc, wr->tid,
                           wr->oid, wr->layout, osdmap->get_epoch(),
-                          flags | CEPH_OSD_OP_MODIFY);
+                          flags | CEPH_OSD_FLAG_MODIFY);
     m->ops = wr->ops;
     m->set_mtime(wr->mtime);
     m->set_snap_seq(wr->snapc.seq);
@@ -580,7 +580,7 @@ void Objecter::handle_osd_modify_reply(MOSDOpReply *m)
   }
   
   int rc = 0;
-  if (m->get_result() == -EINCLOCKED && wr->flags & CEPH_OSD_OP_INCLOCK_FAIL) {
+  if (m->get_result() == -EINCLOCKED && wr->flags & CEPH_OSD_FLAG_INCLOCK_FAIL) {
     dout(7) << " got -EINCLOCKED, failing" << dendl;
     rc = -EINCLOCKED;
     if (wr->onack) {