{
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;
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. */
struct buffer_head;
struct inode;
+typedef unsigned int gfp_t;
#define GFP_KERNEL 0
+#define GFP_NOFS 0
+#define __GFP_NOFAIL 0
#define JBD2_TAG_SIZE32 JBD_TAG_SIZE32
#define JBD2_BARRIER 0
typedef __u64 u64;
#define spin_lock_init(x)
#define spin_lock(x)
#define spin_unlock(x)
-#define yield()
#define SLAB_HWCACHE_ALIGN 0
#define SLAB_TEMPORARY 0
#define KMEM_CACHE(__struct, __flags) kmem_cache_create(#__struct,\