summaryrefslogtreecommitdiffstats
path: root/fs/ceph/xattr.c
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-10-07 10:59:30 -0700
committerSage Weil <sage@newdream.net>2009-10-07 10:59:30 -0700
commitb195befd9acb514dd2afb722e63fdd880ed63217 (patch)
tree90ad1904d05bef670fb2272d4c347ebc81f84002 /fs/ceph/xattr.c
parentfa0b72e9e2900ee87886aaf8bc4c4701be1e081d (diff)
downloadop-kernel-dev-b195befd9acb514dd2afb722e63fdd880ed63217.zip
op-kernel-dev-b195befd9acb514dd2afb722e63fdd880ed63217.tar.gz
ceph: include preferred_osd in file layout virtual xattr
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/xattr.c')
-rw-r--r--fs/ceph/xattr.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/ceph/xattr.c b/fs/ceph/xattr.c
index 8eaac04..65b3a84 100644
--- a/fs/ceph/xattr.c
+++ b/fs/ceph/xattr.c
@@ -91,11 +91,18 @@ static struct ceph_vxattr_cb ceph_dir_vxattrs[] = {
static size_t ceph_vxattrcb_layout(struct ceph_inode_info *ci, char *val,
size_t size)
{
- return snprintf(val, size,
+ int ret;
+
+ ret = snprintf(val, size,
"chunk_bytes=%lld\nstripe_count=%lld\nobject_size=%lld\n",
(unsigned long long)ceph_file_layout_su(ci->i_layout),
(unsigned long long)ceph_file_layout_stripe_count(ci->i_layout),
(unsigned long long)ceph_file_layout_object_size(ci->i_layout));
+ if (ceph_file_layout_pg_preferred(ci->i_layout))
+ ret += snprintf(val + ret, size, "preferred_osd=%lld\n",
+ (unsigned long long)ceph_file_layout_pg_preferred(
+ ci->i_layout));
+ return ret;
}
static struct ceph_vxattr_cb ceph_file_vxattrs[] = {
OpenPOWER on IntegriCloud