*BSD News Article 20485


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!doc.ic.ac.uk!uknet!mcsun!sztaki!news
From: pink@fsz.bme.hu (Szabolcs Sziget (PinkPanther))
Subject: Q on buffer cache
Message-ID: <CCxCy0.L78@sztaki.hu>
Sender: news@sztaki.hu (News system)
Reply-To: pink@fsz.bme.hu
Organization: Department of Process Control, Technical University of Budapest, HUNGARY
Date: Mon, 6 Sep 1993 08:58:47 GMT
Lines: 16

Hi,

I've got a nice question: i'm writing a device driver [for NetBSD 0.9], which can transform a regular file into a block device, hence lets one to mount a filesystem on a file. ( I know it's a kludge, mount should be able to do this.)
The problem is the following: this device transforms the strategy calls into
vn_rdwr() calls to fill the given buffer.(Doing file io from device driver is not nice!)  This works very well until the system runs out of buffers. Then the strategy tries to fill its buffer with the read, which won't return until it gets an empty buffer to read but there won't be empty buffer until strategy returns: DEADLOCK!
So, can anyone suggest a way to handle this, without changing other kernel parts. I feel it can't be done on driver level.

			Thanks.

---
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|  You are not expected to understand this. |  Szabolcs   Szigeti            |
|        - Ken Thompson in swtch() -        |  Internet: pink@fsz.bme.hu     |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-