osd_types: add recovery counts to object_sum_stats_t

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 4aea19ee60fbe1106bdd71de2d172aa2941e8aab)
osd: track recovery ops in stats

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit a2495f658c6d17f56ea0a2ab1043299a59a7115b)
mon/PGMap: include timestamp

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 76e9fe5f06411eb0e96753dcd708dd6e43ab2c02)
mon/PGMap: report recovery rates

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 208b02a748d97378f312beaa5110d8630c853ced)
mon/PGMap: report IO rates

This does not appear to be very accurate; probably the stat values we're
displaying are not being calculated correctly.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 3f6837e022176ec4b530219043cf12e009d1ed6e)
mon: smooth pg stat rates over last N pgmaps

This smooths the recovery and throughput stats over the last N pgmaps,
defaulting to 2.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit a7d15afb529615db56bae038b18b66e60d827a96)
PGMap: fix -Wsign-compare warning

Fix -Wsign-compare compiler warning:

mon/PGMap.cc: In member function 'void PGMap::apply_incremental
 (CephContext*, const PGMap::Incremental&)':
mon/PGMap.cc:247:30: warning: comparison between signed and
 unsigned integer expressions [-Wsign-compare]

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit b571f8ee2d22a3894120204bc5f119ff37e1de53)
OSD: check for empty command in do_command

Fixes: #3878
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
(cherry picked from commit 8cf79f252a1bcea5713065390180a36f31d66dfd)
rgw: fix setting of NULL to string

Fixes: #3777
s->env->get() returns char * and not string and can return NULL.
Also, remove some old unused code.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
(cherry picked from commit 9019fbbe8f84f530b6a8700dfe99dfeb03e0ed3d)
rgw_rest: Make fallback uri configurable.

Some HTTP servers, notabily lighttp, do not set SCRIPT_URI, make the fallback
string configurable.

Signed-off-by: caleb miles <caleb.miles@inktank.com>
Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit b3a2e7e955547a863d29566aab62bcc480e27a65)

Conflicts:
	src/rgw/rgw_rest.cc
client: allow ceph.* xattrs

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit ad7ebad70bf810fde45067f78f316f130a243b9c)
client: move xattr namespace enforcement into internal method

This captures libcephfs users now too.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit febb96509559084357bfaabf7e4d28e494c274aa)
client: implement ceph.file.* and ceph.dir.* vxattrs

Display ceph.file.* vxattrs on any regular file, and ceph.dir.* vxattrs
on any directory that has a policy set.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 3f82912a891536dd7e930f98e28d9a8c18fab756)
client: list only aggregate xattr, but allow setting subfield xattrs

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit ba32ea9454d36072ec5ea3e6483dc3daf9199903)
client: note presence of dir layout in inode operator<<

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 84751489ca208964e617516e04556722008ddf67)
mds: fix client view of dir layout when layout is removed

We weren't handling the case where the projected node has NULL for the
layout properly.  Fixes the client's view when we remove the dir layout.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 09f28541e374ffac198e4d48082b064aae93cb2c)
mdsmap: backported is_data_pool()

This roughly corresponds to mainline commit 99d9e1d.

Signed-off-by: Sage Weil <sage@inktank.com>
mds: handle ceph.*.layout.* setxattr

Allow individual fields of file or dir layouts to be set via setxattr.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit ebebf72f0993d028e795c78a986e1aee542ca5e0)
mds: allow dir layout/policy to be removed via removexattr on ceph.dir.layout

This lets a user remove a policy that was previously set on a dir.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit db31a1f9f27416e4d531fda716e32d42a275e84f)
qa: add layout_vxattrs.sh test script

Test virtual xattrs for file and directory layouts.

TODO: create a data pool, add it to the fs, and make sure we can use it.

Signed-off-by: Sage Weil <sage@inktank.com>
(cherry picked from commit 61fbe27a52d12ecd98ddeb5fc0965c4f8ee7841a)