@@ -2126,6 +2126,7 @@ static bool drop_negative_children(struct dentry *dentry)
21262126 */
21272127static int trim_caps_cb (struct inode * inode , int mds , void * arg )
21282128{
2129+ struct ceph_mds_client * mdsc = ceph_sb_to_mdsc (inode -> i_sb );
21292130 int * remaining = arg ;
21302131 struct ceph_inode_info * ci = ceph_inode (inode );
21312132 int used , wanted , oissued , mine ;
@@ -2173,7 +2174,7 @@ static int trim_caps_cb(struct inode *inode, int mds, void *arg)
21732174
21742175 if (oissued ) {
21752176 /* we aren't the only cap.. just remove us */
2176- ceph_remove_cap (cap , true);
2177+ ceph_remove_cap (mdsc , cap , true);
21772178 (* remaining )-- ;
21782179 } else {
21792180 struct dentry * dentry ;
@@ -2588,6 +2589,7 @@ static u8 *get_fscrypt_altname(const struct ceph_mds_request *req, u32 *plen)
25882589
25892590/**
25902591 * ceph_mdsc_build_path - build a path string to a given dentry
2592+ * @mdsc: mds client
25912593 * @dentry: dentry to which path should be built
25922594 * @plen: returned length of string
25932595 * @pbase: returned base inode number
@@ -2607,8 +2609,8 @@ static u8 *get_fscrypt_altname(const struct ceph_mds_request *req, u32 *plen)
26072609 * Encode hidden .snap dirs as a double /, i.e.
26082610 * foo/.snap/bar -> foo//bar
26092611 */
2610- char * ceph_mdsc_build_path (struct dentry * dentry , int * plen , u64 * pbase ,
2611- int for_wire )
2612+ char * ceph_mdsc_build_path (struct ceph_mds_client * mdsc , struct dentry * dentry ,
2613+ int * plen , u64 * pbase , int for_wire )
26122614{
26132615 struct dentry * cur ;
26142616 struct inode * inode ;
@@ -2726,9 +2728,9 @@ char *ceph_mdsc_build_path(struct dentry *dentry, int *plen, u64 *pbase,
27262728 return path + pos ;
27272729}
27282730
2729- static int build_dentry_path (struct dentry * dentry , struct inode * dir ,
2730- const char * * ppath , int * ppathlen , u64 * pino ,
2731- bool * pfreepath , bool parent_locked )
2731+ static int build_dentry_path (struct ceph_mds_client * mdsc , struct dentry * dentry ,
2732+ struct inode * dir , const char * * ppath , int * ppathlen ,
2733+ u64 * pino , bool * pfreepath , bool parent_locked )
27322734{
27332735 char * path ;
27342736
@@ -2744,7 +2746,7 @@ static int build_dentry_path(struct dentry *dentry, struct inode *dir,
27442746 return 0 ;
27452747 }
27462748 rcu_read_unlock ();
2747- path = ceph_mdsc_build_path (dentry , ppathlen , pino , 1 );
2749+ path = ceph_mdsc_build_path (mdsc , dentry , ppathlen , pino , 1 );
27482750 if (IS_ERR (path ))
27492751 return PTR_ERR (path );
27502752 * ppath = path ;
@@ -2756,6 +2758,7 @@ static int build_inode_path(struct inode *inode,
27562758 const char * * ppath , int * ppathlen , u64 * pino ,
27572759 bool * pfreepath )
27582760{
2761+ struct ceph_mds_client * mdsc = ceph_sb_to_mdsc (inode -> i_sb );
27592762 struct dentry * dentry ;
27602763 char * path ;
27612764
@@ -2765,7 +2768,7 @@ static int build_inode_path(struct inode *inode,
27652768 return 0 ;
27662769 }
27672770 dentry = d_find_alias (inode );
2768- path = ceph_mdsc_build_path (dentry , ppathlen , pino , 1 );
2771+ path = ceph_mdsc_build_path (mdsc , dentry , ppathlen , pino , 1 );
27692772 dput (dentry );
27702773 if (IS_ERR (path ))
27712774 return PTR_ERR (path );
@@ -2778,10 +2781,11 @@ static int build_inode_path(struct inode *inode,
27782781 * request arguments may be specified via an inode *, a dentry *, or
27792782 * an explicit ino+path.
27802783 */
2781- static int set_request_path_attr (struct inode * rinode , struct dentry * rdentry ,
2782- struct inode * rdiri , const char * rpath ,
2783- u64 rino , const char * * ppath , int * pathlen ,
2784- u64 * ino , bool * freepath , bool parent_locked )
2784+ static int set_request_path_attr (struct ceph_mds_client * mdsc , struct inode * rinode ,
2785+ struct dentry * rdentry , struct inode * rdiri ,
2786+ const char * rpath , u64 rino , const char * * ppath ,
2787+ int * pathlen , u64 * ino , bool * freepath ,
2788+ bool parent_locked )
27852789{
27862790 int r = 0 ;
27872791
@@ -2790,7 +2794,7 @@ static int set_request_path_attr(struct inode *rinode, struct dentry *rdentry,
27902794 dout (" inode %p %llx.%llx\n" , rinode , ceph_ino (rinode ),
27912795 ceph_snap (rinode ));
27922796 } else if (rdentry ) {
2793- r = build_dentry_path (rdentry , rdiri , ppath , pathlen , ino ,
2797+ r = build_dentry_path (mdsc , rdentry , rdiri , ppath , pathlen , ino ,
27942798 freepath , parent_locked );
27952799 dout (" dentry %p %llx/%.*s\n" , rdentry , * ino , * pathlen ,
27962800 * ppath );
@@ -2877,7 +2881,7 @@ static struct ceph_msg *create_request_message(struct ceph_mds_session *session,
28772881 bool old_version = !test_bit (CEPHFS_FEATURE_32BITS_RETRY_FWD ,
28782882 & session -> s_features );
28792883
2880- ret = set_request_path_attr (req -> r_inode , req -> r_dentry ,
2884+ ret = set_request_path_attr (mdsc , req -> r_inode , req -> r_dentry ,
28812885 req -> r_parent , req -> r_path1 , req -> r_ino1 .ino ,
28822886 & path1 , & pathlen1 , & ino1 , & freepath1 ,
28832887 test_bit (CEPH_MDS_R_PARENT_LOCKED ,
@@ -2891,7 +2895,7 @@ static struct ceph_msg *create_request_message(struct ceph_mds_session *session,
28912895 if (req -> r_old_dentry &&
28922896 !(req -> r_old_dentry -> d_flags & DCACHE_DISCONNECTED ))
28932897 old_dentry = req -> r_old_dentry ;
2894- ret = set_request_path_attr (NULL , old_dentry ,
2898+ ret = set_request_path_attr (mdsc , NULL , old_dentry ,
28952899 req -> r_old_dentry_dir ,
28962900 req -> r_path2 , req -> r_ino2 .ino ,
28972901 & path2 , & pathlen2 , & ino2 , & freepath2 , true);
@@ -4290,6 +4294,7 @@ static struct dentry* d_find_primary(struct inode *inode)
42904294 */
42914295static int reconnect_caps_cb (struct inode * inode , int mds , void * arg )
42924296{
4297+ struct ceph_mds_client * mdsc = ceph_sb_to_mdsc (inode -> i_sb );
42934298 union {
42944299 struct ceph_mds_cap_reconnect v2 ;
42954300 struct ceph_mds_cap_reconnect_v1 v1 ;
@@ -4307,7 +4312,7 @@ static int reconnect_caps_cb(struct inode *inode, int mds, void *arg)
43074312 dentry = d_find_primary (inode );
43084313 if (dentry ) {
43094314 /* set pathbase to parent dir when msg_version >= 2 */
4310- path = ceph_mdsc_build_path (dentry , & pathlen , & pathbase ,
4315+ path = ceph_mdsc_build_path (mdsc , dentry , & pathlen , & pathbase ,
43114316 recon_state -> msg_version >= 2 );
43124317 dput (dentry );
43134318 if (IS_ERR (path )) {
@@ -5662,7 +5667,7 @@ void ceph_mdsc_handle_mdsmap(struct ceph_mds_client *mdsc, struct ceph_msg *msg)
56625667 return ;
56635668 }
56645669
5665- newmap = ceph_mdsmap_decode (& p , end , ceph_msgr2 (mdsc -> fsc -> client ));
5670+ newmap = ceph_mdsmap_decode (mdsc , & p , end , ceph_msgr2 (mdsc -> fsc -> client ));
56665671 if (IS_ERR (newmap )) {
56675672 err = PTR_ERR (newmap );
56685673 goto bad_unlock ;
0 commit comments