Commit bb05e1aa authored by Alexander Viro's avatar Alexander Viro Committed by Andy Grover

[PATCH] bdevname() cleanups

Bunch of kdevname() uses replaced with bdevname().

__bdevname() switched from kdev_t to dev_t; callers updated.
parent 17d847a1
......@@ -87,7 +87,7 @@ static int linear_status(struct dm_target *ti, status_type_t type,
case STATUSTYPE_TABLE:
snprintf(result, maxlen, "%s " SECTOR_FORMAT,
kdevname(to_kdev_t(lc->dev->bdev->bd_dev)), lc->start);
bdevname(lc->dev->bdev), lc->start);
break;
}
return 0;
......
......@@ -221,7 +221,7 @@ static int stripe_status(struct dm_target *ti,
offset +=
snprintf(result + offset, maxlen - offset,
" %s " SECTOR_FORMAT,
kdevname(to_kdev_t(sc->stripe[i].dev->bdev->bd_dev)),
bdevname(sc->stripe[i].dev->bdev),
sc->stripe[i].physical_start);
}
break;
......
......@@ -783,14 +783,14 @@ int ioctl_by_bdev(struct block_device *bdev, unsigned cmd, unsigned long arg)
return res;
}
const char *__bdevname(kdev_t dev)
const char *__bdevname(dev_t dev)
{
static char buffer[32];
const char * name = blkdevs[major(dev)];
const char * name = blkdevs[MAJOR(dev)];
if (!name)
name = "unknown-block";
sprintf(buffer, "%s(%d,%d)", name, major(dev), minor(dev));
sprintf(buffer, "%s(%d,%d)", name, MAJOR(dev), MINOR(dev));
return buffer;
}
......@@ -77,13 +77,13 @@ EXPORT_SYMBOL(ext2_xattr_set);
#ifdef EXT2_XATTR_DEBUG
# define ea_idebug(inode, f...) do { \
printk(KERN_DEBUG "inode %s:%ld: ", \
kdevname(inode->i_dev), inode->i_ino); \
inode->i_sb->s_id, inode->i_ino); \
printk(f); \
printk("\n"); \
} while (0)
# define ea_bdebug(bh, f...) do { \
printk(KERN_DEBUG "block %s:%ld: ", \
kdevname(bh->b_dev), bh->b_blocknr); \
bdevname(bh->b_bdev), bh->b_blocknr); \
printk(f); \
printk("\n"); \
} while (0)
......
......@@ -308,12 +308,12 @@ void ext3_update_dynamic_rev(struct super_block *sb)
/*
* Open the external journal device
*/
static struct block_device *ext3_blkdev_get(kdev_t dev)
static struct block_device *ext3_blkdev_get(dev_t dev)
{
struct block_device *bdev;
int err = -ENODEV;
bdev = bdget(kdev_t_to_nr(dev));
bdev = bdget(dev);
if (bdev == NULL)
goto fail;
err = blkdev_get(bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_FS);
......@@ -1422,7 +1422,7 @@ static journal_t *ext3_get_journal(struct super_block *sb, int journal_inum)
}
static journal_t *ext3_get_dev_journal(struct super_block *sb,
kdev_t j_dev)
dev_t j_dev)
{
struct buffer_head * bh;
journal_t *journal;
......@@ -1508,7 +1508,7 @@ static int ext3_load_journal(struct super_block * sb,
{
journal_t *journal;
int journal_inum = le32_to_cpu(es->s_journal_inum);
kdev_t journal_dev = to_kdev_t(le32_to_cpu(es->s_journal_dev));
dev_t journal_dev = le32_to_cpu(es->s_journal_dev);
int err = 0;
int really_read_only;
......@@ -1534,7 +1534,7 @@ static int ext3_load_journal(struct super_block * sb,
}
}
if (journal_inum && !kdev_none(journal_dev)) {
if (journal_inum && journal_dev) {
printk(KERN_ERR "EXT3-fs: filesystem has both journal "
"and inode journals!\n");
return -EINVAL;
......
......@@ -73,13 +73,13 @@
#ifdef EXT3_XATTR_DEBUG
# define ea_idebug(inode, f...) do { \
printk(KERN_DEBUG "inode %s:%ld: ", \
kdevname(inode->i_dev), inode->i_ino); \
inode->i_sb->s_id, inode->i_ino); \
printk(f); \
printk("\n"); \
} while (0)
# define ea_bdebug(bh, f...) do { \
printk(KERN_DEBUG "block %s:%ld: ", \
kdevname(bh->b_dev), bh->b_blocknr); \
bdevname(bh->b_bdev), bh->b_blocknr); \
printk(f); \
printk("\n"); \
} while (0)
......
......@@ -1121,10 +1121,10 @@ extern void blk_run_queues(void);
extern int register_chrdev(unsigned int, const char *, struct file_operations *);
extern int unregister_chrdev(unsigned int, const char *);
extern int chrdev_open(struct inode *, struct file *);
extern const char *__bdevname(kdev_t);
extern const char *__bdevname(dev_t);
extern inline const char *bdevname(struct block_device *bdev)
{
return __bdevname(to_kdev_t(bdev->bd_dev));
return __bdevname(bdev->bd_dev);
}
extern const char * cdevname(kdev_t);
extern const char * kdevname(kdev_t);
......
......@@ -103,7 +103,7 @@ static int nr_copy_pages_check;
static int resume_status = 0;
static char resume_file[256] = ""; /* For resume= kernel option */
static kdev_t resume_device;
static dev_t resume_device;
/* Local variables that should not be affected by save */
unsigned int nr_copy_pages __nosavedata = 0;
......@@ -1143,13 +1143,13 @@ static int read_suspend_image(const char * specialfile, int noresume)
unsigned long scratch_page = 0;
int error;
resume_device = to_kdev_t(name_to_dev_t(specialfile));
resume_device = name_to_dev_t(specialfile);
scratch_page = get_zeroed_page(GFP_ATOMIC);
cur = (void *) scratch_page;
if (cur) {
struct block_device *bdev;
printk("Resuming from device %s\n", __bdevname(resume_device));
bdev = bdget(kdev_t_to_nr(resume_device));
bdev = bdget(resume_device);
if (!bdev) {
printk("No such block device ?!\n");
BUG();
......
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