* journal_head splicing and dicing */
| 247 | * journal_head splicing and dicing |
| 248 | */ |
| 249 | static 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 | |
| 273 | static void journal_free_journal_head(struct journal_head *jh) |
| 274 | { |
no test coverage detected