Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux...
[linux-2.6-block.git] / fs / fat / dir.c
index c8366cb8eccd7c4d3131139b52f90c0e4a3979b1..9d01db37183f2616feec648fd63c9ab292a45b8f 100644 (file)
@@ -57,7 +57,7 @@ static inline void fat_dir_readahead(struct inode *dir, sector_t iblock,
        if ((iblock & (sbi->sec_per_clus - 1)) || sbi->sec_per_clus == 1)
                return;
        /* root dir of FAT12/FAT16 */
-       if ((sbi->fat_bits != 32) && (dir->i_ino == MSDOS_ROOT_INO))
+       if (!is_fat32(sbi) && (dir->i_ino == MSDOS_ROOT_INO))
                return;
 
        bh = sb_find_get_block(sb, phys);
@@ -805,7 +805,7 @@ static long fat_dir_ioctl(struct file *filp, unsigned int cmd,
                return fat_generic_ioctl(filp, cmd, arg);
        }
 
-       if (!access_ok(VERIFY_WRITE, d1, sizeof(struct __fat_dirent[2])))
+       if (!access_ok(d1, sizeof(struct __fat_dirent[2])))
                return -EFAULT;
        /*
         * Yes, we don't need this put_user() absolutely. However old
@@ -845,7 +845,7 @@ static long fat_compat_dir_ioctl(struct file *filp, unsigned cmd,
                return fat_generic_ioctl(filp, cmd, (unsigned long)arg);
        }
 
-       if (!access_ok(VERIFY_WRITE, d1, sizeof(struct compat_dirent[2])))
+       if (!access_ok(d1, sizeof(struct compat_dirent[2])))
                return -EFAULT;
        /*
         * Yes, we don't need this put_user() absolutely. However old
@@ -1313,7 +1313,7 @@ int fat_add_entries(struct inode *dir, void *slots, int nr_slots,
                }
        }
        if (dir->i_ino == MSDOS_ROOT_INO) {
-               if (sbi->fat_bits != 32)
+               if (!is_fat32(sbi))
                        goto error;
        } else if (MSDOS_I(dir)->i_start == 0) {
                fat_msg(sb, KERN_ERR, "Corrupted directory (i_pos %lld)",