if (!ds)
                goto out_failed;
 
-       ds_clnt = nfs4_ff_find_or_create_ds_client(lseg, idx, ds->ds_clp,
+       ds_clnt = nfs4_ff_find_or_create_ds_client(mirror, ds->ds_clp,
                                                   hdr->inode);
        if (IS_ERR(ds_clnt))
                goto out_failed;
        if (!ds)
                goto out_failed;
 
-       ds_clnt = nfs4_ff_find_or_create_ds_client(lseg, idx, ds->ds_clp,
+       ds_clnt = nfs4_ff_find_or_create_ds_client(mirror, ds->ds_clp,
                                                   hdr->inode);
        if (IS_ERR(ds_clnt))
                goto out_failed;
        if (!ds)
                goto out_err;
 
-       ds_clnt = nfs4_ff_find_or_create_ds_client(lseg, idx, ds->ds_clp,
+       ds_clnt = nfs4_ff_find_or_create_ds_client(mirror, ds->ds_clp,
                                                   data->inode);
        if (IS_ERR(ds_clnt))
                goto out_err;
 
                          bool fail_return);
 
 struct rpc_clnt *
-nfs4_ff_find_or_create_ds_client(struct pnfs_layout_segment *lseg,
-                                u32 ds_idx,
+nfs4_ff_find_or_create_ds_client(struct nfs4_ff_layout_mirror *mirror,
                                 struct nfs_client *ds_clp,
                                 struct inode *inode);
 const struct cred *ff_layout_get_ds_cred(struct pnfs_layout_segment *lseg,
 
 
 /**
  * nfs4_ff_find_or_create_ds_client - Find or create a DS rpc client
- * @lseg: pointer to layout segment
- * @ds_idx: mirror index
+ * @mirror: pointer to the mirror
  * @ds_clp: nfs_client for the DS
  * @inode: pointer to inode
  *
  * in the nfs_client cl_ds_clients list.
  */
 struct rpc_clnt *
-nfs4_ff_find_or_create_ds_client(struct pnfs_layout_segment *lseg, u32 ds_idx,
+nfs4_ff_find_or_create_ds_client(struct nfs4_ff_layout_mirror *mirror,
                                 struct nfs_client *ds_clp, struct inode *inode)
 {
-       struct nfs4_ff_layout_mirror *mirror = FF_LAYOUT_COMP(lseg, ds_idx);
-
        switch (mirror->mirror_ds->ds_versions[0].version) {
        case 3:
                /* For NFSv3 DS, flavor is set when creating DS connections */