+ nbp->b_rcred = vn->sc_cred; /* XXX crdup? */
+ nbp->b_wcred = vn->sc_cred; /* XXX crdup? */
+ nbp->b_dirtyoff = bp->b_dirtyoff;
+ nbp->b_dirtyend = bp->b_dirtyend;
+ nbp->b_validoff = bp->b_validoff;
+ nbp->b_validend = bp->b_validend;
+ /*
+ * If there was an error or a hole in the file...punt.
+ * Note that we deal with this after the nbp allocation.
+ * This ensures that we properly clean up any operations
+ * that we have already fired off.
+ *
+ * XXX we could deal with holes here but it would be
+ * a hassle (in the write case).
+ */
+ if (error) {
+ nbp->b_error = error;
+ nbp->b_flags |= B_ERROR;
+ bp->b_resid -= (resid - sz);
+ biodone(nbp);
+ return;
+ }