Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309458
b: refs/heads/master
c: 702aeb1
h: refs/heads/master
v: v3
  • Loading branch information
Sage Weil authored and Alex Elder committed May 16, 2012
1 parent e6bf273 commit 1c8a980
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fd51653f78cf40a0516e521b6de22f329c5bad8d
refs/heads/master: 702aeb1f88e707241d76e1e2a1a02dd81e6c2d77
19 changes: 13 additions & 6 deletions trunk/fs/ceph/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,29 @@ static long ceph_ioctl_set_layout(struct file *file, void __user *arg)

/* validate changed params against current layout */
err = ceph_do_getattr(file->f_dentry->d_inode, CEPH_STAT_CAP_LAYOUT);
if (!err) {
nl.stripe_unit = ceph_file_layout_su(ci->i_layout);
nl.stripe_count = ceph_file_layout_stripe_count(ci->i_layout);
nl.object_size = ceph_file_layout_object_size(ci->i_layout);
nl.data_pool = le32_to_cpu(ci->i_layout.fl_pg_pool);
} else
if (err)
return err;

memset(&nl, 0, sizeof(nl));
if (l.stripe_count)
nl.stripe_count = l.stripe_count;
else
nl.stripe_count = ceph_file_layout_stripe_count(ci->i_layout);
if (l.stripe_unit)
nl.stripe_unit = l.stripe_unit;
else
nl.stripe_unit = ceph_file_layout_su(ci->i_layout);
if (l.object_size)
nl.object_size = l.object_size;
else
nl.object_size = ceph_file_layout_object_size(ci->i_layout);
if (l.data_pool)
nl.data_pool = l.data_pool;
else
nl.data_pool = ceph_file_layout_pg_pool(ci->i_layout);

/* this is obsolete, and always -1 */
nl.preferred_osd = le64_to_cpu(-1);

err = __validate_layout(mdsc, &nl);
if (err)
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/ceph/ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
struct ceph_ioctl_layout {
__u64 stripe_unit, stripe_count, object_size;
__u64 data_pool;

/* obsolete. new values ignored, always return -1 */
__s64 preferred_osd;
};

Expand Down

0 comments on commit 1c8a980

Please sign in to comment.