Commit 238358ed authored by Alexander Viro's avatar Alexander Viro Committed by David S. Miller

[PATCH] affs cleanup

	affs digs in blk_size[] to find the size of device (it
has its analog of superblock living in the middle of disk).  That
information is available in ->s_bdev->bd_inode->i_size - no need
to mess with major/minor/arrays to get it.
parent d6b7a72c
...@@ -270,9 +270,8 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -270,9 +270,8 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
struct buffer_head *root_bh = NULL; struct buffer_head *root_bh = NULL;
struct buffer_head *boot_bh; struct buffer_head *boot_bh;
struct inode *root_inode = NULL; struct inode *root_inode = NULL;
kdev_t dev = sb->s_dev;
s32 root_block; s32 root_block;
int blocks, size, blocksize; int size, blocksize;
u32 chksum; u32 chksum;
int num_bm; int num_bm;
int i, j; int i, j;
...@@ -308,12 +307,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -308,12 +307,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
* blocks, we will have to change it. * blocks, we will have to change it.
*/ */
blocks = blk_size[major(dev)] ? blk_size[major(dev)][minor(dev)] : 0; size = sb->s_bdev->bd_inode->i_size >> 9;
if (!blocks) {
printk(KERN_ERR "AFFS: Could not determine device size\n");
goto out_error;
}
size = (BLOCK_SIZE / 512) * blocks;
pr_debug("AFFS: initial blksize=%d, blocks=%d\n", 512, blocks); pr_debug("AFFS: initial blksize=%d, blocks=%d\n", 512, blocks);
affs_set_blocksize(sb, PAGE_SIZE); affs_set_blocksize(sb, PAGE_SIZE);
......
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