Merge tag 'for-linus-20160801' of git://git.infradead.org/linux-mtd
[deliverable/linux.git] / fs / gfs2 / dir.c
index 1b02665357b22ae7a514ae028d2f9c68af5eeaa5..fcb59b23f1e38dd6ecd8cc90a14985f618347373 100644 (file)
@@ -783,12 +783,15 @@ static int get_leaf_nr(struct gfs2_inode *dip, u32 index,
                       u64 *leaf_out)
 {
        __be64 *hash;
+       int error;
 
        hash = gfs2_dir_get_hash_table(dip);
-       if (IS_ERR(hash))
-               return PTR_ERR(hash);
-       *leaf_out = be64_to_cpu(*(hash + index));
-       return 0;
+       error = PTR_ERR_OR_ZERO(hash);
+
+       if (!error)
+               *leaf_out = be64_to_cpu(*(hash + index));
+
+       return error;
 }
 
 static int get_first_leaf(struct gfs2_inode *dip, u32 index,
@@ -798,7 +801,7 @@ static int get_first_leaf(struct gfs2_inode *dip, u32 index,
        int error;
 
        error = get_leaf_nr(dip, index, &leaf_no);
-       if (!IS_ERR_VALUE(error))
+       if (!error)
                error = get_leaf(dip, leaf_no, bh_out);
 
        return error;
@@ -1014,7 +1017,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name)
 
        index = name->hash >> (32 - dip->i_depth);
        error = get_leaf_nr(dip, index, &leaf_no);
-       if (IS_ERR_VALUE(error))
+       if (error)
                return error;
 
        /*  Get the old leaf block  */
@@ -1510,7 +1513,7 @@ static void gfs2_dir_readahead(struct inode *inode, unsigned hsize, u32 index,
                                continue;
                        }
                        bh->b_end_io = end_buffer_read_sync;
-                       submit_bh(READA | REQ_META, bh);
+                       submit_bh(REQ_OP_READ, REQ_RAHEAD | REQ_META, bh);
                        continue;
                }
                brelse(bh);
This page took 0.027322 seconds and 5 git commands to generate.