tools: Fix ceph_filestore_dump usage again

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: Add assert() on collection_getattr() failure instead of later decode crash

Signed-off-by: David Zafman <david.zafman@inktank.com>
common: Fix get_namespace() definition in hobject_t

Signed-off-by: David Zafman <david.zafman@inktank.com>
os: Fix typo in comment

Signed-off-by: David Zafman <david.zafman@inktank.com>
os: Code conformance of os/LFNIndex.cc

Signed-off-by: David Zafman <david.zafman@inktank.com>
os: Prior version bump should have updated this

Caused by dab238b0fb76b76a8843f4e59319b0f0e4f966a2

Signed-off-by: David Zafman <david.zafman@inktank.com>
os, ceph_osd: Rename on_disk_version to target_version

Signed-off-by: David Zafman <david.zafman@inktank.com>
os: Fix version_stamp_is_valid() and write_vesion_stamp() error return

Caused by 341fb208aa32117f58ed4ce623f4b152f64ac72e

Signed-off-by: David Zafman <david.zafman@inktank.com>
include: Bug fixes for CompatSet

FeatureSet insert/remove
  Use 64-bit arithmetic to allow features past 31
  Allow feature 63 by fixing assert in insert
CompatSet::unsupported() bugs
  Ignore feature 0 which became illegal
  Use 64-bit arithmetic when computing mask
  Use id in insert() and to get correct feature name
  Use the right map to get name for diff.ro_compat

Caused by 80979bbe92409e6f098566e18be6ed59ad9d111a
Caused by 470796b5456592ee5179bbd44b72910a2d7f6aca

Backport: where?

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: read_superblock() not outputing unsupported features when incompatible

Use working version of CompatSet::unsupported() to improve log output

Backport: where?

Signed-off-by: David Zafman <david.zafman@inktank.com>
os, osd, tools: Add backportable compatibility checking for sharded objects

OSD
  New CEPH_OSD_FEATURE_INCOMPAT_SHARDS
FileStore
  NEW CEPH_FS_FEATURE_INCOMPAT_SHARDS
  Add FSSuperblock with feature CompatSet in it
  Store sharded_objects state using CompatSet
  Add set_allow_sharded_objects() and get_allow_sharded_objects() to FileStore/ObjectStore
  Add read_superblock()/write_superblock() internal filestore functions
ceph_filestore_dump
  Add OSDsuperblock to export format
  Use CompatSet from OSD code itself in filestore-dump tool
  Always check compatibility of OSD features with on-disk features
  On import verify compatibility of on-disk features with export data
  Bump super_ver due to export format change

Backport: where?

Signed-off-by: David Zafman <david.zafman@inktank.com>
include: Add CompatSet::merge() operation for automatic CompatSet upgrading

Signed-off-by: David Zafman <david.zafman@inktank.com>
common, os, osd, test, tools: FileStore must work with ghobjects rather than hobjects

Add ghobject_t to hboject.h header
Add constants NO_SHARD/NO_GEN and change gen_t/shard_t
Convert other headers from hobject_t to ghobject_t
Mostly straight hobject_t to ghobject_t for src/os cc files
Fix tools and tests and enable ceph-dencoder
Add filename generation and parsing including unittest addition
Get ceph-filestore-dump to build
Add gen/shard to DBObjectMap::ghobject_key() and update test case
Add CEPH_FS_FEATURE_INCOMPAT_SHARDS new FileStore feature
Add CEPH_OSD_FEATURE_INCOMPAT_SHARDS new osd feature

Fixes: #5862

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: Cleanup init()/read_superblock()

Fix error handling in init()
Cleanup read_superblock() by moving unrelated code into init()
Move init() feature upgrade right after compatibility checking
Remove redundant whoami check

Signed-off-by: David Zafman <david.zafman@inktank.com>
test: Add CompatSet unittest with initial test

Signed-off-by: David Zafman <david.zafman@inktank.com>