osd/osd_types: make pref optional in pg_t constructor

We don't use preferred placements any more, so this will
make it easier to start dropping references to it in new code.

Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: drop redundant condition

We are inside an if (response_size) block.

Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: separate explicit pg target from current target

The pgid field is used to store the pg the op mapped to.  We were just
setting it directly for PGLS.  Instead, fill in a new base_pgid, and copy that
to pgid in recalc_op_target(), the same way we do when we map an object
name to a PG.

In particular, we take this opportunity to map a raw pgid to an actual
pgid.  This means the base_pg could come from a raw hash value (although
it doesn't, yet).

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Greg Farnum <greg@inktank.com>
osdc/Objecter: factor pg_read out of list_objects code

This will get used later for other ops against PGs (instead of objects).

Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: stick bl inside ListContext

This is simpler and less error-prone.

Signed-off-by: Sage Weil <sage@inktank.com>
librados: add get_pg_hash_position to determine pg while listing objects

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

Return to caller at the end of each PG.  This allows the caller to look at
the [pg_]hash_position and get something meaningful.

If there are no objects in the PG, we skip it so that every callback has
*some* data (unless the pool is totally empty!).  So the real difference
here is that we don't move on to the next PG just to reach max_entries.

This gives the client some data sooner, but may mean more callbacks into
client code.

Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #847 from ceph/wip-rados-list

Reviewed-by: Greg Farnum <greg@inktank.com>