MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / journal_alloc_journal_head

Function journal_alloc_journal_head

Ext4Fsd/jbd/replay.c:249–271  ·  view source on GitHub ↗

* journal_head splicing and dicing */

Source from the content-addressed store, hash-verified

247 * journal_head splicing and dicing
248 */
249static struct journal_head *journal_alloc_journal_head(void)
250{
251 struct journal_head *ret;
252 static unsigned long last_warning;
253
254#ifdef CONFIG_JBD_DEBUG
255 atomic_inc(&nr_journal_heads);
256#endif
257 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
258 if (ret == NULL) {
259 jbd_debug(1, "out of memory for journal_head\n");
260 if (time_after(jiffies, last_warning + 5*HZ)) {
261 printk(KERN_NOTICE "ENOMEM in %s, retrying.\n",
262 __FUNCTION__);
263 last_warning = jiffies;
264 }
265 while (ret == NULL) {
266 yield();
267 ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS);
268 }
269 }
270 return ret;
271}
272
273static void journal_free_journal_head(struct journal_head *jh)
274{

Callers 1

journal_add_journal_headFunction · 0.70

Calls 2

atomic_incFunction · 0.85
kmem_cache_allocFunction · 0.85

Tested by

no test coverage detected