Whamcloud - gitweb
po: update fr.po (from translationproject.org)
[tools/e2fsprogs.git] / e2fsck / revoke.c
index 7779b9d..fa60878 100644 (file)
@@ -92,8 +92,8 @@
 #include <linux/hash.h>
 #endif
 
-static lkmem_cache_t *jbd2_revoke_record_cache;
-static lkmem_cache_t *jbd2_revoke_table_cache;
+static struct kmem_cache *jbd2_revoke_record_cache;
+static struct kmem_cache *jbd2_revoke_table_cache;
 
 /* Each revoke record represents one single revoked block.  During
    journal replay, this involves recording the transaction ID of the
@@ -138,11 +138,13 @@ static int insert_revoke_hash(journal_t *journal, unsigned long long blocknr,
 {
        struct list_head *hash_list;
        struct jbd2_revoke_record_s *record;
+       gfp_t gfp_mask = GFP_NOFS;
 
-repeat:
-       record = kmem_cache_alloc(jbd2_revoke_record_cache, GFP_NOFS);
+       if (journal_oom_retry)
+               gfp_mask |= __GFP_NOFAIL;
+       record = kmem_cache_alloc(jbd2_revoke_record_cache, gfp_mask);
        if (!record)
-               goto oom;
+               return -ENOMEM;
 
        record->sequence = seq;
        record->blocknr = blocknr;
@@ -151,13 +153,6 @@ repeat:
        list_add(&record->hash, hash_list);
        spin_unlock(&journal->j_revoke_lock);
        return 0;
-
-oom:
-       if (!journal_oom_retry)
-               return -ENOMEM;
-       jbd_debug(1, "ENOMEM in %s, retrying\n", __func__);
-       yield();
-       goto repeat;
 }
 
 /* Find a revoke record in the journal's hash table. */
@@ -653,7 +648,7 @@ static void flush_descriptor(journal_t *journal,
                return;
 
        header = (jbd2_journal_revoke_header_t *)descriptor->b_data;
-       header->r_count = ext2fs_cpu_to_be32(offset);
+       header->r_count = cpu_to_be32(offset);
        jbd2_descriptor_block_csum_set(journal, descriptor);
 
        set_buffer_jwrite(descriptor);