Lines Matching +full:num +full:- +full:addresses
50 nfs4_print_deviceid(&dsaddr->id_node.deviceid); in nfs4_fl_free_deviceid()
52 for (i = 0; i < dsaddr->ds_num; i++) { in nfs4_fl_free_deviceid()
53 ds = dsaddr->ds_list[i]; in nfs4_fl_free_deviceid()
57 kfree(dsaddr->stripe_indices); in nfs4_fl_free_deviceid()
67 u32 cnt, num; in nfs4_fl_alloc_deviceid_node() local
84 xdr_init_decode_pages(&stream, &buf, pdev->pages, pdev->pglen); in nfs4_fl_alloc_deviceid_node()
123 num = be32_to_cpup(p); in nfs4_fl_alloc_deviceid_node()
124 dprintk("%s ds_num %u\n", __func__, num); in nfs4_fl_alloc_deviceid_node()
125 if (num > NFS4_PNFS_MAX_MULTI_CNT) { in nfs4_fl_alloc_deviceid_node()
128 num, NFS4_PNFS_MAX_MULTI_CNT); in nfs4_fl_alloc_deviceid_node()
132 /* validate stripe indices are all < num */ in nfs4_fl_alloc_deviceid_node()
133 if (max_stripe_index >= num) { in nfs4_fl_alloc_deviceid_node()
134 printk(KERN_WARNING "NFS: %s: stripe index %u >= num ds %u\n", in nfs4_fl_alloc_deviceid_node()
135 __func__, max_stripe_index, num); in nfs4_fl_alloc_deviceid_node()
139 dsaddr = kzalloc(struct_size(dsaddr, ds_list, num), gfp_flags); in nfs4_fl_alloc_deviceid_node()
143 dsaddr->stripe_count = cnt; in nfs4_fl_alloc_deviceid_node()
144 dsaddr->stripe_indices = stripe_indices; in nfs4_fl_alloc_deviceid_node()
146 dsaddr->ds_num = num; in nfs4_fl_alloc_deviceid_node()
147 nfs4_init_deviceid_node(&dsaddr->id_node, server, &pdev->dev_id); in nfs4_fl_alloc_deviceid_node()
151 for (i = 0; i < dsaddr->ds_num; i++) { in nfs4_fl_alloc_deviceid_node()
161 da = nfs4_decode_mp_ds_addr(server->nfs_client->cl_net, in nfs4_fl_alloc_deviceid_node()
164 list_add_tail(&da->da_node, &dsaddrs); in nfs4_fl_alloc_deviceid_node()
167 dprintk("%s: no suitable DS addresses found\n", in nfs4_fl_alloc_deviceid_node()
172 dsaddr->ds_list[i] = nfs4_pnfs_ds_add(&dsaddrs, gfp_flags); in nfs4_fl_alloc_deviceid_node()
173 if (!dsaddr->ds_list[i]) in nfs4_fl_alloc_deviceid_node()
181 list_del_init(&da->da_node); in nfs4_fl_alloc_deviceid_node()
182 kfree(da->da_remotestr); in nfs4_fl_alloc_deviceid_node()
194 list_del_init(&da->da_node); in nfs4_fl_alloc_deviceid_node()
195 kfree(da->da_remotestr); in nfs4_fl_alloc_deviceid_node()
214 nfs4_put_deviceid_node(&dsaddr->id_node); in nfs4_fl_put_deviceid()
218 * Want res = (offset - layout->pattern_offset)/ layout->stripe_unit
219 * Then: ((res + fsi) % dsaddr->stripe_count)
227 tmp = offset - flseg->pattern_offset; in nfs4_fl_calc_j_index()
228 do_div(tmp, flseg->stripe_unit); in nfs4_fl_calc_j_index()
229 tmp += flseg->first_stripe_index; in nfs4_fl_calc_j_index()
230 return do_div(tmp, flseg->dsaddr->stripe_count); in nfs4_fl_calc_j_index()
236 return FILELAYOUT_LSEG(lseg)->dsaddr->stripe_indices[j]; in nfs4_fl_calc_ds_index()
245 if (flseg->stripe_type == STRIPE_SPARSE) { in nfs4_fl_select_ds_fh()
246 if (flseg->num_fh == 1) in nfs4_fl_select_ds_fh()
248 else if (flseg->num_fh == 0) in nfs4_fl_select_ds_fh()
255 return flseg->fh_array[i]; in nfs4_fl_select_ds_fh()
262 struct nfs4_file_layout_dsaddr *dsaddr = FILELAYOUT_LSEG(lseg)->dsaddr; in nfs4_fl_prepare_ds()
263 struct nfs4_pnfs_ds *ds = dsaddr->ds_list[ds_idx]; in nfs4_fl_prepare_ds()
266 struct nfs_server *s = NFS_SERVER(lseg->pls_layout->plh_inode); in nfs4_fl_prepare_ds()
276 if (ds->ds_clp) in nfs4_fl_prepare_ds()
281 s->nfs_client->cl_minorversion); in nfs4_fl_prepare_ds()
289 if (ret->ds_clp == NULL || in nfs4_fl_prepare_ds()