Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 1998 20:41:41 -0700
From:      David Greenman <dg@root.com>
To:        msuarez@cybernet.com
Cc:        FreeBSD Hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: Kernel Programming Question 
Message-ID:  <199804290341.UAA27324@implode.root.com>
In-Reply-To: Your message of "Tue, 28 Apr 1998 15:35:13 EDT." <XFMail.980428153513.msuarez@cybernet.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
...
>             error=vn_rdwr(UIO_READ,imgp->vp,(void *) buf,PAGE_SIZE,offset,
>                           UIO_SYSSPACE,IO_NODELOCKED,p->p_ucred,&resid,p);
>             if(!error) 
>              {
>               int t=0;
>               if(resid) bzero((char *)buf+PAGE_SIZE-resid,resid);
>               for(t=0; t<PAGE_SIZE-resid; t++) sum+=buf[t];
                         ^^^^^^^^^^^^^^^^^

   Don't you want that to be:

              for(t=0; t < (resid ? resid : PAGE_SIZE); t++) sum+=buf[t];

? (Or perhaps something a bit more optimized)

   Otherwise, I don't see anything obviously wrong that would cause the
system to hang...but then, I have very little experiance using vn_rdwr(),
so I could easily be forgetting something.

-DG

David Greenman
Co-founder/Principal Architect, The FreeBSD Project

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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