bwillwrite() is called in kern/sys_generic.c:dofilewrite()

bwillwrite() is meant as a quick stop before doing any vnode
ops to flush dirty buffers to prevent a deadlock.

However:
1) afaik only VNODES have backing buffers, so stalling socket/pipes
   doesn't gain us anything
2) writev() doesn't call bwillwrite()

shouldn't the code be changed like so:


Index: sys_generic.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/sys_generic.c,v
retrieving revision 1.65
diff -u -r1.65 sys_generic.c
--- sys_generic.c       2000/11/21 20:22:34     1.65
+++ sys_generic.c       2000/11/27 07:18:48
@@ -403,7 +403,8 @@
        }
 #endif
        cnt = nbyte;
-       bwillwrite();
+       if (fp->f_type == DTYPE_VNODE)
+               bwillwrite();
        if ((error = fo_write(fp, &auio, fp->f_cred, flags, p))) {
                if (auio.uio_resid != cnt && (error == ERESTART ||
                    error == EINTR || error == EWOULDBLOCK))
@@ -495,6 +496,8 @@
        }
 #endif
        cnt = auio.uio_resid;
+       if (fp->f_type == DTYPE_VNODE)
+               bwillwrite();
        if ((error = fo_write(fp, &auio, fp->f_cred, 0, p))) {
                if (auio.uio_resid != cnt && (error == ERESTART ||
                    error == EINTR || error == EWOULDBLOCK))


thanks,
-- 
-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to