]> git.hungrycats.org Git - linux/commit
[PATCH] bdev: open() changes
authorAndrew Morton <akpm@osdl.org>
Mon, 19 Jan 2004 02:05:49 +0000 (18:05 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Mon, 19 Jan 2004 02:05:49 +0000 (18:05 -0800)
commita1864a759aed0fe75c9d117a3f6500c030f959ed
tree3ff6895f36985b5c7dd74d6e0ce891cfe65e442e
parent26dd5cfe5f2ea8d859da88df4d106aeaa192b970
[PATCH] bdev: open() changes

The first of a series which move us toward blockdev hotplug support.  After
these we have achieved the following:

a) For "normal" (not bdevfs) inodes of block devices we never look at
   ->i_mapping.

b) For the same inodes we only look at ->i_bdev in bd_acquire() where it's
   used only as "here's what we'd found the last time" sort of cached value.
   If it's NULL, we just recalculate it.

c) Lots of messy expressions had been trimmed down, while we are at it.

(a) and (b) allow us to start doing proper block hotplug - we can destroy the
association between inode and bdev at any time, unhash bdev in question and
have new open() do everything from scratch, without waiting for old opened
files to close.  The goal is to be able to say "revoke everything over that
gendisk"/"revoke that partition" and have it do the right thing.

This patch:

Where the old code called (block device) ->open(inode, file), use
->open(inode->i_bdev->bd_inode, file).  Changes in drivers:

* none to those that only used inode->i_bdev and inode->i_rdev in their
  ->open() (bdev->bd_inode->i_bdev == bdev, so we are OK)

* floppy.c and floppy98.c used to call permission(inode, ...) in
  floppy_open().  Switched to permission(file->f_dentry->d_inode, ...)
drivers/block/floppy.c
drivers/block/floppy98.c
fs/block_dev.c