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.

ceph: pass the request to parse_reply_info_readdir()

Instead of passing just the r_reply_info to the readdir reply parser,
pass the request pointer directly instead. This will facilitate
implementing readdir on fscrypted directories.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-and-tested-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Milind Changire <mchangir@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

authored by

Xiubo Li and committed by
Ilya Dryomov
3859af9e 85529096

+13 -10
+13 -10
fs/ceph/mds_client.c
··· 407 407 * parse readdir results 408 408 */ 409 409 static int parse_reply_info_readdir(void **p, void *end, 410 - struct ceph_mds_reply_info_parsed *info, 411 - u64 features) 410 + struct ceph_mds_request *req, 411 + u64 features) 412 412 { 413 + struct ceph_mds_reply_info_parsed *info = &req->r_reply_info; 413 414 u32 num, i = 0; 414 415 int err; 415 416 ··· 652 651 * parse extra results 653 652 */ 654 653 static int parse_reply_info_extra(void **p, void *end, 655 - struct ceph_mds_reply_info_parsed *info, 654 + struct ceph_mds_request *req, 656 655 u64 features, struct ceph_mds_session *s) 657 656 { 657 + struct ceph_mds_reply_info_parsed *info = &req->r_reply_info; 658 658 u32 op = le32_to_cpu(info->head->op); 659 659 660 660 if (op == CEPH_MDS_OP_GETFILELOCK) 661 661 return parse_reply_info_filelock(p, end, info, features); 662 662 else if (op == CEPH_MDS_OP_READDIR || op == CEPH_MDS_OP_LSSNAP) 663 - return parse_reply_info_readdir(p, end, info, features); 663 + return parse_reply_info_readdir(p, end, req, features); 664 664 else if (op == CEPH_MDS_OP_CREATE) 665 665 return parse_reply_info_create(p, end, info, features, s); 666 666 else if (op == CEPH_MDS_OP_GETVXATTR) ··· 674 672 * parse entire mds reply 675 673 */ 676 674 static int parse_reply_info(struct ceph_mds_session *s, struct ceph_msg *msg, 677 - struct ceph_mds_reply_info_parsed *info, 678 - u64 features) 675 + struct ceph_mds_request *req, u64 features) 679 676 { 677 + struct ceph_mds_reply_info_parsed *info = &req->r_reply_info; 680 678 void *p, *end; 681 679 u32 len; 682 680 int err; ··· 698 696 ceph_decode_32_safe(&p, end, len, bad); 699 697 if (len > 0) { 700 698 ceph_decode_need(&p, end, len, bad); 701 - err = parse_reply_info_extra(&p, p+len, info, features, s); 699 + err = parse_reply_info_extra(&p, p+len, req, features, s); 702 700 if (err < 0) 703 701 goto out_bad; 704 702 } ··· 3600 3598 } 3601 3599 3602 3600 dout("handle_reply tid %lld result %d\n", tid, result); 3603 - rinfo = &req->r_reply_info; 3604 3601 if (test_bit(CEPHFS_FEATURE_REPLY_ENCODING, &session->s_features)) 3605 - err = parse_reply_info(session, msg, rinfo, (u64)-1); 3602 + err = parse_reply_info(session, msg, req, (u64)-1); 3606 3603 else 3607 - err = parse_reply_info(session, msg, rinfo, session->s_con.peer_features); 3604 + err = parse_reply_info(session, msg, req, 3605 + session->s_con.peer_features); 3608 3606 mutex_unlock(&mdsc->mutex); 3609 3607 3610 3608 /* Must find target inode outside of mutexes to avoid deadlocks */ 3609 + rinfo = &req->r_reply_info; 3611 3610 if ((err >= 0) && rinfo->head->is_target) { 3612 3611 struct inode *in = xchg(&req->r_new_inode, NULL); 3613 3612 struct ceph_vino tvino = {