Commit a99f1593 authored by Alexander Viro's avatar Alexander Viro Committed by Linus Torvalds

[PATCH] kdev_t crapectomy

	* 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.
parent 67addbac
......@@ -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.
......@@ -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;
......
......@@ -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.
*/
......
......@@ -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
......
......@@ -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 *);
......
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment