Commit 3e9e5d09 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] befs: LBD support

From: "Sergey S. Kostyliov" <rathamahata@php4.ru>

LBD patch merged long time ago, so it is safe to pass u64 block numbers to
sb_bread() when sector_t is large enough.
parent 7747d41e
......@@ -14,10 +14,7 @@
#define BEFS_VERSION "0.9.3"
/* Sector_t makes this sillyness obsolete */
typedef u64 befs_blocknr_t;
typedef u32 vfs_blocknr_t;
/*
* BeFS in memory structures
*/
......
......@@ -28,7 +28,6 @@ befs_bread_iaddr(struct super_block *sb, befs_inode_addr iaddr)
{
struct buffer_head *bh = NULL;
befs_blocknr_t block = 0;
vfs_blocknr_t vfs_block = 0;
befs_sb_info *befs_sb = BEFS_SB(sb);
befs_debug(sb, "---> Enter befs_read_iaddr() "
......@@ -42,17 +41,10 @@ befs_bread_iaddr(struct super_block *sb, befs_inode_addr iaddr)
}
block = iaddr2blockno(sb, &iaddr);
vfs_block = (vfs_blocknr_t) block;
if (vfs_block != block) {
befs_error(sb, "Error converting to host blocknr_t. %Lu "
"is larger than the host can use", block);
goto error;
}
befs_debug(sb, "befs_read_iaddr: offset = %lu", block);
bh = sb_bread(sb, vfs_block);
bh = sb_bread(sb, block);
if (bh == NULL) {
befs_error(sb, "Failed to read block %lu", block);
......@@ -71,20 +63,13 @@ struct buffer_head *
befs_bread(struct super_block *sb, befs_blocknr_t block)
{
struct buffer_head *bh = NULL;
vfs_blocknr_t vfs_block = (vfs_blocknr_t) block;
befs_debug(sb, "---> Enter befs_read() %Lu", block);
if (vfs_block != block) {
befs_error(sb, "Error converting to host blocknr_t. %Lu "
"is larger than the host can use", block);
goto error;
}
bh = sb_bread(sb, vfs_block);
bh = sb_bread(sb, block);
if (bh == NULL) {
befs_error(sb, "Failed to read block %lu", vfs_block);
befs_error(sb, "Failed to read block %lu", block);
goto error;
}
......
......@@ -856,6 +856,13 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
if (befs_check_sb(sb) != BEFS_OK)
goto unaquire_priv_sbp;
if( befs_sb->num_blocks > ~((sector_t)0) ) {
befs_error(sb, "blocks count: %Lu "
"is larger than the host can use",
befs_sb->num_blocks);
goto unaquire_priv_sbp;
}
/*
* set up enough so that it can read an inode
* Fill in kernel superblock fields from private sb
......
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