]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Add 4G-1 file support to FAT32
authorHirofumi Ogawa <hirofumi@mail.parknet.co.jp>
Fri, 19 Jul 2002 04:55:29 +0000 (21:55 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 19 Jul 2002 04:55:29 +0000 (21:55 -0700)
This patch changes cont_prepare_write(), in order to support a 4G-1
file for FAT32.

 int cont_prepare_write(struct page *page, unsigned offset,
- unsigned to, get_block_t *get_block, unsigned long *bytes)
+ unsigned to, get_block_t *get_block, loff_t *bytes)

And it fixes broken adfs/affs/fat/hfs/hpfs/qnx4 by this
cont_prepare_write() change.

fs/buffer.c
fs/fat/file.c
fs/fat/inode.c
include/linux/adfs_fs_i.h
include/linux/affs_fs_i.h
include/linux/buffer_head.h
include/linux/hfs_fs_i.h
include/linux/hpfs_fs_i.h
include/linux/msdos_fs_i.h
include/linux/qnx4_fs.h

index dfb38f4a6f4497ec6f7a7d1b7bf909f1461024e6..107d4409a926e644cc68655e71b1de0dac282869 100644 (file)
@@ -2078,7 +2078,7 @@ out:
  */
 
 int cont_prepare_write(struct page *page, unsigned offset,
-               unsigned to, get_block_t *get_block, unsigned long *bytes)
+               unsigned to, get_block_t *get_block, loff_t *bytes)
 {
        struct address_space *mapping = page->mapping;
        struct inode *inode = mapping->host;
index 93ac0e7e17a1b3094aad4287b85df924b7ec7b12..d915d6578c9aa22b203d6b213a62852a93b7b67b 100644 (file)
@@ -54,7 +54,7 @@ int fat_get_block(struct inode *inode, sector_t iblock, struct buffer_head *bh_r
        }
        if (!create)
                return 0;
-       if (iblock << sb->s_blocksize_bits != MSDOS_I(inode)->mmu_private) {
+       if (iblock != MSDOS_I(inode)->mmu_private >> sb->s_blocksize_bits) {
                BUG();
                return -EIO;
        }
index 69ca844884b63bcd194f8d9f9a00c918bc337a2e..898cf3e1d94060a751cab1a18750a181634dbb85 100644 (file)
@@ -417,7 +417,7 @@ static int fat_read_root(struct inode *inode)
        }
        inode->i_blksize = 1 << sbi->cluster_bits;
        inode->i_blocks = ((inode->i_size + inode->i_blksize - 1)
-                          & ~(inode->i_blksize - 1)) >> 9;
+                          & ~((loff_t)inode->i_blksize - 1)) >> 9;
        MSDOS_I(inode)->i_logstart = 0;
        MSDOS_I(inode)->mmu_private = inode->i_size;
 
@@ -775,6 +775,8 @@ int fat_fill_super(struct super_block *sb, void *data, int silent,
                sbi->fat_length = CF_LE_L(b->fat32_length);
                sbi->root_cluster = CF_LE_L(b->root_cluster);
 
+               sb->s_maxbytes = 0xffffffff;
+               
                /* MC - if info_sector is 0, don't multiply by 0 */
                sbi->fsinfo_sector = CF_LE_W(b->info_sector);
                if (sbi->fsinfo_sector == 0)
@@ -1063,7 +1065,7 @@ static int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
        /* this is as close to the truth as we can get ... */
        inode->i_blksize = 1 << sbi->cluster_bits;
        inode->i_blocks = ((inode->i_size + inode->i_blksize - 1)
-                          & ~(inode->i_blksize - 1)) >> 9;
+                          & ~((loff_t)inode->i_blksize - 1)) >> 9;
        inode->i_mtime = inode->i_atime =
                date_dos2unix(CF_LE_W(de->time),CF_LE_W(de->date));
        inode->i_ctime =
index 4422825094893683a20699c8e78991d9c44c75c9..6341f7059b0b03f6d828185cc0ab352594f95d95 100644 (file)
@@ -11,7 +11,7 @@
  * adfs file system inode data in memory
  */
 struct adfs_inode_info {
-       unsigned long   mmu_private;
+       loff_t          mmu_private;
        unsigned long   parent_id;      /* object id of parent          */
        __u32           loadaddr;       /* RISC OS load address         */
        __u32           execaddr;       /* RISC OS exec address         */
index 89872f7785386835b4ca0a672ec35453c776633e..3ad824b7f30fb22d66cfd5cd4b0e30afccb91a52 100644 (file)
@@ -35,7 +35,7 @@ struct affs_inode_info {
        struct affs_ext_key *i_ac;              /* associative cache of extended blocks */
        u32      i_ext_last;                    /* last accessed extended block */
        struct buffer_head *i_ext_bh;           /* bh of last extended block */
-       unsigned long mmu_private;
+       loff_t   mmu_private;
        u32      i_protect;                     /* unused attribute bits */
        u32      i_lastalloc;                   /* last allocated block */
        int      i_pa_cnt;                      /* number of preallocated blocks */
index b07e937f900bf8cdb27a844fb8d2306b287b3ec5..f9c9aafdf036c7c77b5b06946e317e90ff371e86 100644 (file)
@@ -178,7 +178,7 @@ int block_write_full_page(struct page*, get_block_t*);
 int block_read_full_page(struct page*, get_block_t*);
 int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*);
 int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*,
-                               unsigned long *);
+                               loff_t *);
 int generic_cont_expand(struct inode *inode, loff_t size) ;
 int block_commit_write(struct page *page, unsigned from, unsigned to);
 int block_sync_page(struct page *);
index 39312c9b8fadc43620b6610e145b9b3a9b55dd2f..119cc5200197482465d2862ab4889cdb6080d4d3 100644 (file)
@@ -19,7 +19,7 @@
 struct hfs_inode_info {
        int                             magic;     /* A magic number */
 
-       unsigned long                   mmu_private;
+       loff_t                          mmu_private;
        struct hfs_cat_entry            *entry;
 
        /* For a regular or header file */
index c4d6cce5d6077cd3522d31e38f8dfea80e26a780..ab72ea5b52480396ec02e141c08e3d9e31e63955 100644 (file)
@@ -2,7 +2,7 @@
 #define _HPFS_FS_I
 
 struct hpfs_inode_info {
-       unsigned long mmu_private;
+       loff_t mmu_private;
        ino_t i_parent_dir;     /* (directories) gives fnode of parent dir */
        unsigned i_dno;         /* (directories) root dnode */
        unsigned i_dpos;        /* (directories) temp for readdir */
index 438afd880cccb58ccf4967e0b296ca2a435ca0c4..85f64940261781b27f3f6d39a29ca4f0aafbe0b5 100644 (file)
@@ -8,7 +8,7 @@
  */
 
 struct msdos_inode_info {
-       unsigned long mmu_private;
+       loff_t mmu_private;
        int i_start;    /* first cluster or 0 */
        int i_logstart; /* logical first cluster */
        int i_attrs;    /* unused attribute bits */
index 06e0e6b51e4c162382db21f107985451bdfeb8cd..a84aa2091c2b5adf7671a634b604b7b47db954cf 100644 (file)
@@ -106,7 +106,7 @@ struct qnx4_sb_info {
 
 struct qnx4_inode_info {
        struct qnx4_inode_entry raw;
-       unsigned long mmu_private;
+       loff_t mmu_private;
        struct inode vfs_inode;
 };