[pnfs] [PATCH 16/20] 2.6-latest update nfs4_pnfs_dserver_get
Dean Hildebrand
seattleplus at gmail.com
Sun Dec 2 03:01:10 EST 2007
>
> - /* For debugging */
> tmp = offset + count - 1;
> do_div(tmp, layout->stripe_unit);
> - dbg_stripe_idx = do_div(tmp, layout->num_fh) + layout->first_stripe_index;
> + end_idx = do_div(tmp, di->stripe_count) + layout->first_stripe_index;
>
> - dprintk("%s: offset=%Lu, count=%u, si=%u, dsi=%u, "
> - "num_devs=%u, stripe_unit=%Lu\n",
> - __FUNCTION__,
> - offset, count, stripe_idx, dbg_stripe_idx, layout->num_fh,
> - layout->stripe_unit);
> + dprintk("%s: offset=%Lu, count=%Zu, si=%u, dsi=%u, "
> + "stripe_count=%u, stripe_unit=%Lu first_stripe_index %d\n",
> + __FUNCTION__,
> + offset, count, stripe_idx, end_idx, di->stripe_count,
> + layout->stripe_unit, layout->first_stripe_index);
>
> - BUG_ON(dbg_stripe_idx != stripe_idx);
> + BUG_ON(end_idx != stripe_idx);
>
Since we are going through the code, isn't a bug_on too harsh for this
error? Do we still want this debugging code? If so, maybe we should
make it just return an error.
Dean
>
> - /* TODO: rewrite this function!
> - dserver->dev = nfs4_pnfs_device_get(inode, layout->dev_id, stripe_idx);
> + dserver->dev = &di->stripe_devs[stripe_idx];
> if (dserver->dev == NULL)
> return 1;
> - */
> - dserver->fh = &layout->fh_array[stripe_idx];
> + if (layout->num_fh == 1)
> + dserver->fh = &layout->fh_array[0];
> + else
> + dserver->fh = &layout->fh_array[stripe_idx];
>
> - dprintk("%s: dev_id=%u, idx=%u, offset=%Lu, count=%u\n",
> - __FUNCTION__, layout->dev_id, stripe_idx, offset, count);
> + dprintk("%s: dev_id=%u, idx=%u, offset=%Lu, count=%Zu\n",
> + __FUNCTION__, layout->dev_id, stripe_idx, offset, count);
>
> return 0;
> +
> }
>
> /* Currently not used.
>
More information about the pNFS
mailing list