supported by this driver, and for further information on the use of
this driver.
+CONFIG_LBD
+ Say Y here if you want to attach large (bigger than 2TB) discs to
+ your machine, or if you want to have a raid or loopback device
+ bigger than 2TB. Otherwise say N.
fi
dep_bool ' Initial RAM disk (initrd) support' CONFIG_BLK_DEV_INITRD $CONFIG_BLK_DEV_RAM
+if [ "$CONFIG_X86" = "y" -o "$CONFIG_PPC32" = "y" ]; then
+ bool 'Support for Large Block Devices' CONFIG_LBD
+fi
endmenu
else {
if (pf->media_status == PF_RO)
printk(", RO");
- printk(", %ld blocks\n", get_capacity(pf->disk));
+ printk(", %llu blocks\n",
+ (unsigned long long)get_capacity(pf->disk));
}
return 0;
}
/*
* idefloppy_do_request is our request handling function.
*/
-static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request *rq, unsigned long block)
+static ide_startstop_t idefloppy_do_request (ide_drive_t *drive, struct request *rq, sector_t block_s)
{
idefloppy_floppy_t *floppy = drive->driver_data;
idefloppy_pc_t *pc;
+ unsigned long block = (unsigned long)block_s;
#if IDEFLOPPY_DEBUG_LOG
printk(KERN_INFO "rq_status: %d, rq_dev: %u, flags: %lx, errors: %d\n",
rq->rq_status, (unsigned int) rq->rq_dev,
rq->flags, rq->errors);
printk(KERN_INFO "sector: %ld, nr_sectors: %ld, "
- "current_nr_sectors: %ld\n", rq->sector,
+ "current_nr_sectors: %ld\n", (long)rq->sector,
rq->nr_sectors, rq->current_nr_sectors);
#endif /* IDEFLOPPY_DEBUG_LOG */
int err;
int sectornr, sectors, i;
struct kiobuf *iobuf;
- unsigned long *blocks;
+ sector_t *blocks;
if(!rawdevice) {
printk("blkmtd: readpage: PANIC file->private_data == NULL\n");
/* Pre 2.4.4 doesn't have space for the block list in the kiobuf */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,4)
- blocks = kmalloc(KIO_MAX_SECTORS * sizeof(unsigned long));
+ blocks = kmalloc(KIO_MAX_SECTORS * sizeof(*blocks));
if(blocks == NULL) {
printk("blkmtd: cant allocate iobuf blocks\n");
free_kiovec(1, &iobuf);
int err;
struct task_struct *tsk = current;
struct kiobuf *iobuf;
- unsigned long *blocks;
+ sector_t *blocks;
DECLARE_WAITQUEUE(wait, tsk);
DEBUG(1, "blkmtd: writetask: starting (pid = %d)\n", tsk->pid);
&ADFS_I(page->mapping->host)->mmu_private);
}
-static int _adfs_bmap(struct address_space *mapping, long block)
+static sector_t _adfs_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping, block, adfs_get_block);
}
struct buffer_head *ext_bh;
u32 ext;
- pr_debug("AFFS: get_block(%u, %ld)\n", (u32)inode->i_ino, block);
+ pr_debug("AFFS: get_block(%u, %lu)\n", (u32)inode->i_ino, (unsigned long)block);
- if (block < 0)
- goto err_small;
+
+ if (block > (sector_t)0x7fffffffUL)
+ BUG();
if (block >= AFFS_I(inode)->i_blkcnt) {
if (block > AFFS_I(inode)->i_blkcnt || !create)
//lock cache
affs_lock_ext(inode);
- ext = block / AFFS_SB(sb)->s_hashsize;
+ ext = (u32)block / AFFS_SB(sb)->s_hashsize;
block -= ext * AFFS_SB(sb)->s_hashsize;
ext_bh = affs_get_extblock(inode, ext);
if (IS_ERR(ext_bh))
goto err_ext;
- map_bh(bh_result, sb, be32_to_cpu(AFFS_BLOCK(sb, ext_bh, block)));
+ map_bh(bh_result, sb, (sector_t)be32_to_cpu(AFFS_BLOCK(sb, ext_bh, block)));
if (create) {
u32 blocknr = affs_alloc_block(inode, ext_bh->b_blocknr);
return cont_prepare_write(page, from, to, affs_get_block,
&AFFS_I(page->mapping->host)->mmu_private);
}
-static int _affs_bmap(struct address_space *mapping, long block)
+static sector_t _affs_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,affs_get_block);
}
}
affs_fix_checksum(sb, bh);
mark_buffer_dirty_inode(bh, inode);
- dentry->d_fsdata = (void *)bh->b_blocknr;
+ dentry->d_fsdata = (void *)(long)bh->b_blocknr;
affs_lock_dir(dir);
retval = affs_insert_hash(dir, bh);
return block_prepare_write(page, from, to, bfs_get_block);
}
-static int bfs_bmap(struct address_space *mapping, long block)
+static sector_t bfs_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping, block, bfs_get_block);
}
unsigned from, unsigned to, get_block_t *get_block)
{
unsigned block_start, block_end;
- unsigned long block;
+ sector_t block;
int err = 0;
unsigned blocksize, bbits;
struct buffer_head *bh, *head, *wait[2], **wait_bh=wait;
head = page_buffers(page);
bbits = inode->i_blkbits;
- block = page->index << (PAGE_CACHE_SHIFT - bbits);
+ block = (sector_t)page->index << (PAGE_CACHE_SHIFT - bbits);
for(bh = head, block_start = 0; bh != head || !block_start;
block++, block_start=block_end, bh = bh->b_this_page) {
int block_read_full_page(struct page *page, get_block_t *get_block)
{
struct inode *inode = page->mapping->host;
- unsigned long iblock, lblock;
+ sector_t iblock, lblock;
struct buffer_head *bh, *head, *arr[MAX_BUF_PER_PAGE];
unsigned int blocksize, blocks;
int nr, i;
head = page_buffers(page);
blocks = PAGE_CACHE_SIZE >> inode->i_blkbits;
- iblock = page->index << (PAGE_CACHE_SHIFT - inode->i_blkbits);
+ iblock = (sector_t)page->index << (PAGE_CACHE_SHIFT - inode->i_blkbits);
lblock = (inode->i_size+blocksize-1) >> inode->i_blkbits;
bh = head;
nr = 0;
{
return block_read_full_page(page,efs_get_block);
}
-static int _efs_bmap(struct address_space *mapping, long block)
+static sector_t _efs_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,efs_get_block);
}
return block_prepare_write(page,from,to,ext2_get_block);
}
-static int ext2_bmap(struct address_space *mapping, long block)
+static sector_t ext2_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,ext2_get_block);
}
!(inode = iget(sb, ino)) || is_bad_inode(inode) ||
NEXT_ORPHAN(inode) > max_ino) {
ext3_warning(sb, __FUNCTION__,
- "bad orphan inode %lu! e2fsck was run?\n", ino);
+ "bad orphan inode %lu! e2fsck was run?\n", (unsigned long)ino);
printk(KERN_NOTICE "ext3_test_bit(bit=%d, block=%llu) = %d\n",
bit,
(unsigned long long)bitmap_bh->b_blocknr,
* So, if we see any bmap calls here on a modified, data-journaled file,
* take extra steps to flush any blocks which might be in the cache.
*/
-static int ext3_bmap(struct address_space *mapping, long block)
+static sector_t ext3_bmap(struct address_space *mapping, sector_t block)
{
struct inode *inode = mapping->host;
journal_t *journal;
BUG();
return -EIO;
}
- if (!(iblock % MSDOS_SB(sb)->cluster_size)) {
+ if (!((unsigned long)iblock % MSDOS_SB(sb)->cluster_size)) {
int error;
error = fat_add_cluster(inode);
return generic_commit_write(file, page, from, to);
}
-static int _fat_bmap(struct address_space *mapping, long block)
+static sector_t _fat_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,fat_get_block);
}
static int vxfs_readpage(struct file *, struct page *);
-static int vxfs_bmap(struct address_space *, long);
+static sector_t vxfs_bmap(struct address_space *, sector_t);
struct address_space_operations vxfs_aops = {
.readpage = vxfs_readpage,
* Locking status:
* We are under the bkl.
*/
-static int
-vxfs_bmap(struct address_space *mapping, long block)
+static sector_t
+vxfs_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping, block, vxfs_getblk);
}
return cont_prepare_write(page,from,to,hfs_get_block,
&HFS_I(page->mapping->host)->mmu_private);
}
-static int hfs_bmap(struct address_space *mapping, long block)
+static sector_t hfs_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,hfs_get_block);
}
return cont_prepare_write(page,from,to,hpfs_get_block,
&hpfs_i(page->mapping->host)->mmu_private);
}
-static int _hpfs_bmap(struct address_space *mapping, long block)
+static sector_t _hpfs_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,hpfs_get_block);
}
* file.
*/
-int bmap(struct inode * inode, int block)
+sector_t bmap(struct inode * inode, sector_t block)
{
- int res = 0;
+ sector_t res = 0;
if (inode->i_mapping->a_ops->bmap)
res = inode->i_mapping->a_ops->bmap(inode->i_mapping, block);
return res;
return 0;
}
-struct buffer_head *isofs_bread(struct inode *inode, unsigned int block)
+struct buffer_head *isofs_bread(struct inode *inode, sector_t block)
{
- unsigned int blknr = isofs_bmap(inode, block);
+ sector_t blknr = isofs_bmap(inode, block);
if (!blknr)
return NULL;
return sb_bread(inode->i_sb, blknr);
return block_read_full_page(page,isofs_get_block);
}
-static int _isofs_bmap(struct address_space *mapping, long block)
+static sector_t _isofs_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,isofs_get_block);
}
return block_prepare_write(page, from, to, jfs_get_block);
}
-static int jfs_bmap(struct address_space *mapping, long block)
+static sector_t jfs_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping, block, jfs_get_block);
}
{
return block_prepare_write(page,from,to,minix_get_block);
}
-static int minix_bmap(struct address_space *mapping, long block)
+static sector_t minix_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,minix_get_block);
}
return cont_prepare_write(page, from, to, qnx4_get_block,
&qnx4_inode->mmu_private);
}
-static int qnx4_bmap(struct address_space *mapping, long block)
+static sector_t qnx4_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,qnx4_get_block);
}
}
-static int reiserfs_aop_bmap(struct address_space *as, long block) {
+static sector_t reiserfs_aop_bmap(struct address_space *as, sector_t block) {
return generic_block_bmap(as, block, reiserfs_bmap) ;
}
{
return block_prepare_write(page,from,to,get_block);
}
-static int sysv_bmap(struct address_space *mapping, long block)
+static sector_t sysv_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,get_block);
}
return block_prepare_write(page, from, to, udf_get_block);
}
-static int udf_bmap(struct address_space *mapping, long block)
+static sector_t udf_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,udf_get_block);
}
{
return block_prepare_write(page,from,to,ufs_getfrag_block);
}
-static int ufs_bmap(struct address_space *mapping, long block)
+static sector_t ufs_bmap(struct address_space *mapping, sector_t block)
{
return generic_block_bmap(mapping,block,ufs_getfrag_block);
}
linvfs_get_blocks_direct);
}
-STATIC int
+
+STATIC sector_t
linvfs_bmap(
struct address_space *mapping,
- long block)
+ sector_t block)
{
struct inode *inode = (struct inode *)mapping->host;
vnode_t *vp = LINVFS_GET_VP(inode);
#endif
typedef u64 dma64_addr_t;
+#ifdef CONFIG_LBD
+typedef u64 sector_t;
+#define HAVE_SECTOR_T
+#endif
+
#endif /* __KERNEL__ */
#endif
typedef u32 dma_addr_t;
typedef u64 dma64_addr_t;
+#ifdef CONFIG_LBD
+typedef u64 sector_t;
+#define HAVE_SECTOR_T
+#endif
+
#endif /* __KERNEL__ */
/*
int (*prepare_write)(struct file *, struct page *, unsigned, unsigned);
int (*commit_write)(struct file *, struct page *, unsigned, unsigned);
/* Unfortunately this kludge is needed for FIBMAP. Don't use it */
- int (*bmap)(struct address_space *, long);
+ sector_t (*bmap)(struct address_space *, sector_t);
int (*invalidatepage) (struct page *, unsigned long);
int (*releasepage) (struct page *, int);
int (*direct_IO)(int, struct file *, const struct iovec *iov,
int bd_holders;
struct block_device * bd_contains;
unsigned bd_block_size;
- unsigned long bd_offset;
+ sector_t bd_offset;
unsigned bd_part_count;
int bd_invalidated;
};
extern int filemap_fdatawrite(struct address_space *);
extern int filemap_fdatawait(struct address_space *);
extern void sync_supers(void);
-extern int bmap(struct inode *, int);
+extern sector_t bmap(struct inode *, sector_t);
extern int notify_change(struct dentry *, struct iattr *);
extern int permission(struct inode *, int);
extern int vfs_permission(struct inode *, int);
int get_acorn_filename(struct iso_directory_record *, char *, struct inode *);
extern struct dentry *isofs_lookup(struct inode *, struct dentry *);
-extern struct buffer_head *isofs_bread(struct inode *, unsigned int);
+extern struct buffer_head *isofs_bread(struct inode *, sector_t);
extern int isofs_get_blocks(struct inode *, sector_t, struct buffer_head **, unsigned long);
extern struct inode_operations isofs_dir_inode_operations;
#endif
/*
- * transition to 64-bit sector_t, possibly making it an option...
+ * The type used for indexing onto a disc or disc partition.
+ * If required, asm/types.h can override it and define
+ * HAVE_SECTOR_T
*/
-#undef BLK_64BIT_SECTOR
-
-#ifdef BLK_64BIT_SECTOR
-typedef u64 sector_t;
-#else
+#ifndef HAVE_SECTOR_T
typedef unsigned long sector_t;
#endif