[lkml]   [2001]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] struct char_device

On Tue, 22 May 2001 wrote:

> One remark, repeating what I wrote on some web page:
> -----
> A struct block_device provides the connection between a device number
> and a struct block_device_operations.
> ...
> Clearly, we also want to associate a struct char_device_operations
> to a character device number. When we do this, all bdev code will

They are entirely different. Too different sets of operations.

> have to be duplicated for cdev, so there seems no point in having
> bdev code - kdev, for both bdev and cdev, seems more elegant.
> -----

Not really. For struct block_device you have partitioning stuff sitting
nearby. It should be handled by generic code. Nothing of that kind for
character devices.

But the main point is that for block devices ->read() and ->write() do
not belong to the natural interface. Request queue does. They are about
as far from each other as from FIFOs and sockets.

> And a second remark: don't forget that presently the point where
> bdev is introduced is not quite right. We must only introduce it
> when we really have a device, not when there only is a device
> number (like on a mknod call).

That's simply wrong. kdev_t is used for unopened objects quite often.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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