17 static long ceph_ioctl_get_layout(
struct file *
file,
void __user *
arg)
29 l.preferred_osd = (
s32)-1;
52 for (i = 0; i < mdsc->
mdsmap->m_num_data_pg_pools; i++)
64 static long ceph_ioctl_set_layout(
struct file *file,
void __user *arg)
67 struct inode *parent_inode;
83 memset(&nl, 0,
sizeof(nl));
104 err = __validate_layout(mdsc, &nl);
127 ceph_mdsc_put_request(req);
137 static long ceph_ioctl_set_layout_policy (
struct file *file,
void __user *arg)
139 struct inode *inode = file->f_dentry->d_inode;
149 err = __validate_layout(mdsc, &l);
171 ceph_mdsc_put_request(req);
179 static long ceph_ioctl_get_dataloc(
struct file *file,
void __user *arg)
182 struct inode *inode = file->f_dentry->d_inode;
185 &ceph_sb_to_client(inode->
i_sb)->
client->osdc;
198 &
dl.object_no, &
dl.object_offset,
202 dl.file_offset -=
dl.object_offset;
207 tmp =
dl.object_offset;
210 snprintf(
dl.object_name,
sizeof(
dl.object_name),
"%llx.%08llx",
211 ceph_ino(inode),
dl.object_no);
219 ceph_osd_addr(osdc->
osdmap,
dl.osd);
234 static long ceph_ioctl_lazyio(
struct file *file)
237 struct inode *inode = file->f_dentry->d_inode;
246 dout(
"ioctl_layzio: file %p marked lazy\n", file);
250 dout(
"ioctl_layzio: file %p already lazy\n", file);
255 static long ceph_ioctl_syncio(
struct file *file)
265 dout(
"ioctl file %p cmd %u arg %lu\n", file, cmd, arg);
268 return ceph_ioctl_get_layout(file, (
void __user *)arg);
271 return ceph_ioctl_set_layout(file, (
void __user *)arg);
274 return ceph_ioctl_set_layout_policy(file, (
void __user *)arg);
277 return ceph_ioctl_get_dataloc(file, (
void __user *)arg);
280 return ceph_ioctl_lazyio(file);
283 return ceph_ioctl_syncio(file);