mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
*** empty log message ***
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@632 29311d96-e01e-0410-9327-a35deaab8ce9
This commit is contained in:
parent
7a8e52d16c
commit
f05d4cffe8
@ -194,7 +194,7 @@ int OSD::init()
|
||||
osd_lock.Lock();
|
||||
|
||||
if (g_conf.osd_mkfs) {
|
||||
dout(1) << "mkfs" << endl;
|
||||
dout(2) << "mkfs" << endl;
|
||||
|
||||
store->mkfs();
|
||||
}
|
||||
@ -650,7 +650,7 @@ void OSD::handle_osd_map(MOSDMap *m)
|
||||
wait_for_no_ops();
|
||||
|
||||
if (m->is_mkfs()) {
|
||||
dout(1) << "MKFS" << endl;
|
||||
dout(2) << "MKFS" << endl;
|
||||
}
|
||||
|
||||
if (!osdmap ||
|
||||
@ -2317,17 +2317,17 @@ void OSD::issue_replica_op(PG *pg, OSDReplicaOp *repop, int osd)
|
||||
void OSD::get_repop(OSDReplicaOp *repop)
|
||||
{
|
||||
repop->lock.Lock();
|
||||
dout(15) << "get_repop " << *repop << endl;
|
||||
dout(1) << "get_repop " << *repop << endl;
|
||||
}
|
||||
|
||||
void OSD::put_repop(OSDReplicaOp *repop)
|
||||
{
|
||||
dout(15) << "put_repop " << *repop << endl;
|
||||
dout(1) << "put_repop " << *repop << endl;
|
||||
|
||||
// safe?
|
||||
if (repop->can_send_safe() &&
|
||||
repop->op->wants_safe()) {
|
||||
dout(15) << "put_repop sending safe on " << *repop << endl;
|
||||
dout(1) << "put_repop sending safe on " << *repop << endl;
|
||||
MOSDOpReply *reply = new MOSDOpReply(repop->op, 0, osdmap, true);
|
||||
messenger->send_message(reply, repop->op->get_asker());
|
||||
repop->sent_safe = true;
|
||||
@ -2336,7 +2336,7 @@ void OSD::put_repop(OSDReplicaOp *repop)
|
||||
// ack?
|
||||
else if (repop->can_send_ack() &&
|
||||
repop->op->wants_ack()) {
|
||||
dout(15) << "put_repop sending ack on " << *repop << endl;
|
||||
dout(1) << "put_repop sending ack on " << *repop << endl;
|
||||
MOSDOpReply *reply = new MOSDOpReply(repop->op, 0, osdmap, false);
|
||||
messenger->send_message(reply, repop->op->get_asker());
|
||||
repop->sent_ack = true;
|
||||
@ -2344,7 +2344,7 @@ void OSD::put_repop(OSDReplicaOp *repop)
|
||||
|
||||
// done.
|
||||
if (repop->can_delete()) {
|
||||
dout(15) << "put_repop deleting " << *repop << endl;
|
||||
dout(1) << "put_repop deleting " << *repop << endl;
|
||||
repop->lock.Unlock();
|
||||
delete repop->op;
|
||||
delete repop;
|
||||
@ -2398,12 +2398,14 @@ void OSD::op_modify(MOSDOp *op)
|
||||
|
||||
PG *pg;
|
||||
osd_lock.Lock();
|
||||
repop->lock.Lock();
|
||||
{
|
||||
pg = get_pg(op->get_pg());
|
||||
for (unsigned i=1; i<pg->acting.size(); i++) {
|
||||
issue_replica_op(pg, repop, pg->acting[i]);
|
||||
}
|
||||
}
|
||||
repop->lock.Unlock();
|
||||
osd_lock.Unlock();
|
||||
|
||||
// pre-ack
|
||||
|
@ -38,6 +38,7 @@ using namespace std;
|
||||
#include <ext/hash_set>
|
||||
using namespace __gnu_cxx;
|
||||
|
||||
#include "messages/MOSDOp.h"
|
||||
|
||||
class Messenger;
|
||||
class Message;
|
||||
@ -75,7 +76,7 @@ inline ostream& operator<<(ostream& out, OSDReplicaOp& repop)
|
||||
//if (repop.local_ack) out << " local_ack";
|
||||
//if (repop.local_safe) out << " local_safe";
|
||||
if (repop.cancel) out << " cancel";
|
||||
out << " op=" << repop.op;
|
||||
out << " op=" << *(repop.op);
|
||||
out << " repop=" << &repop;
|
||||
out << ")";
|
||||
return out;
|
||||
|
@ -158,22 +158,26 @@ class OSDMap {
|
||||
int num_rep = pg_to_nrep(pg);
|
||||
pg_t ps = pg_to_ps(pg);
|
||||
|
||||
// spread "on" ps bits around a bit (usually only low bits are set bc of pg_bits)
|
||||
int hps = ((ps >> 32) ^ ps);
|
||||
hps = hps ^ (hps >> 16);
|
||||
|
||||
switch(g_conf.osd_pg_layout) {
|
||||
case PG_LAYOUT_CRUSH:
|
||||
crush.do_rule(crush.rules[num_rep],
|
||||
ps ^ (ps >> 32),
|
||||
hps,
|
||||
osds);
|
||||
break;
|
||||
|
||||
case PG_LAYOUT_LINEAR:
|
||||
for (int i=0; i<num_rep; i++)
|
||||
osds.push_back( ((pg_t)i + ps*num_rep) % g_conf.num_osd );
|
||||
osds.push_back( (i + ps*num_rep) % g_conf.num_osd );
|
||||
break;
|
||||
|
||||
case PG_LAYOUT_HYBRID:
|
||||
{
|
||||
static crush::Hash H(1066);
|
||||
int h = H(ps ^ (ps >> 32));
|
||||
static crush::Hash H(777);
|
||||
int h = H(hps);
|
||||
for (int i=0; i<num_rep; i++)
|
||||
osds.push_back( (h+i) % g_conf.num_osd );
|
||||
}
|
||||
@ -181,12 +185,12 @@ class OSDMap {
|
||||
|
||||
case PG_LAYOUT_HASH:
|
||||
{
|
||||
static crush::Hash H(1066);
|
||||
static crush::Hash H(777);
|
||||
for (int i=0; i<num_rep; i++) {
|
||||
int t = 1;
|
||||
int osd = 0;
|
||||
while (t++) {
|
||||
osd = H(i, pg^(pg>>32), t) % g_conf.num_osd;
|
||||
osd = H(i, hps, t) % g_conf.num_osd;
|
||||
int j = 0;
|
||||
for (; j<i; j++)
|
||||
if (osds[j] == osd) break;
|
||||
|
Loading…
Reference in New Issue
Block a user