9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] convS2M improvement
@ 1997-10-24 18:02 beto
  0 siblings, 0 replies; only message in thread
From: beto @ 1997-10-24 18:02 UTC (permalink / raw)


Hi,

I've modified convS2M to avoid having to copy the
data during a read reply. The idea is to set the Fcall data
pointer to point to the right place within the
reply message.

ConvS2M starts doing it's data conversion and if the data
pointer is already pointing to the right place it bypasses
the copy.

	case Rread:
		SHORT(fid);
		SHORT(count);
		p++;	/* pad(1) */
		if (p != (uchar*)f->data) {
			STRING(data, f->count);
		} else
			p+=f->count;
		break;

The server needs to know the data offset for a read reply,
but some macro definitions will solve the problem.

	p->reply.data = (char *) p->rbp->wptr+8;

With this enhancement a 9P server does not have to copy
data for reads.

Has something like this been done to brazil/plan9?

P.S.
This is not scatter/gatther but it's so simple :-)





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-10-24 18:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-24 18:02 [9fans] convS2M improvement beto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).