ceph/ceph — pull request #568 by roaldvanloon (2013-09-06 08:53:24+00:00)
Title: Wip cleanup globals

Two more patches for libosd;

- There are some new globals introduced in libosd lately. This patch cleans them.
- This makes the constructor call on the subclasses explicit, and passes the cct to the NamedState constructor. This cct is used by ceph_clock to set enter_time.

This removes the last references to g_ceph_context and g_conf from libosd (only one reference to g_lockdep remains, but I'm going to leave that one alone - at least for now).

Personally, I think that the state_name attribute should also be passed to the NamedState constructor and keep it const, something like;

```C++
struct NamedState {
const char *state_name;
..
NamedState(CephContext *cct_, const char *state_name_)
: state_name(state_name_),
enter_time(ceph_clock_now(cct_)) {};
}
```

But I'm not sure this breaks nothing, because right now the state_name is set to 0 in the constructor which might have a magical purpose which I can't seem to detect;

```C++
struct NamedState {
const char *state_name;
..
NamedState() : state_name(0), enter_time(ceph_clock_now(g_ceph_context)) {};
}
```

Let me know if changing the latter to the former is OK, because them I'll add that commit to this pull request.

Roald