]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/ext4/super.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / fs / ext4 / super.c
index 6fea87db7daa4696e1781a2817fbd6ff61d14673..24a146bde742be9683cea9f13be9e30a1324b9c5 100644 (file)
@@ -1806,7 +1806,7 @@ static int options_seq_show(struct seq_file *seq, void *offset)
 
 static int options_open_fs(struct inode *inode, struct file *file)
 {
-       return single_open(file, options_seq_show, PDE(inode)->data);
+       return single_open(file, options_seq_show, PDE_DATA(inode));
 }
 
 static const struct file_operations ext4_seq_options_fops = {
@@ -1952,16 +1952,16 @@ static __le16 ext4_group_desc_csum(struct ext4_sb_info *sbi, __u32 block_group,
        if ((sbi->s_es->s_feature_ro_compat &
             cpu_to_le32(EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))) {
                /* Use new metadata_csum algorithm */
-               __u16 old_csum;
+               __le16 save_csum;
                __u32 csum32;
 
-               old_csum = gdp->bg_checksum;
+               save_csum = gdp->bg_checksum;
                gdp->bg_checksum = 0;
                csum32 = ext4_chksum(sbi, sbi->s_csum_seed, (__u8 *)&le_group,
                                     sizeof(le_group));
                csum32 = ext4_chksum(sbi, csum32, (__u8 *)gdp,
                                     sbi->s_desc_size);
-               gdp->bg_checksum = old_csum;
+               gdp->bg_checksum = save_csum;
 
                crc = csum32 & 0xFFFF;
                goto out;
@@ -2394,19 +2394,6 @@ static int parse_strtoull(const char *buf,
        return ret;
 }
 
-static int parse_strtoul(const char *buf,
-               unsigned long max, unsigned long *value)
-{
-       char *endp;
-
-       *value = simple_strtoul(skip_spaces(buf), &endp, 0);
-       endp = skip_spaces(endp);
-       if (*endp || *value > max)
-               return -EINVAL;
-
-       return 0;
-}
-
 static ssize_t delayed_allocation_blocks_show(struct ext4_attr *a,
                                              struct ext4_sb_info *sbi,
                                              char *buf)
@@ -2446,11 +2433,13 @@ static ssize_t inode_readahead_blks_store(struct ext4_attr *a,
                                          const char *buf, size_t count)
 {
        unsigned long t;
+       int ret;
 
-       if (parse_strtoul(buf, 0x40000000, &t))
-               return -EINVAL;
+       ret = kstrtoul(skip_spaces(buf), 0, &t);
+       if (ret)
+               return ret;
 
-       if (t && !is_power_of_2(t))
+       if (t && (!is_power_of_2(t) || t > 0x40000000))
                return -EINVAL;
 
        sbi->s_inode_readahead_blks = t;
@@ -2471,9 +2460,11 @@ static ssize_t sbi_ui_store(struct ext4_attr *a,
 {
        unsigned int *ui = (unsigned int *) (((char *) sbi) + a->offset);
        unsigned long t;
+       int ret;
 
-       if (parse_strtoul(buf, 0xffffffff, &t))
-               return -EINVAL;
+       ret = kstrtoul(skip_spaces(buf), 0, &t);
+       if (ret)
+               return ret;
        *ui = t;
        return count;
 }
@@ -4261,7 +4252,7 @@ static journal_t *ext4_get_dev_journal(struct super_block *sb,
                goto out_bdev;
        }
        journal->j_private = sb;
-       ll_rw_block(READ, 1, &journal->j_sb_buffer);
+       ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &journal->j_sb_buffer);
        wait_on_buffer(journal->j_sb_buffer);
        if (!buffer_uptodate(journal->j_sb_buffer)) {
                ext4_msg(sb, KERN_ERR, "I/O error on journal device");