]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/gfs2/recovery.c
driver core: refcounting fix
[linux-2.6-omap-h63xx.git] / fs / gfs2 / recovery.c
index 4478162416264b0ea814233702e6413743bcd420..8bc182c7e2ef22c2bad269743f15bab5f27a4914 100644 (file)
@@ -7,7 +7,6 @@
  * of the GNU General Public License version 2.
  */
 
-#include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
 #include <linux/completion.h>
@@ -136,6 +135,7 @@ static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk,
 {
        struct buffer_head *bh;
        struct gfs2_log_header_host lh;
+       const u32 nothing = 0;
        u32 hash;
        int error;
 
@@ -143,11 +143,11 @@ static int get_log_header(struct gfs2_jdesc *jd, unsigned int blk,
        if (error)
                return error;
 
-       memcpy(&lh, bh->b_data, sizeof(struct gfs2_log_header));        /* XXX */
-       lh.lh_hash = 0;
-       hash = gfs2_disk_hash((char *)&lh, sizeof(struct gfs2_log_header));
+       hash = crc32_le((u32)~0, bh->b_data, sizeof(struct gfs2_log_header) -
+                                            sizeof(u32));
+       hash = crc32_le(hash, (unsigned char const *)&nothing, sizeof(nothing));
+       hash ^= (u32)~0;
        gfs2_log_header_in(&lh, bh->b_data);
-
        brelse(bh);
 
        if (lh.lh_header.mh_magic != GFS2_MAGIC ||