Lines Matching +full:xlen +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0
26 l.stripe_unit = ci->i_layout.stripe_unit; in ceph_ioctl_get_layout()
27 l.stripe_count = ci->i_layout.stripe_count; in ceph_ioctl_get_layout()
28 l.object_size = ci->i_layout.object_size; in ceph_ioctl_get_layout()
29 l.data_pool = ci->i_layout.pool_id; in ceph_ioctl_get_layout()
30 l.preferred_osd = -1; in ceph_ioctl_get_layout()
32 return -EFAULT; in ceph_ioctl_get_layout()
44 if ((l->object_size & ~PAGE_MASK) || in __validate_layout()
45 (l->stripe_unit & ~PAGE_MASK) || in __validate_layout()
46 ((unsigned)l->stripe_unit != 0 && in __validate_layout()
47 ((unsigned)l->object_size % (unsigned)l->stripe_unit))) in __validate_layout()
48 return -EINVAL; in __validate_layout()
51 mutex_lock(&mdsc->mutex); in __validate_layout()
52 err = -EINVAL; in __validate_layout()
53 for (i = 0; i < mdsc->mdsmap->m_num_data_pg_pools; i++) in __validate_layout()
54 if (mdsc->mdsmap->m_data_pg_pools[i] == l->data_pool) { in __validate_layout()
58 mutex_unlock(&mdsc->mutex); in __validate_layout()
68 struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; in ceph_ioctl_set_layout()
76 return -EFAULT; in ceph_ioctl_set_layout()
87 nl.stripe_count = ci->i_layout.stripe_count; in ceph_ioctl_set_layout()
91 nl.stripe_unit = ci->i_layout.stripe_unit; in ceph_ioctl_set_layout()
95 nl.object_size = ci->i_layout.object_size; in ceph_ioctl_set_layout()
99 nl.data_pool = ci->i_layout.pool_id; in ceph_ioctl_set_layout()
101 /* this is obsolete, and always -1 */ in ceph_ioctl_set_layout()
102 nl.preferred_osd = -1; in ceph_ioctl_set_layout()
112 req->r_inode = inode; in ceph_ioctl_set_layout()
114 req->r_num_caps = 1; in ceph_ioctl_set_layout()
116 req->r_inode_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_FILE_EXCL; in ceph_ioctl_set_layout()
118 req->r_args.setlayout.layout.fl_stripe_unit = in ceph_ioctl_set_layout()
120 req->r_args.setlayout.layout.fl_stripe_count = in ceph_ioctl_set_layout()
122 req->r_args.setlayout.layout.fl_object_size = in ceph_ioctl_set_layout()
124 req->r_args.setlayout.layout.fl_pg_pool = cpu_to_le32(l.data_pool); in ceph_ioctl_set_layout()
143 struct ceph_mds_client *mdsc = ceph_sb_to_fs_client(inode->i_sb)->mdsc; in ceph_ioctl_set_layout_policy()
147 return -EFAULT; in ceph_ioctl_set_layout_policy()
158 req->r_inode = inode; in ceph_ioctl_set_layout_policy()
160 req->r_num_caps = 1; in ceph_ioctl_set_layout_policy()
162 req->r_args.setlayout.layout.fl_stripe_unit = in ceph_ioctl_set_layout_policy()
164 req->r_args.setlayout.layout.fl_stripe_count = in ceph_ioctl_set_layout_policy()
166 req->r_args.setlayout.layout.fl_object_size = in ceph_ioctl_set_layout_policy()
168 req->r_args.setlayout.layout.fl_pg_pool = in ceph_ioctl_set_layout_policy()
186 &ceph_sb_to_fs_client(inode->i_sb)->client->osdc; in ceph_ioctl_get_dataloc()
189 u32 xlen; in ceph_ioctl_get_dataloc() local
196 return -EFAULT; in ceph_ioctl_get_dataloc()
198 down_read(&osdc->lock); in ceph_ioctl_get_dataloc()
199 ceph_calc_file_object_mapping(&ci->i_layout, dl.file_offset, 1, in ceph_ioctl_get_dataloc()
200 &dl.object_no, &dl.object_offset, &xlen); in ceph_ioctl_get_dataloc()
201 dl.file_offset -= dl.object_offset; in ceph_ioctl_get_dataloc()
202 dl.object_size = ci->i_layout.object_size; in ceph_ioctl_get_dataloc()
203 dl.block_size = ci->i_layout.stripe_unit; in ceph_ioctl_get_dataloc()
212 oloc.pool = ci->i_layout.pool_id; in ceph_ioctl_get_dataloc()
213 oloc.pool_ns = ceph_try_get_string(ci->i_layout.pool_ns); in ceph_ioctl_get_dataloc()
216 r = ceph_object_locator_to_pg(osdc->osdmap, &oid, &oloc, &pgid); in ceph_ioctl_get_dataloc()
220 up_read(&osdc->lock); in ceph_ioctl_get_dataloc()
224 dl.osd = ceph_pg_to_acting_primary(osdc->osdmap, &pgid); in ceph_ioctl_get_dataloc()
227 ceph_osd_addr(osdc->osdmap, dl.osd); in ceph_ioctl_get_dataloc()
229 memcpy(&dl.osd_addr, &a->in_addr, sizeof(dl.osd_addr)); in ceph_ioctl_get_dataloc()
233 up_read(&osdc->lock); in ceph_ioctl_get_dataloc()
237 return -EFAULT; in ceph_ioctl_get_dataloc()
244 struct ceph_file_info *fi = file->private_data; in ceph_ioctl_lazyio()
247 struct ceph_mds_client *mdsc = ceph_inode_to_fs_client(inode)->mdsc; in ceph_ioctl_lazyio()
248 struct ceph_client *cl = mdsc->fsc->client; in ceph_ioctl_lazyio()
250 if ((fi->fmode & CEPH_FILE_MODE_LAZY) == 0) { in ceph_ioctl_lazyio()
251 spin_lock(&ci->i_ceph_lock); in ceph_ioctl_lazyio()
252 fi->fmode |= CEPH_FILE_MODE_LAZY; in ceph_ioctl_lazyio()
253 ci->i_nr_by_mode[ffs(CEPH_FILE_MODE_LAZY)]++; in ceph_ioctl_lazyio()
254 __ceph_touch_fmode(ci, mdsc, fi->fmode); in ceph_ioctl_lazyio()
255 spin_unlock(&ci->i_ceph_lock); in ceph_ioctl_lazyio()
269 struct ceph_file_info *fi = file->private_data; in ceph_ioctl_syncio()
271 fi->flags |= CEPH_F_SYNC; in ceph_ioctl_syncio()
277 int i, ret = -EOPNOTSUPP; in vet_mds_for_fscrypt()
278 struct ceph_mds_client *mdsc = ceph_sb_to_mdsc(file_inode(file)->i_sb); in vet_mds_for_fscrypt()
280 mutex_lock(&mdsc->mutex); in vet_mds_for_fscrypt()
281 for (i = 0; i < mdsc->max_sessions; i++) { in vet_mds_for_fscrypt()
282 struct ceph_mds_session *s = mdsc->sessions[i]; in vet_mds_for_fscrypt()
286 if (test_bit(CEPHFS_FEATURE_ALTERNATE_NAME, &s->s_features)) in vet_mds_for_fscrypt()
290 mutex_unlock(&mdsc->mutex); in vet_mds_for_fscrypt()
301 if (ci->i_layout.stripe_count > 1) in ceph_set_encryption_policy()
302 return -EINVAL; in ceph_set_encryption_policy()
312 ret = ceph_get_caps(file, CEPH_CAP_FILE_SHARED, 0, -1, &got); in ceph_set_encryption_policy()
365 doutc(fsc->client, "file %p %p %llx.%llx cmd %s arg %lu\n", file, in ceph_ioctl()
424 return -ENOTTY; in ceph_ioctl()