libceph: add support for CEPH_OSD_OP_SETALLOCHINT osd op
authorIlya Dryomov <ilya.dryomov@inktank.com>
Tue, 25 Feb 2014 14:22:27 +0000 (16:22 +0200)
committerYan, Zheng <zheng.z.yan@intel.com>
Thu, 3 Apr 2014 02:33:51 +0000 (10:33 +0800)
commitc647b8a8c6366f849c2a237bfe525cb1d316d5f4
tree8f3385992b44ba6bb5bcb1d745bb6df4dd6b5bbf
parent7b25bf5f02c5c80adf96120e031dc3a1756ce54d
libceph: add support for CEPH_OSD_OP_SETALLOCHINT osd op

This is primarily for rbd's benefit and is supposed to combat
fragmentation:

"... knowing that rbd images have a 4m size, librbd can pass a hint
that will let the osd do the xfs allocation size ioctl on new files so
that they are allocated in 1m or 4m chunks.  We've seen cases where
users with rbd workloads have very high levels of fragmentation in xfs
and this would mitigate that and probably have a pretty nice
performance benefit."

SETALLOCHINT is considered advisory, so our backwards compatibility
mechanism here is to set FAILOK flag for all SETALLOCHINT ops.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
include/linux/ceph/osd_client.h
include/linux/ceph/rados.h
net/ceph/osd_client.c