Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Nov 1995 12:05:28 +0000 ()
From:      Michael Smith <msmith@atrad.adelaide.edu.au>
To:        terry@lambert.org (Terry Lambert)
Cc:        msmith@atrad.adelaide.edu.au, hackers@freebsd.org
Subject:   Re: uio question...
Message-ID:  <199511301205.MAA13515@genesis.atrad.adelaide.edu.au>
In-Reply-To: <199511292105.OAA28617@phaeton.artisoft.com> from "Terry Lambert" at Nov 29, 95 02:05:44 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Terry Lambert stands accused of saying:
> > Given a device read function passed a uio struct, what's the correct way
> > to determine the total size of the read request?  
> 
> The "resid" is used to determine residual read remaining.  Typically,
> a uio struct will have an iovec count of one, or the alternate iovec's
> will be non-contiguous.
> 
> In either case , for a non-one iovec count in the uio, you *must* walk
> the iovec list to return any information.

I presume resid is computed elsewhere?  In this case, the 'asc' driver is 
broken, as it uses resid to determine the read size, at the very least.

> The question is whether your driver does scatter/gather itself, or whether
> it will be handling I/O one iovec at a time.

I'm quite happy to do scatter/gather myself, but my impressions from
uiomove() are that I'd still need a local buffer and then copyout(), so it
would appear to be more efficient overall to collect the entire read in 
a single local buffer, and the uiomove it out.

> You should look at the tty, generic (controller independent) scsi code,

Thanks for the pointers.

> 					Terry Lambert

-- 
]] Mike Smith, Software Engineer        msmith@atrad.adelaide.edu.au    [[
]] Genesis Software                     genesis@atrad.adelaide.edu.au   [[
]] High-speed data acquisition and      (GSM mobile) 041-122-496        [[
]] realtime instrument control          (ph/fax)  +61-8-267-3039        [[
]] "Who does BSD?" "We do Chucky, we do."                               [[



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199511301205.MAA13515>