lkml.org 
[lkml]   [1998]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Raw devices
Date
From
> All of that talk about device numbers, etc made me think about
> raw devices. Is anyone out there working on integrating raw
> character device drivers into the various drivers?

It isn't so much of RAW devices ( /dev/sda* are RAW ),
but them being UNBUFFERED. More so, that when a write(2)
returns, the data is committed to the disk.
(Not considering on what happens once SCSI-disk gets
the block to its buffers -- the SCSI operation has
returned ages ago before the data really makes it
into the platter -- many milliseconds...)

You could consider looking at execution paths - especially
with write() - when you open a device with O_SYNC flag.

> I am assuming that this would simply be another file_operation
> structure in each driver and code that would need to support character
> level operation. It would seem logical to me that one would need
> to implement raw I/O in each driver separately, since the VFS layer
> can only call the functions provided, if they are block functions,
> then that's it. You'd need functions which ignore the buffer
> cache, and work on a character basis vs block basis. Am I foolish
> to want to undertake adding raw device support? To those who
> are knowledgable in the ways of device drivers, does this seem
> like a large undertaking?

Nice theory, I would say. The buffer cache might benefit
from another flag telling that after the user has been given
the block, there is no benefit in keeping it in cache, so
that those who want to do all of the buffering in the
application can do so.

After that, it might be trivial to create new major devices
(or minors ?) that are "raw" in traditional sense, and just
set those O_SYNC and O_DISCARDAFTERREAD (or whatever) even
when user does not set them.

I mean, let buffer cache be there, just shortcut it at
places where it makes sense.

> Ok, dumb question (but I promise to grow from it!), is there a
> 'Todo' kind of list of things that need to be implemented, that
> one could take a stab at? If so, where can I obtain it.
>
> Thanks for listening to my speil.
>
> --Perry
> --
> Perry Harrington Linux rules all OSes. APSoft ()
> email: perry@apsoft.com Think Blue. /\

/Matti Aarnio <matti.aarnio@tele.fi>

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.035 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site