[pnfs] [PATCH 16/20] 2.6-latest update nfs4_pnfs_dserver_get

William A. (Andy) Adamson andros at citi.umich.edu
Mon Dec 3 11:42:46 EST 2007


On 12/2/07, Dean Hildebrand <seattleplus at gmail.com> wrote:
>
>
> >
> > -     /* 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.


something to consider - i'm following benny's suggestion of not changing too
much,
just port forward.

this code will dramatically change as we move to draft-17 (18, 19??).

-->Andy

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.
> >
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://linux-nfs.org/pipermail/pnfs/attachments/20071203/84fc9aba/attachment.htm 


More information about the pNFS mailing list