]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] kdev_t crapectomy
authorAlexander Viro <viro@math.psu.edu>
Thu, 4 Jul 2002 15:53:28 +0000 (08:53 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 4 Jul 2002 15:53:28 +0000 (08:53 -0700)
* since the last caller of is_read_only() is gone, the function
itself is removed.
* destroy_buffers() is not used anymore; gone.
* fsync_dev() is gone; the only user is (broken) lvm.c and first
step in fixing lvm.c will consist of propagating struct block_device *
anyway; at that point we'll just use fsync_bdev() in there.
* prototype of bio_ioctl() removed - function doesn't exist
anymore.

Documentation/filesystems/porting
drivers/block/ll_rw_blk.c
fs/buffer.c
include/linux/bio.h
include/linux/buffer_head.h
include/linux/fs.h
kernel/ksyms.c

index 85281b6f4ff0266f307af94c70c0b65492c40806..18daaaeb5d45a1d84c9cc8c7a76c042dca2f8bfc 100644 (file)
@@ -228,3 +228,21 @@ anything from oops to silent memory corruption.
        Use bdev_read_only(bdev) instead of is_read_only(kdev).  The latter
 is still alive, but only because of the mess in drivers/s390/block/dasd.c.
 As soon as it gets fixed is_read_only() will die.
+
+---
+[mandatory]
+
+       is_read_only() is gone; use bdev_read_only() instead.
+
+---
+[mandatory]
+
+       destroy_buffers() is gone; use invalidate_bdev().
+
+---
+[mandatory]
+
+       fsync_dev() is gone; use fsync_bdev().  NOTE: lvm breakage is
+deliberate; as soon as struct block_device * is propagated in a reasonable
+way by that code fixing will become trivial; until then nothing can be
+done.
index 318ff55529fbde2b58898e34952d7079364a0b09..c07fdf04013fbed4e169c923e9899ab4ec84ea67 100644 (file)
@@ -1212,21 +1212,19 @@ void blk_put_request(struct request *rq)
 
 static long ro_bits[MAX_BLKDEV][8];
 
-int is_read_only(kdev_t dev)
+int bdev_read_only(struct block_device *bdev)
 {
        int minor,major;
 
-       major = major(dev);
-       minor = minor(dev);
-       if (major < 0 || major >= MAX_BLKDEV) return 0;
+       if (!bdev)
+               return 0;
+       major = MAJOR(bdev->bd_dev);
+       minor = MINOR(bdev->bd_dev);
+       if (major < 0 || major >= MAX_BLKDEV)
+               return 0;
        return ro_bits[major][minor >> 5] & (1 << (minor & 31));
 }
 
-int bdev_read_only(struct block_device *bdev)
-{
-       return bdev && is_read_only(to_kdev_t(bdev->bd_dev));
-}
-
 void set_device_ro(kdev_t dev,int flag)
 {
        int minor,major;
index dde8e7d9bae6c1a2401184f3c4a771b49c7cf49f..02760245c84611238405d94c2e9a7ee8a3d67f82 100644 (file)
@@ -243,22 +243,6 @@ int fsync_bdev(struct block_device *bdev)
        return sync_blockdev(bdev);
 }
 
-/*
- * Write out and wait upon all dirty data associated with this
- * kdev_t.   Filesystem data as well as the underlying block
- * device.  Takes the superblock lock.
- */
-int fsync_dev(kdev_t dev)
-{
-       struct block_device *bdev = bdget(kdev_t_to_nr(dev));
-       if (bdev) {
-               int res = fsync_bdev(bdev);
-               bdput(bdev);
-               return res;
-       }
-       return 0;
-}
-
 /*
  * sync everything.
  */
index ffc38fca9c1e9b8db0d2a7fbcff5c3826d7e322e..1b4004652cde387bae6b4e96db6cf81a127a3a7b 100644 (file)
@@ -203,8 +203,6 @@ extern struct bio *bio_copy(struct bio *, int, int);
 
 extern inline void bio_init(struct bio *);
 
-extern int bio_ioctl(kdev_t, unsigned int, unsigned long);
-
 #ifdef CONFIG_HIGHMEM
 /*
  * remember to add offset! and never ever reenable interrupts between a
index 4fc6bab558257b310291ee625a55066f556de1e2..e0eb4119b2500faca47ec70ec63f9f7b82a9b2b1 100644 (file)
@@ -121,7 +121,6 @@ BUFFER_FNS(Boundary, boundary)
 #define page_has_buffers(page) PagePrivate(page)
 
 #define invalidate_buffers(dev)        __invalidate_buffers((dev), 0)
-#define destroy_buffers(dev)   __invalidate_buffers((dev), 1)
 
 
 /*
@@ -156,7 +155,6 @@ int sync_blockdev(struct block_device *bdev);
 void __wait_on_buffer(struct buffer_head *);
 void sleep_on_buffer(struct buffer_head *bh);
 void wake_up_buffer(struct buffer_head *bh);
-int fsync_dev(kdev_t);
 int fsync_bdev(struct block_device *);
 int fsync_super(struct super_block *);
 int fsync_no_super(struct block_device *);
index 322e644060cf5076a876b3212fb9288e64949fd9..1292fc4474ccbb899ed0e2403dc4e3dc2163188b 100644 (file)
@@ -1220,7 +1220,6 @@ extern void ll_rw_block(int, int, struct buffer_head * bh[]);
 extern int submit_bh(int, struct buffer_head *);
 struct bio;
 extern int submit_bio(int, struct bio *);
-extern int is_read_only(kdev_t);
 extern int bdev_read_only(struct block_device *);
 extern int set_blocksize(struct block_device *, int);
 extern int sb_set_blocksize(struct super_block *, int);
index cbf06ff3725b971356065458566654301694ab36..a128720c1b93affb4616cc3f16e350c9ada032ec 100644 (file)
@@ -185,7 +185,6 @@ EXPORT_SYMBOL(invalidate_inodes);
 EXPORT_SYMBOL(invalidate_device);
 EXPORT_SYMBOL(invalidate_inode_pages);
 EXPORT_SYMBOL(truncate_inode_pages);
-EXPORT_SYMBOL(fsync_dev);
 EXPORT_SYMBOL(fsync_bdev);
 EXPORT_SYMBOL(permission);
 EXPORT_SYMBOL(vfs_permission);
@@ -329,7 +328,6 @@ EXPORT_SYMBOL(tty_std_termios);
 /* block device driver support */
 EXPORT_SYMBOL(blk_size);
 EXPORT_SYMBOL(blk_dev);
-EXPORT_SYMBOL(is_read_only);
 EXPORT_SYMBOL(bdev_read_only);
 EXPORT_SYMBOL(set_device_ro);
 EXPORT_SYMBOL(bmap);