diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/block_dev.c | 8 | ||||
| -rw-r--r-- | fs/ext3/super.c | 2 | ||||
| -rw-r--r-- | fs/partitions/efi.c | 4 | ||||
| -rw-r--r-- | fs/super.c | 2 |
4 files changed, 7 insertions, 9 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index cd8ecc79536c..2dba3c7f7039 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -53,10 +53,10 @@ static void kill_bdev(struct block_device *bdev) truncate_inode_pages(bdev->bd_inode->i_mapping, 0); } -int set_blocksize(kdev_t dev, int size) +int set_blocksize(struct block_device *bdev, int size) { int oldsize; - struct block_device *bdev; + kdev_t dev = to_kdev_t(bdev->bd_dev); /* Size must be a power of two, and between 512 and PAGE_SIZE */ if (size > PAGE_SIZE || size < 512 || (size & (size-1))) @@ -83,19 +83,17 @@ int set_blocksize(kdev_t dev, int size) } /* Ok, we're actually changing the blocksize.. */ - bdev = bdget(kdev_t_to_nr(dev)); sync_blockdev(bdev); blksize_size[major(dev)][minor(dev)] = size; bdev->bd_inode->i_blkbits = blksize_bits(size); kill_bdev(bdev); - bdput(bdev); return 0; } int sb_set_blocksize(struct super_block *sb, int size) { int bits; - if (set_blocksize(sb->s_dev, size) < 0) + if (set_blocksize(sb->s_bdev, size) < 0) return 0; sb->s_blocksize = size; for (bits = 9, size >>= 9; size >>= 1; bits++) diff --git a/fs/ext3/super.c b/fs/ext3/super.c index f5f2088c708e..043732f1ee41 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -1330,7 +1330,7 @@ static journal_t *ext3_get_dev_journal(struct super_block *sb, sb_block = EXT3_MIN_BLOCK_SIZE / blocksize; offset = EXT3_MIN_BLOCK_SIZE % blocksize; - set_blocksize(j_dev, blocksize); + set_blocksize(bdev, blocksize); if (!(bh = __bread(bdev, sb_block, blocksize))) { printk(KERN_ERR "EXT3-fs: couldn't read superblock of " "external journal\n"); diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c index 800a3e59e82f..612220d123c6 100644 --- a/fs/partitions/efi.c +++ b/fs/partitions/efi.c @@ -721,13 +721,13 @@ efi_partition(struct gendisk *hd, struct block_device *bdev, /* Need to change the block size that the block layer uses */ if (orig_blksize_size != hardblocksize) - set_blocksize(dev, hardblocksize); + set_blocksize(bdev, hardblocksize); rc = add_gpt_partitions(hd, bdev, first_part_minor); /* change back */ if (orig_blksize_size != hardblocksize) - set_blocksize(dev, orig_blksize_size); + set_blocksize(bdev, orig_blksize_size); return rc; } diff --git a/fs/super.c b/fs/super.c index b0a51d09e0ec..551788d588c0 100644 --- a/fs/super.c +++ b/fs/super.c @@ -540,7 +540,7 @@ void kill_block_super(struct super_block *sb) { struct block_device *bdev = sb->s_bdev; generic_shutdown_super(sb); - set_blocksize(to_kdev_t(bdev->bd_dev), sb->s_old_blocksize); + set_blocksize(bdev, sb->s_old_blocksize); bd_release(bdev); blkdev_put(bdev, BDEV_FS); } |
