Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ceph-for-6.13-rc1' of https://github.com/ceph/ceph-client

Pull ceph updates from Ilya Dryomov:
"A fix for the mount "device" string parser from Patrick and two cred
reference counting fixups from Max, marked for stable.

Also included a number of cleanups and a tweak to MAINTAINERS to avoid
unnecessarily CCing netdev list"

* tag 'ceph-for-6.13-rc1' of https://github.com/ceph/ceph-client:
ceph: fix cred leak in ceph_mds_check_access()
ceph: pass cred pointer to ceph_mds_auth_match()
ceph: improve caps debugging output
ceph: correct ceph_mds_cap_peer field name
ceph: correct ceph_mds_cap_item field name
ceph: miscellaneous spelling fixes
ceph: Use strscpy() instead of strcpy() in __get_snap_name()
ceph: Use str_true_false() helper in status_show()
ceph: requalify some char pointers as const
ceph: extract entity name from device id
MAINTAINERS: exclude net/ceph from networking
ceph: Remove fs/ceph deadcode
libceph: Remove unused ceph_crypto_key_encode
libceph: Remove unused ceph_osdc_watch_check
libceph: Remove unused pagevec functions
libceph: Remove unused ceph_pagelist functions

+65 -230
+1
MAINTAINERS
··· 16353 16353 X: net/9p/ 16354 16354 X: net/bluetooth/ 16355 16355 X: net/can/ 16356 + X: net/ceph/ 16356 16357 X: net/mac80211/ 16357 16358 X: net/rfkill/ 16358 16359 X: net/wireless/
+1 -1
fs/ceph/addr.c
··· 2195 2195 if (ci->i_vino.snap != CEPH_NOSNAP) { 2196 2196 /* 2197 2197 * Pool permission check needs to write to the first object. 2198 - * But for snapshot, head of the first object may have alread 2198 + * But for snapshot, head of the first object may have already 2199 2199 * been deleted. Skip check to avoid creating orphan object. 2200 2200 */ 2201 2201 return 0;
+24 -39
fs/ceph/caps.c
··· 978 978 return 0; 979 979 } 980 980 981 - int ceph_caps_revoking(struct ceph_inode_info *ci, int mask) 982 - { 983 - struct inode *inode = &ci->netfs.inode; 984 - struct ceph_client *cl = ceph_inode_to_client(inode); 985 - int ret; 986 - 987 - spin_lock(&ci->i_ceph_lock); 988 - ret = __ceph_caps_revoking_other(ci, NULL, mask); 989 - spin_unlock(&ci->i_ceph_lock); 990 - doutc(cl, "%p %llx.%llx %s = %d\n", inode, ceph_vinop(inode), 991 - ceph_cap_string(mask), ret); 992 - return ret; 993 - } 994 - 995 981 int __ceph_caps_used(struct ceph_inode_info *ci) 996 982 { 997 983 int used = 0; ··· 2799 2813 * requested from the MDS. 2800 2814 * 2801 2815 * Returns 0 if caps were not able to be acquired (yet), 1 if succeed, 2802 - * or a negative error code. There are 3 speical error codes: 2816 + * or a negative error code. There are 3 special error codes: 2803 2817 * -EAGAIN: need to sleep but non-blocking is specified 2804 2818 * -EFBIG: ask caller to call check_max_size() and try again. 2805 2819 * -EUCLEAN: ask caller to call ceph_renew_caps() and try again. ··· 4071 4085 struct ceph_cap *cap, *tcap, *new_cap = NULL; 4072 4086 struct ceph_inode_info *ci = ceph_inode(inode); 4073 4087 u64 t_cap_id; 4074 - unsigned mseq = le32_to_cpu(ex->migrate_seq); 4075 - unsigned t_seq, t_mseq; 4088 + u32 t_issue_seq, t_mseq; 4076 4089 int target, issued; 4077 4090 int mds = session->s_mds; 4078 4091 4079 4092 if (ph) { 4080 4093 t_cap_id = le64_to_cpu(ph->cap_id); 4081 - t_seq = le32_to_cpu(ph->seq); 4094 + t_issue_seq = le32_to_cpu(ph->issue_seq); 4082 4095 t_mseq = le32_to_cpu(ph->mseq); 4083 4096 target = le32_to_cpu(ph->mds); 4084 4097 } else { 4085 - t_cap_id = t_seq = t_mseq = 0; 4098 + t_cap_id = t_issue_seq = t_mseq = 0; 4086 4099 target = -1; 4087 4100 } 4088 4101 4089 - doutc(cl, "%p %llx.%llx ci %p mds%d mseq %d target %d\n", 4090 - inode, ceph_vinop(inode), ci, mds, mseq, target); 4102 + doutc(cl, " cap %llx.%llx export to peer %d piseq %u pmseq %u\n", 4103 + ceph_vinop(inode), target, t_issue_seq, t_mseq); 4091 4104 retry: 4092 4105 down_read(&mdsc->snap_rwsem); 4093 4106 spin_lock(&ci->i_ceph_lock); ··· 4119 4134 if (tcap) { 4120 4135 /* already have caps from the target */ 4121 4136 if (tcap->cap_id == t_cap_id && 4122 - ceph_seq_cmp(tcap->seq, t_seq) < 0) { 4137 + ceph_seq_cmp(tcap->seq, t_issue_seq) < 0) { 4123 4138 doutc(cl, " updating import cap %p mds%d\n", tcap, 4124 4139 target); 4125 4140 tcap->cap_id = t_cap_id; 4126 - tcap->seq = t_seq - 1; 4127 - tcap->issue_seq = t_seq - 1; 4141 + tcap->seq = t_issue_seq - 1; 4142 + tcap->issue_seq = t_issue_seq - 1; 4128 4143 tcap->issued |= issued; 4129 4144 tcap->implemented |= issued; 4130 4145 if (cap == ci->i_auth_cap) { ··· 4139 4154 int flag = (cap == ci->i_auth_cap) ? CEPH_CAP_FLAG_AUTH : 0; 4140 4155 tcap = new_cap; 4141 4156 ceph_add_cap(inode, tsession, t_cap_id, issued, 0, 4142 - t_seq - 1, t_mseq, (u64)-1, flag, &new_cap); 4157 + t_issue_seq - 1, t_mseq, (u64)-1, flag, &new_cap); 4143 4158 4144 4159 if (!list_empty(&ci->i_cap_flush_list) && 4145 4160 ci->i_auth_cap == tcap) { ··· 4213 4228 u64 realmino = le64_to_cpu(im->realm); 4214 4229 u64 cap_id = le64_to_cpu(im->cap_id); 4215 4230 u64 p_cap_id; 4231 + u32 piseq = 0; 4232 + u32 pmseq = 0; 4216 4233 int peer; 4217 4234 4218 4235 if (ph) { 4219 4236 p_cap_id = le64_to_cpu(ph->cap_id); 4220 4237 peer = le32_to_cpu(ph->mds); 4238 + piseq = le32_to_cpu(ph->issue_seq); 4239 + pmseq = le32_to_cpu(ph->mseq); 4221 4240 } else { 4222 4241 p_cap_id = 0; 4223 4242 peer = -1; 4224 4243 } 4225 4244 4226 - doutc(cl, "%p %llx.%llx ci %p mds%d mseq %d peer %d\n", 4227 - inode, ceph_vinop(inode), ci, mds, mseq, peer); 4245 + doutc(cl, " cap %llx.%llx import from peer %d piseq %u pmseq %u\n", 4246 + ceph_vinop(inode), peer, piseq, pmseq); 4228 4247 retry: 4229 4248 cap = __get_cap_for_mds(ci, mds); 4230 4249 if (!cap) { ··· 4257 4268 doutc(cl, " remove export cap %p mds%d flags %d\n", 4258 4269 ocap, peer, ph->flags); 4259 4270 if ((ph->flags & CEPH_CAP_FLAG_AUTH) && 4260 - (ocap->seq != le32_to_cpu(ph->seq) || 4261 - ocap->mseq != le32_to_cpu(ph->mseq))) { 4271 + (ocap->seq != piseq || 4272 + ocap->mseq != pmseq)) { 4262 4273 pr_err_ratelimited_client(cl, "mismatched seq/mseq: " 4263 4274 "%p %llx.%llx mds%d seq %d mseq %d" 4264 4275 " importer mds%d has peer seq %d mseq %d\n", 4265 4276 inode, ceph_vinop(inode), peer, 4266 - ocap->seq, ocap->mseq, mds, 4267 - le32_to_cpu(ph->seq), 4268 - le32_to_cpu(ph->mseq)); 4277 + ocap->seq, ocap->mseq, mds, piseq, pmseq); 4269 4278 } 4270 4279 ceph_remove_cap(mdsc, ocap, (ph->flags & CEPH_CAP_FLAG_RELEASE)); 4271 4280 } ··· 4337 4350 struct ceph_snap_realm *realm = NULL; 4338 4351 int op; 4339 4352 int msg_version = le16_to_cpu(msg->hdr.version); 4340 - u32 seq, mseq; 4353 + u32 seq, mseq, issue_seq; 4341 4354 struct ceph_vino vino; 4342 4355 void *snaptrace; 4343 4356 size_t snaptrace_len; ··· 4346 4359 bool queue_trunc; 4347 4360 bool close_sessions = false; 4348 4361 bool do_cap_release = false; 4349 - 4350 - doutc(cl, "from mds%d\n", session->s_mds); 4351 4362 4352 4363 if (!ceph_inc_mds_stopping_blocker(mdsc, session)) 4353 4364 return; ··· 4360 4375 vino.snap = CEPH_NOSNAP; 4361 4376 seq = le32_to_cpu(h->seq); 4362 4377 mseq = le32_to_cpu(h->migrate_seq); 4378 + issue_seq = le32_to_cpu(h->issue_seq); 4363 4379 4364 4380 snaptrace = h + 1; 4365 4381 snaptrace_len = le32_to_cpu(h->snap_trace_len); ··· 4448 4462 4449 4463 /* lookup ino */ 4450 4464 inode = ceph_find_inode(mdsc->fsc->sb, vino); 4451 - doutc(cl, " op %s ino %llx.%llx inode %p\n", ceph_cap_op_name(op), 4452 - vino.ino, vino.snap, inode); 4465 + doutc(cl, " caps mds%d op %s ino %llx.%llx inode %p seq %u iseq %u mseq %u\n", 4466 + session->s_mds, ceph_cap_op_name(op), vino.ino, vino.snap, inode, 4467 + seq, issue_seq, mseq); 4453 4468 4454 4469 mutex_lock(&session->s_mutex); 4455 - doutc(cl, " mds%d seq %lld cap seq %u\n", session->s_mds, 4456 - session->s_seq, (unsigned)seq); 4457 4470 4458 4471 if (!inode) { 4459 4472 doutc(cl, " i don't have ino %llx\n", vino.ino);
+1 -1
fs/ceph/crypto.h
··· 27 27 }; 28 28 29 29 /* 30 - * Header for the crypted file when truncating the size, this 30 + * Header for the encrypted file when truncating the size, this 31 31 * will be sent to MDS, and the MDS will update the encrypted 32 32 * last block and then truncate the size. 33 33 */
+1 -1
fs/ceph/debugfs.c
··· 357 357 358 358 seq_printf(s, "instance: %s.%lld %s/%u\n", ENTITY_NAME(inst->name), 359 359 ceph_pr_addr(client_addr), le32_to_cpu(client_addr->nonce)); 360 - seq_printf(s, "blocklisted: %s\n", fsc->blocklisted ? "true" : "false"); 360 + seq_printf(s, "blocklisted: %s\n", str_true_false(fsc->blocklisted)); 361 361 362 362 return 0; 363 363 }
+2 -2
fs/ceph/dir.c
··· 207 207 dentry = __dcache_find_get_entry(parent, idx + step, 208 208 &cache_ctl); 209 209 if (!dentry) { 210 - /* use linar search */ 210 + /* use linear search */ 211 211 idx = 0; 212 212 break; 213 213 } ··· 659 659 return true; 660 660 if (is_hash_order(new_pos)) { 661 661 /* no need to reset last_name for a forward seek when 662 - * dentries are sotred in hash order */ 662 + * dentries are sorted in hash order */ 663 663 } else if (dfi->frag != fpos_frag(new_pos)) { 664 664 return true; 665 665 }
+9 -3
fs/ceph/export.c
··· 393 393 } 394 394 dir = snapdir; 395 395 } 396 - /* If directory has already been deleted, futher get_parent 396 + /* If directory has already been deleted, further get_parent 397 397 * will fail. Do not mark snapdir dentry as disconnected, 398 - * this prevent exportfs from doing futher get_parent. */ 398 + * this prevents exportfs from doing further get_parent. */ 399 399 if (unlinked) 400 400 dn = d_obtain_root(dir); 401 401 else ··· 452 452 goto out; 453 453 if (ceph_snap(inode) == CEPH_SNAPDIR) { 454 454 if (ceph_snap(dir) == CEPH_NOSNAP) { 455 - strcpy(name, fsc->mount_options->snapdir_name); 455 + /* 456 + * .get_name() from struct export_operations 457 + * assumes that its 'name' parameter is pointing 458 + * to a NAME_MAX+1 sized buffer 459 + */ 460 + strscpy(name, fsc->mount_options->snapdir_name, 461 + NAME_MAX + 1); 456 462 err = 0; 457 463 } 458 464 goto out;
+1 -1
fs/ceph/inode.c
··· 160 160 } 161 161 162 162 /* 163 - * get/constuct snapdir inode for a given directory 163 + * get/construct snapdir inode for a given directory 164 164 */ 165 165 struct inode *ceph_get_snapdir(struct inode *parent) 166 166 {
+11 -16
fs/ceph/mds_client.c
··· 827 827 * And the worst case is that for the none async openc request it will 828 828 * successfully open the file if the CDentry hasn't been unlinked yet, 829 829 * but later the previous delayed async unlink request will remove the 830 - * CDenty. That means the just created file is possiblly deleted later 830 + * CDentry. That means the just created file is possibly deleted later 831 831 * by accident. 832 832 * 833 833 * We need to wait for the inflight async unlink requests to finish ··· 1747 1747 } 1748 1748 } 1749 1749 1750 - void ceph_mdsc_open_export_target_sessions(struct ceph_mds_client *mdsc, 1751 - struct ceph_mds_session *session) 1752 - { 1753 - mutex_lock(&mdsc->mutex); 1754 - __open_export_target_sessions(mdsc, session); 1755 - mutex_unlock(&mdsc->mutex); 1756 - } 1757 - 1758 1750 /* 1759 1751 * session caps 1760 1752 */ ··· 2354 2362 item->ino = cpu_to_le64(cap->cap_ino); 2355 2363 item->cap_id = cpu_to_le64(cap->cap_id); 2356 2364 item->migrate_seq = cpu_to_le32(cap->mseq); 2357 - item->seq = cpu_to_le32(cap->issue_seq); 2365 + item->issue_seq = cpu_to_le32(cap->issue_seq); 2358 2366 msg->front.iov_len += sizeof(*item); 2359 2367 2360 2368 ceph_put_cap(mdsc, cap); ··· 3261 3269 &session->s_features); 3262 3270 3263 3271 /* 3264 - * Avoid inifinite retrying after overflow. The client will 3272 + * Avoid infinite retrying after overflow. The client will 3265 3273 * increase the retry count and if the MDS is old version, 3266 3274 * so we limit to retry at most 256 times. 3267 3275 */ ··· 3514 3522 3515 3523 /* 3516 3524 * For async create we will choose the auth MDS of frag in parent 3517 - * directory to send the request and ususally this works fine, but 3525 + * directory to send the request and usually this works fine, but 3518 3526 * if the migrated the dirtory to another MDS before it could handle 3519 3527 * it the request will be forwarded. 3520 3528 * ··· 4025 4033 __unregister_request(mdsc, req); 4026 4034 } else if (fwd_seq <= req->r_num_fwd || (uint32_t)fwd_seq >= U32_MAX) { 4027 4035 /* 4028 - * Avoid inifinite retrying after overflow. 4036 + * Avoid infinite retrying after overflow. 4029 4037 * 4030 4038 * The MDS will increase the fwd count and in client side 4031 4039 * if the num_fwd is less than the one saved in request ··· 5601 5609 5602 5610 static int ceph_mds_auth_match(struct ceph_mds_client *mdsc, 5603 5611 struct ceph_mds_cap_auth *auth, 5612 + const struct cred *cred, 5604 5613 char *tpath) 5605 5614 { 5606 - const struct cred *cred = get_current_cred(); 5607 5615 u32 caller_uid = from_kuid(&init_user_ns, cred->fsuid); 5608 5616 u32 caller_gid = from_kgid(&init_user_ns, cred->fsgid); 5609 5617 struct ceph_client *cl = mdsc->fsc->client; ··· 5726 5734 for (i = 0; i < mdsc->s_cap_auths_num; i++) { 5727 5735 struct ceph_mds_cap_auth *s = &mdsc->s_cap_auths[i]; 5728 5736 5729 - err = ceph_mds_auth_match(mdsc, s, tpath); 5737 + err = ceph_mds_auth_match(mdsc, s, cred, tpath); 5730 5738 if (err < 0) { 5739 + put_cred(cred); 5731 5740 return err; 5732 5741 } else if (err > 0) { 5733 - /* always follow the last auth caps' permision */ 5742 + /* always follow the last auth caps' permission */ 5734 5743 root_squash_perms = true; 5735 5744 rw_perms_s = NULL; 5736 5745 if ((mask & MAY_WRITE) && s->writeable && ··· 5743 5750 rw_perms_s = s; 5744 5751 } 5745 5752 } 5753 + 5754 + put_cred(cred); 5746 5755 5747 5756 doutc(cl, "root_squash_perms %d, rw_perms_s %p\n", root_squash_perms, 5748 5757 rw_perms_s);
-2
fs/ceph/mds_client.h
··· 634 634 635 635 extern struct ceph_mds_session * 636 636 ceph_mdsc_open_export_target_session(struct ceph_mds_client *mdsc, int target); 637 - extern void ceph_mdsc_open_export_target_sessions(struct ceph_mds_client *mdsc, 638 - struct ceph_mds_session *session); 639 637 640 638 extern int ceph_trim_caps(struct ceph_mds_client *mdsc, 641 639 struct ceph_mds_session *session,
+10 -2
fs/ceph/super.c
··· 285 285 size_t len; 286 286 struct ceph_fsid fsid; 287 287 struct ceph_parse_opts_ctx *pctx = fc->fs_private; 288 + struct ceph_options *opts = pctx->copts; 288 289 struct ceph_mount_options *fsopt = pctx->opts; 289 - char *fsid_start, *fs_name_start; 290 + const char *name_start = dev_name; 291 + const char *fsid_start, *fs_name_start; 290 292 291 293 if (*dev_name_end != '=') { 292 294 dout("separator '=' missing in source"); ··· 298 296 fsid_start = strchr(dev_name, '@'); 299 297 if (!fsid_start) 300 298 return invalfc(fc, "missing cluster fsid"); 301 - ++fsid_start; /* start of cluster fsid */ 299 + len = fsid_start - name_start; 300 + kfree(opts->name); 301 + opts->name = kstrndup(name_start, len, GFP_KERNEL); 302 + if (!opts->name) 303 + return -ENOMEM; 304 + dout("using %s entity name", opts->name); 302 305 306 + ++fsid_start; /* start of cluster fsid */ 303 307 fs_name_start = strchr(fsid_start, '.'); 304 308 if (!fs_name_start) 305 309 return invalfc(fc, "missing file system name");
+1 -2
fs/ceph/super.h
··· 60 60 61 61 /* max size of osd read request, limited by libceph */ 62 62 #define CEPH_MAX_READ_SIZE CEPH_MSG_MAX_DATA_LEN 63 - /* osd has a configurable limitaion of max write size. 63 + /* osd has a configurable limitation of max write size. 64 64 * CEPH_MSG_MAX_DATA_LEN should be small enough. */ 65 65 #define CEPH_MAX_WRITE_SIZE CEPH_MSG_MAX_DATA_LEN 66 66 #define CEPH_RASIZE_DEFAULT (8192*1024) /* max readahead */ ··· 796 796 797 797 extern int __ceph_caps_revoking_other(struct ceph_inode_info *ci, 798 798 struct ceph_cap *ocap, int mask); 799 - extern int ceph_caps_revoking(struct ceph_inode_info *ci, int mask); 800 799 extern int __ceph_caps_used(struct ceph_inode_info *ci); 801 800 802 801 static inline bool __ceph_is_file_opened(struct ceph_inode_info *ci)
+1 -1
fs/ceph/xattr.c
··· 899 899 } 900 900 901 901 /* 902 - * If there are dirty xattrs, reencode xattrs into the prealloc_blob 902 + * If there are dirty xattrs, re-encode xattrs into the prealloc_blob 903 903 * and swap into place. It returns the old i_xattrs.blob (or NULL) so 904 904 * that it can be freed by the caller as the i_ceph_lock is likely to be 905 905 * held.
+2 -2
include/linux/ceph/ceph_fs.h
··· 808 808 809 809 struct ceph_mds_cap_peer { 810 810 __le64 cap_id; 811 - __le32 seq; 811 + __le32 issue_seq; 812 812 __le32 mseq; 813 813 __le32 mds; 814 814 __u8 flags; ··· 822 822 struct ceph_mds_cap_item { 823 823 __le64 ino; 824 824 __le64 cap_id; 825 - __le32 migrate_seq, seq; 825 + __le32 migrate_seq, issue_seq; 826 826 } __attribute__ ((packed)); 827 827 828 828 #define CEPH_MDS_LEASE_REVOKE 1 /* mds -> client */
-6
include/linux/ceph/libceph.h
··· 317 317 extern void ceph_put_page_vector(struct page **pages, int num_pages, 318 318 bool dirty); 319 319 extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags); 320 - extern int ceph_copy_user_to_page_vector(struct page **pages, 321 - const void __user *data, 322 - loff_t off, size_t len); 323 - extern void ceph_copy_to_page_vector(struct page **pages, 324 - const void *data, 325 - loff_t off, size_t len); 326 320 extern void ceph_copy_from_page_vector(struct page **pages, 327 321 void *data, 328 322 loff_t off, size_t len);
-2
include/linux/ceph/osd_client.h
··· 626 626 u32 timeout, 627 627 struct page ***preply_pages, 628 628 size_t *preply_len); 629 - int ceph_osdc_watch_check(struct ceph_osd_client *osdc, 630 - struct ceph_osd_linger_request *lreq); 631 629 int ceph_osdc_list_watchers(struct ceph_osd_client *osdc, 632 630 struct ceph_object_id *oid, 633 631 struct ceph_object_locator *oloc,
-12
include/linux/ceph/pagelist.h
··· 17 17 refcount_t refcnt; 18 18 }; 19 19 20 - struct ceph_pagelist_cursor { 21 - struct ceph_pagelist *pl; /* pagelist, for error checking */ 22 - struct list_head *page_lru; /* page in list */ 23 - size_t room; /* room remaining to reset to */ 24 - }; 25 - 26 20 struct ceph_pagelist *ceph_pagelist_alloc(gfp_t gfp_flags); 27 21 28 22 extern void ceph_pagelist_release(struct ceph_pagelist *pl); ··· 26 32 extern int ceph_pagelist_reserve(struct ceph_pagelist *pl, size_t space); 27 33 28 34 extern int ceph_pagelist_free_reserve(struct ceph_pagelist *pl); 29 - 30 - extern void ceph_pagelist_set_cursor(struct ceph_pagelist *pl, 31 - struct ceph_pagelist_cursor *c); 32 - 33 - extern int ceph_pagelist_truncate(struct ceph_pagelist *pl, 34 - struct ceph_pagelist_cursor *c); 35 35 36 36 static inline int ceph_pagelist_encode_64(struct ceph_pagelist *pl, u64 v) 37 37 {
-12
net/ceph/crypto.c
··· 74 74 return set_secret(dst, src->key); 75 75 } 76 76 77 - int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end) 78 - { 79 - if (*p + sizeof(u16) + sizeof(key->created) + 80 - sizeof(u16) + key->len > end) 81 - return -ERANGE; 82 - ceph_encode_16(p, key->type); 83 - ceph_encode_copy(p, &key->created, sizeof(key->created)); 84 - ceph_encode_16(p, key->len); 85 - ceph_encode_copy(p, key->key, key->len); 86 - return 0; 87 - } 88 - 89 77 int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end) 90 78 { 91 79 int ret;
-1
net/ceph/crypto.h
··· 21 21 22 22 int ceph_crypto_key_clone(struct ceph_crypto_key *dst, 23 23 const struct ceph_crypto_key *src); 24 - int ceph_crypto_key_encode(struct ceph_crypto_key *key, void **p, void *end); 25 24 int ceph_crypto_key_decode(struct ceph_crypto_key *key, void **p, void *end); 26 25 int ceph_crypto_key_unarmor(struct ceph_crypto_key *key, const char *in); 27 26 void ceph_crypto_key_destroy(struct ceph_crypto_key *key);
-34
net/ceph/osd_client.c
··· 4999 4999 } 5000 5000 EXPORT_SYMBOL(ceph_osdc_notify); 5001 5001 5002 - /* 5003 - * Return the number of milliseconds since the watch was last 5004 - * confirmed, or an error. If there is an error, the watch is no 5005 - * longer valid, and should be destroyed with ceph_osdc_unwatch(). 5006 - */ 5007 - int ceph_osdc_watch_check(struct ceph_osd_client *osdc, 5008 - struct ceph_osd_linger_request *lreq) 5009 - { 5010 - unsigned long stamp, age; 5011 - int ret; 5012 - 5013 - down_read(&osdc->lock); 5014 - mutex_lock(&lreq->lock); 5015 - stamp = lreq->watch_valid_thru; 5016 - if (!list_empty(&lreq->pending_lworks)) { 5017 - struct linger_work *lwork = 5018 - list_first_entry(&lreq->pending_lworks, 5019 - struct linger_work, 5020 - pending_item); 5021 - 5022 - if (time_before(lwork->queued_stamp, stamp)) 5023 - stamp = lwork->queued_stamp; 5024 - } 5025 - age = jiffies - stamp; 5026 - dout("%s lreq %p linger_id %llu age %lu last_error %d\n", __func__, 5027 - lreq, lreq->linger_id, age, lreq->last_error); 5028 - /* we are truncating to msecs, so return a safe upper bound */ 5029 - ret = lreq->last_error ?: 1 + jiffies_to_msecs(age); 5030 - 5031 - mutex_unlock(&lreq->lock); 5032 - up_read(&osdc->lock); 5033 - return ret; 5034 - } 5035 - 5036 5002 static int decode_watcher(void **p, void *end, struct ceph_watch_item *item) 5037 5003 { 5038 5004 u8 struct_v;
-38
net/ceph/pagelist.c
··· 131 131 return 0; 132 132 } 133 133 EXPORT_SYMBOL(ceph_pagelist_free_reserve); 134 - 135 - /* Create a truncation point. */ 136 - void ceph_pagelist_set_cursor(struct ceph_pagelist *pl, 137 - struct ceph_pagelist_cursor *c) 138 - { 139 - c->pl = pl; 140 - c->page_lru = pl->head.prev; 141 - c->room = pl->room; 142 - } 143 - EXPORT_SYMBOL(ceph_pagelist_set_cursor); 144 - 145 - /* Truncate a pagelist to the given point. Move extra pages to reserve. 146 - * This won't sleep. 147 - * Returns: 0 on success, 148 - * -EINVAL if the pagelist doesn't match the trunc point pagelist 149 - */ 150 - int ceph_pagelist_truncate(struct ceph_pagelist *pl, 151 - struct ceph_pagelist_cursor *c) 152 - { 153 - struct page *page; 154 - 155 - if (pl != c->pl) 156 - return -EINVAL; 157 - ceph_pagelist_unmap_tail(pl); 158 - while (pl->head.prev != c->page_lru) { 159 - page = list_entry(pl->head.prev, struct page, lru); 160 - /* move from pagelist to reserve */ 161 - list_move_tail(&page->lru, &pl->free_list); 162 - ++pl->num_pages_free; 163 - } 164 - pl->room = c->room; 165 - if (!list_empty(&pl->head)) { 166 - page = list_entry(pl->head.prev, struct page, lru); 167 - pl->mapped_tail = kmap(page); 168 - } 169 - return 0; 170 - } 171 - EXPORT_SYMBOL(ceph_pagelist_truncate);
-52
net/ceph/pagevec.c
··· 55 55 } 56 56 EXPORT_SYMBOL(ceph_alloc_page_vector); 57 57 58 - /* 59 - * copy user data into a page vector 60 - */ 61 - int ceph_copy_user_to_page_vector(struct page **pages, 62 - const void __user *data, 63 - loff_t off, size_t len) 64 - { 65 - int i = 0; 66 - int po = off & ~PAGE_MASK; 67 - int left = len; 68 - int l, bad; 69 - 70 - while (left > 0) { 71 - l = min_t(int, PAGE_SIZE-po, left); 72 - bad = copy_from_user(page_address(pages[i]) + po, data, l); 73 - if (bad == l) 74 - return -EFAULT; 75 - data += l - bad; 76 - left -= l - bad; 77 - po += l - bad; 78 - if (po == PAGE_SIZE) { 79 - po = 0; 80 - i++; 81 - } 82 - } 83 - return len; 84 - } 85 - EXPORT_SYMBOL(ceph_copy_user_to_page_vector); 86 - 87 - void ceph_copy_to_page_vector(struct page **pages, 88 - const void *data, 89 - loff_t off, size_t len) 90 - { 91 - int i = 0; 92 - size_t po = off & ~PAGE_MASK; 93 - size_t left = len; 94 - 95 - while (left > 0) { 96 - size_t l = min_t(size_t, PAGE_SIZE-po, left); 97 - 98 - memcpy(page_address(pages[i]) + po, data, l); 99 - data += l; 100 - left -= l; 101 - po += l; 102 - if (po == PAGE_SIZE) { 103 - po = 0; 104 - i++; 105 - } 106 - } 107 - } 108 - EXPORT_SYMBOL(ceph_copy_to_page_vector); 109 - 110 58 void ceph_copy_from_page_vector(struct page **pages, 111 59 void *data, 112 60 loff_t off, size_t len)