public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] block_device_operations
@ 2000-05-16 21:12 Guangyu Fang
  2000-05-16 22:12 ` David Mosberger
  0 siblings, 1 reply; 2+ messages in thread
From: Guangyu Fang @ 2000-05-16 21:12 UTC (permalink / raw)
  To: linux-ia64

Hi,

I'm using TurboLinux 2.3.99-pre6-000501-18. Since <linux/fs.h> has the
following definition:

struct block_device_operations {
	int (*open) (struct inode *, struct file *);
	int (*release) (struct inode *, struct file *);
	int (*ioctl) (struct inode *, struct file *, unsigned, unsigned
long);
	int (*check_media_change) (kdev_t);
	int (*revalidate) (kdev_t);
};


Does it mean that block device can not do read/write operations? Is there
any work around?

Thanks.


Gary



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Linux-ia64] block_device_operations
  2000-05-16 21:12 [Linux-ia64] block_device_operations Guangyu Fang
@ 2000-05-16 22:12 ` David Mosberger
  0 siblings, 0 replies; 2+ messages in thread
From: David Mosberger @ 2000-05-16 22:12 UTC (permalink / raw)
  To: linux-ia64

>>>>> On Tue, 16 May 2000 14:12:32 -0700, Guangyu Fang <gfang@mylex.com> said:

  Gary> Hi, I'm using TurboLinux 2.3.99-pre6-000501-18. Since
  Gary> <linux/fs.h> has the following definition:

  Gary> struct block_device_operations { int (*open) (struct inode *,
  Gary> struct file *); int (*release) (struct inode *, struct file
  Gary> *); int (*ioctl) (struct inode *, struct file *, unsigned,
  Gary> unsigned long); int (*check_media_change) (kdev_t); int
  Gary> (*revalidate) (kdev_t); };

  Gary> Does it mean that block device can not do read/write
  Gary> operations? Is there any work around?

Yup, the Linux kernel developers recently discovered that they can get
an infinite speed up in disk read/write bandwidth by not doing the I/O
at all.  With gobs of memory, how needs disks anyhow? ;-)

Seriously though: I/O is done through I/O requests.  There is (at
least) one request queue per major device number.  The request
function is defined in <linux/blk.h>.  For example, drivers/ide/hd.c
does:

	blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST);

and if you look at blk.h, this will expand into:

	blk_init_queue(&blk-dev[MAJOR_NR].request_queue, do_hd_request);

Hope this resolves the mystery.

	--david



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-05-16 22:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-05-16 21:12 [Linux-ia64] block_device_operations Guangyu Fang
2000-05-16 22:12 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox