Merge git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 Aug 2011 21:16:13 +0000 (14:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 18 Aug 2011 21:16:13 +0000 (14:16 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6:
  fat: fat16 support maximum 4GB file/vol size as WinXP or 7.
  fat: fix utf8 iocharset warning message
  fat: fix build warning

1  2 
fs/fat/inode.c

diff --combined fs/fat/inode.c
@@@ -211,8 -211,8 +211,8 @@@ static ssize_t fat_direct_IO(int rw, st
         * FAT need to use the DIO_LOCKING for avoiding the race
         * condition of fat_get_block() and ->truncate().
         */
 -      ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev,
 -                               iov, offset, nr_segs, fat_get_block, NULL);
 +      ret = blockdev_direct_IO(rw, iocb, inode, iov, offset, nr_segs,
 +                               fat_get_block);
        if (ret < 0 && (rw & WRITE))
                fat_write_failed(mapping, offset + iov_length(iov, nr_segs));
  
@@@ -224,9 -224,9 +224,9 @@@ static sector_t _fat_bmap(struct addres
        sector_t blocknr;
  
        /* fat_get_cluster() assumes the requested blocknr isn't truncated. */
 -      down_read(&mapping->host->i_alloc_sem);
 +      down_read(&MSDOS_I(mapping->host)->truncate_lock);
        blocknr = generic_block_bmap(mapping, block, fat_get_block);
 -      up_read(&mapping->host->i_alloc_sem);
 +      up_read(&MSDOS_I(mapping->host)->truncate_lock);
  
        return blocknr;
  }
@@@ -510,8 -510,6 +510,8 @@@ static struct inode *fat_alloc_inode(st
        ei = kmem_cache_alloc(fat_inode_cachep, GFP_NOFS);
        if (!ei)
                return NULL;
 +
 +      init_rwsem(&ei->truncate_lock);
        return &ei->vfs_inode;
  }
  
@@@ -1188,9 -1186,9 +1188,9 @@@ static int parse_options(struct super_b
  out:
        /* UTF-8 doesn't provide FAT semantics */
        if (!strcmp(opts->iocharset, "utf8")) {
-               fat_msg(sb, KERN_ERR, "utf8 is not a recommended IO charset"
+               fat_msg(sb, KERN_WARNING, "utf8 is not a recommended IO charset"
                       " for FAT filesystems, filesystem will be "
-                      "case sensitive!\n");
+                      "case sensitive!");
        }
  
        /* If user doesn't specify allow_utime, it's initialized from dmask. */
@@@ -1367,6 -1365,7 +1367,7 @@@ int fat_fill_super(struct super_block *
        sbi->free_clusters = -1;        /* Don't know yet */
        sbi->free_clus_valid = 0;
        sbi->prev_free = FAT_START_ENT;
+       sb->s_maxbytes = 0xffffffff;
  
        if (!sbi->fat_length && b->fat32_length) {
                struct fat_boot_fsinfo *fsinfo;
                sbi->fat_length = le32_to_cpu(b->fat32_length);
                sbi->root_cluster = le32_to_cpu(b->root_cluster);
  
-               sb->s_maxbytes = 0xffffffff;
                /* MC - if info_sector is 0, don't multiply by 0 */
                sbi->fsinfo_sector = le16_to_cpu(b->info_sector);
                if (sbi->fsinfo_sector == 0)