]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] 64-bit sector_t - filesystems
authorAndrew Morton <akpm@digeo.com>
Wed, 9 Oct 2002 01:37:37 +0000 (18:37 -0700)
committerPatrick Mochel <mochel@osdl.org>
Wed, 9 Oct 2002 01:37:37 +0000 (18:37 -0700)
From Peter Chubb

Filesystem migration to possibly 64-bit sector_t:
 - bmap() now takes and returns a sector_t to allow filesystems
   (e.g., JFS, XFS) that are 64-bit clean to deal with large files
 - buffer handling now 64-bit clean

Enable 64-bit sector_t on IA32 and PPC.

kiobufs takes sector_t array, not array of long.
Fix blkmtd.c to deal in such an array.

Miscellaneous fixes for 64-bit sector_t.
   - missed printk formats
 - ide_floppy_do_request had incorrect signature
 - in blkmtd.c there was a pointer used to
   manipulate an array to be used by kiobuf --
     it was unsigned long, needed to be sector_t

34 files changed:
drivers/block/Config.help
drivers/block/Config.in
drivers/block/paride/pf.c
drivers/ide/ide-floppy.c
drivers/mtd/devices/blkmtd.c
fs/adfs/inode.c
fs/affs/file.c
fs/affs/inode.c
fs/bfs/file.c
fs/buffer.c
fs/efs/inode.c
fs/ext2/inode.c
fs/ext3/ialloc.c
fs/ext3/inode.c
fs/fat/file.c
fs/fat/inode.c
fs/freevxfs/vxfs_subr.c
fs/hfs/inode.c
fs/hpfs/file.c
fs/inode.c
fs/isofs/inode.c
fs/jfs/inode.c
fs/minix/inode.c
fs/qnx4/inode.c
fs/reiserfs/inode.c
fs/sysv/itree.c
fs/udf/inode.c
fs/ufs/inode.c
fs/xfs/linux/xfs_aops.c
include/asm-i386/types.h
include/asm-ppc/types.h
include/linux/fs.h
include/linux/iso_fs.h
include/linux/types.h

index d91112a7b9c5390cc9a817d670361dd4d15c1b25..0ded1e8a2b593144a4636e1c48d1673c1bd41631 100644 (file)
@@ -258,3 +258,7 @@ CONFIG_BLK_CPQ_DA
   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.
index d6b458560882d85c75ff6009a71381f9a57396eb..49ba18434d92caa9479d240516f5625ff63d2fe0 100644 (file)
@@ -48,4 +48,7 @@ if [ "$CONFIG_BLK_DEV_RAM" = "y" -o "$CONFIG_BLK_DEV_RAM" = "m" ]; then
 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
index f80dbd5af74754d988f0dbe2cc1b6727700e7f2f..a7e73e09d1625bd319eb9dbbb03227c0469c536b 100644 (file)
@@ -685,7 +685,8 @@ static int pf_identify(struct pf_unit *pf)
        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;
 }
index bd94b83741c03e70670da93a300632a627e1499d..60e3aed6916634b9c96893693285cf4b7fec7613 100644 (file)
@@ -1241,17 +1241,18 @@ static void idefloppy_create_rw_cmd (idefloppy_floppy_t *floppy, idefloppy_pc_t
 /*
  *     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 */
 
index 49d510f450fde5713f47cbba63ae02dbec76d382..2df7ece8310e8f1b9b5f5fb5085adffcb085b863 100644 (file)
@@ -164,7 +164,7 @@ static int blkmtd_readpage(mtd_raw_dev_data_t *rawdevice, struct page *page)
   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");
@@ -223,7 +223,7 @@ static int blkmtd_readpage(mtd_raw_dev_data_t *rawdevice, struct page *page)
 
   /* 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);
@@ -298,7 +298,7 @@ static int write_queue_task(void *data)
   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);
index 2c49a53279d97cbc93fdc81ce42a45a0c5b030dc..c767a816f9f1caf7aa452856b3e34097df92aae0 100644 (file)
@@ -67,7 +67,7 @@ static int adfs_prepare_write(struct file *file, struct page *page, unsigned int
                &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);
 }
index af200dd36b295ff1e8848fbbaaa849199dd2a6a4..7b1cba0e5c2f84372733588600bdb9af544be26b 100644 (file)
@@ -338,10 +338,11 @@ affs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh_resul
        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)
@@ -352,12 +353,12 @@ affs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh_resul
        //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);
@@ -422,7 +423,7 @@ static int affs_prepare_write(struct file *file, struct page *page, unsigned fro
        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);
 }
index a66b02a757f43ce81fafc72f536a7adcb97b4128..21c57b3d6f68b352cfe084def602d84679401e1d 100644 (file)
@@ -416,7 +416,7 @@ affs_add_entry(struct inode *dir, struct inode *inode, struct dentry *dentry, s3
        }
        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);
index cd255f15d6d3df260a3e45bf1419cf18bebfd328..8f8dbde4636f9ad2d279c2d7b0561ee2075e9a40 100644 (file)
@@ -145,7 +145,7 @@ static int bfs_prepare_write(struct file *file, struct page *page, unsigned from
        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);
 }
index 2b51e94a09ce85b0a30dd72e1e865ca2582fc2d3..30c0adeec76259a16022b8a513404eaa8efbc369 100644 (file)
@@ -1776,7 +1776,7 @@ static int __block_prepare_write(struct inode *inode, struct page *page,
                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;
@@ -1792,7 +1792,7 @@ static int __block_prepare_write(struct inode *inode, struct page *page,
        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) {
@@ -1933,7 +1933,7 @@ static int __block_commit_write(struct inode *inode, struct page *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;
@@ -1948,7 +1948,7 @@ int block_read_full_page(struct page *page, get_block_t *get_block)
        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;
index 658c73451142b094701724da137c11a4470dc9ad..cd47fe00288b964b0b04fffd8b195863c4e11d7b 100644 (file)
@@ -19,7 +19,7 @@ static int efs_readpage(struct file *file, struct page *page)
 {
        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);
 }
index 423ead0f26fa06021b1621a13db00e94b4537437..4a7af3e5a17b272b64e2e1bac1268e0bfe5a52a2 100644 (file)
@@ -601,7 +601,7 @@ ext2_prepare_write(struct file *file, struct page *page,
        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);
 }
index 98764f881daa85553cf3cbca55339358e568964d..9ba9b99338eb2928dd620d73fe8cd81bc0d1df35 100644 (file)
@@ -479,7 +479,7 @@ struct inode *ext3_orphan_get (struct super_block * sb, ino_t ino)
                        !(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, 
index d34ab2b46f7ba0da37c0dc10486fdffeccd66ba0..d6a0d9dfcd71384a00367ae574d0f6ebc4bebc4b 100644 (file)
@@ -1181,7 +1181,7 @@ static int ext3_commit_write(struct file *file, struct page *page,
  * 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;
index 38b06bb5566e5191edce2a99cf11dc10c4e08ad1..ac7ab9d2241e56cb0fe99a4e92d0581b5755d4c7 100644 (file)
@@ -59,7 +59,7 @@ int fat_get_block(struct inode *inode, sector_t iblock, struct buffer_head *bh_r
                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);
index 0c26db62cc7ab9b51483e63082a7296fd38e3646..89a3b19085de58a8e3ab1a667a2164bb77de88fe 100644 (file)
@@ -998,7 +998,7 @@ fat_commit_write(struct file *file, struct page *page,
        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);
 }
index 7184e4a3f282c0fed3d5751ed5f7c6d793ff6e96..21e926cc8d88ae99599bdbec2c2e6b98b408254f 100644 (file)
@@ -43,7 +43,7 @@
 
 
 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,
@@ -186,8 +186,8 @@ vxfs_readpage(struct file *file, struct page *page)
  * 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);
 }
index 849a9ad713a128af66e65cce8e32cdc8d4c201cb..305c13e41ef4d6fe9a0b98e01271afadd9a89bae 100644 (file)
@@ -242,7 +242,7 @@ static int hfs_prepare_write(struct file *file, struct page *page, unsigned from
        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);
 }
index 2c2ca8e2053d40295fc941ec72dc8051abeceb93..4891ce05240795ee1a60c593924ccad4bbbae0d1 100644 (file)
@@ -111,7 +111,7 @@ static int hpfs_prepare_write(struct file *file, struct page *page, unsigned fro
        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);
 }
index c6e5dd71679e8f0804be338454fd76ceb19f60c4..9077df6ba43ca66dd10a621589702ede386624ef 100644 (file)
@@ -907,9 +907,9 @@ void iput(struct inode *inode)
  *     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;
index ed5e703f4a5889987e8f337be5cab5e047199077..d7470e567a387fc6a28cde5271bd2dee72c88a9f 100644 (file)
@@ -1045,9 +1045,9 @@ static int isofs_bmap(struct inode *inode, int block)
        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);
@@ -1058,7 +1058,7 @@ static int isofs_readpage(struct file *file, struct page *page)
        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);
 }
index b718fa7476dedb850c4451b2b87decf37dbbc3ba..64f1103c001205bc71d466e8385b61ec50dd6660 100644 (file)
@@ -305,7 +305,7 @@ static int jfs_prepare_write(struct file *file,
        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);
 }
index 66fd3153fa2f1a3f354bdabed62c8500d2d49ca9..68ace95d4eff91878c04f5744b707df48afb94e7 100644 (file)
@@ -328,7 +328,7 @@ static int minix_prepare_write(struct file *file, struct page *page, unsigned fr
 {
        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);
 }
index 0dc3a6bde4aa4eb23ccbb923b0c5ae043ae9b4b4..0075429592efabc82018e59e4f7a227db17ad9fa 100644 (file)
@@ -444,7 +444,7 @@ static int qnx4_prepare_write(struct file *file, struct page *page,
        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);
 }
index 3344121f15d6b3a90129360bd50d8e1f9a5820a5..6cd19e6eafd722dd7fa0a31b0b6f86f8a523de06 100644 (file)
@@ -2029,7 +2029,7 @@ int reiserfs_prepare_write(struct file *f, struct page *page,
 }
 
 
-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) ;
 }
 
index db2650b55805fb6c0fb297c87d609ce6d27b680e..272dde87c916c8660b2a2745791f470c16e47c5f 100644 (file)
@@ -459,7 +459,7 @@ static int sysv_prepare_write(struct file *file, struct page *page, unsigned fro
 {
        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);
 }
index 1e7478470e7624d9a06acbd02b5f8678178a25b5..9f1df0e61896d003422b33a34c683c290b286366 100644 (file)
@@ -146,7 +146,7 @@ static int udf_prepare_write(struct file *file, struct page *page, unsigned from
        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);
 }
index 8d19a8951478fe0e054fc3f918b9a6d180aebfa5..db6c6d657fa6262422de3b41033180af2a80a852 100644 (file)
@@ -457,7 +457,7 @@ static int ufs_prepare_write(struct file *file, struct page *page, unsigned from
 {
        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);
 }
index 5712ac810c4fc28f0d76ab1613e6e5501132473f..184d173ee192f6d4b9ddb04336c9d25141e2d936 100644 (file)
@@ -692,10 +692,11 @@ linvfs_direct_IO(
                                        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);
index 238635a0a29a0de02887df84d1e8987e854572e5..6175dba50238afff6e9c3ceb8ae5fab0b46d3a13 100644 (file)
@@ -52,6 +52,11 @@ typedef u32 dma_addr_t;
 #endif
 typedef u64 dma64_addr_t;
 
+#ifdef CONFIG_LBD
+typedef u64 sector_t;
+#define HAVE_SECTOR_T
+#endif
+
 #endif /* __KERNEL__ */
 
 #endif
index 2b048ca98e732eb76f1a932d06e3eb2b563bb343..26dd36dec19787de7f202db996da32828bf12060 100644 (file)
@@ -45,6 +45,11 @@ typedef __vector128 vector128;
 typedef u32 dma_addr_t;
 typedef u64 dma64_addr_t;
 
+#ifdef CONFIG_LBD
+typedef u64 sector_t;
+#define HAVE_SECTOR_T
+#endif
+
 #endif /* __KERNEL__ */
 
 /*
index fa03013be9d28c4bc5d387e1c3fcbe93fac1b56b..56771d8994b6a764a2c80b0e517a76946559833c 100644 (file)
@@ -305,7 +305,7 @@ struct address_space_operations {
        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,
@@ -356,7 +356,7 @@ struct block_device {
        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;
 };
@@ -1141,7 +1141,7 @@ extern void write_inode_now(struct inode *, int);
 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);
index 0ac0aa2334ead1d6cbb1d3ca838da02f1d95762a..8416bedc5c27867543ffdf02e7c0f0a039d4cb77 100644 (file)
@@ -230,7 +230,7 @@ int get_joliet_filename(struct iso_directory_record *, unsigned char *, struct i
 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;
index 582d35492314d4e4b26318082ed3479112b14a53..87985824b16e3a549c78a01d13f32a689a4d4571 100644 (file)
@@ -117,13 +117,11 @@ typedef           __s64           int64_t;
 #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