Skip to content

Commit

Permalink
ceph: include preferred_osd in file layout virtual xattr
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <sage@newdream.net>
  • Loading branch information
Sage Weil committed Oct 7, 2009
1 parent fa0b72e commit b195bef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fs/ceph/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down

0 comments on commit b195bef

Please sign in to comment.