journal.c (9fff24aa2c5c504aadead1ff9599e813604c2e53) | journal.c (b6e96d0067d81f6a300bedee661b5ece8164e210) |
---|---|
1/* 2 * linux/fs/jbd2/journal.c 3 * 4 * Written by Stephen C. Tweedie <sct@redhat.com>, 1998 5 * 6 * Copyright 1998 Red Hat corp --- All Rights Reserved 7 * 8 * This file is part of the Linux kernel and is made available under --- 21 unchanged lines hidden (view full) --- 30#include <linux/slab.h> 31#include <linux/init.h> 32#include <linux/mm.h> 33#include <linux/freezer.h> 34#include <linux/pagemap.h> 35#include <linux/kthread.h> 36#include <linux/poison.h> 37#include <linux/proc_fs.h> | 1/* 2 * linux/fs/jbd2/journal.c 3 * 4 * Written by Stephen C. Tweedie <sct@redhat.com>, 1998 5 * 6 * Copyright 1998 Red Hat corp --- All Rights Reserved 7 * 8 * This file is part of the Linux kernel and is made available under --- 21 unchanged lines hidden (view full) --- 30#include <linux/slab.h> 31#include <linux/init.h> 32#include <linux/mm.h> 33#include <linux/freezer.h> 34#include <linux/pagemap.h> 35#include <linux/kthread.h> 36#include <linux/poison.h> 37#include <linux/proc_fs.h> |
38#include <linux/debugfs.h> | |
39#include <linux/seq_file.h> 40#include <linux/math64.h> 41#include <linux/hash.h> 42#include <linux/log2.h> 43#include <linux/vmalloc.h> 44#include <linux/backing-dev.h> 45#include <linux/bitops.h> 46#include <linux/ratelimit.h> 47 48#define CREATE_TRACE_POINTS 49#include <trace/events/jbd2.h> 50 51#include <asm/uaccess.h> 52#include <asm/page.h> 53 | 38#include <linux/seq_file.h> 39#include <linux/math64.h> 40#include <linux/hash.h> 41#include <linux/log2.h> 42#include <linux/vmalloc.h> 43#include <linux/backing-dev.h> 44#include <linux/bitops.h> 45#include <linux/ratelimit.h> 46 47#define CREATE_TRACE_POINTS 48#include <trace/events/jbd2.h> 49 50#include <asm/uaccess.h> 51#include <asm/page.h> 52 |
53#ifdef CONFIG_JBD2_DEBUG 54ushort jbd2_journal_enable_debug __read_mostly; 55EXPORT_SYMBOL(jbd2_journal_enable_debug); 56 57module_param_named(jbd2_debug, jbd2_journal_enable_debug, ushort, 0644); 58MODULE_PARM_DESC(jbd2_debug, "Debugging level for jbd2"); 59#endif 60 |
|
54EXPORT_SYMBOL(jbd2_journal_extend); 55EXPORT_SYMBOL(jbd2_journal_stop); 56EXPORT_SYMBOL(jbd2_journal_lock_updates); 57EXPORT_SYMBOL(jbd2_journal_unlock_updates); 58EXPORT_SYMBOL(jbd2_journal_get_write_access); 59EXPORT_SYMBOL(jbd2_journal_get_create_access); 60EXPORT_SYMBOL(jbd2_journal_get_undo_access); 61EXPORT_SYMBOL(jbd2_journal_set_triggers); --- 2428 unchanged lines hidden (view full) --- 2490 2491 if (jinode->i_transaction) { 2492 list_del(&jinode->i_list); 2493 jinode->i_transaction = NULL; 2494 } 2495 spin_unlock(&journal->j_list_lock); 2496} 2497 | 61EXPORT_SYMBOL(jbd2_journal_extend); 62EXPORT_SYMBOL(jbd2_journal_stop); 63EXPORT_SYMBOL(jbd2_journal_lock_updates); 64EXPORT_SYMBOL(jbd2_journal_unlock_updates); 65EXPORT_SYMBOL(jbd2_journal_get_write_access); 66EXPORT_SYMBOL(jbd2_journal_get_create_access); 67EXPORT_SYMBOL(jbd2_journal_get_undo_access); 68EXPORT_SYMBOL(jbd2_journal_set_triggers); --- 2428 unchanged lines hidden (view full) --- 2497 2498 if (jinode->i_transaction) { 2499 list_del(&jinode->i_list); 2500 jinode->i_transaction = NULL; 2501 } 2502 spin_unlock(&journal->j_list_lock); 2503} 2504 |
2498/* 2499 * debugfs tunables 2500 */ 2501#ifdef CONFIG_JBD2_DEBUG 2502u8 jbd2_journal_enable_debug __read_mostly; 2503EXPORT_SYMBOL(jbd2_journal_enable_debug); | |
2504 | 2505 |
2505#define JBD2_DEBUG_NAME "jbd2-debug" 2506 2507static struct dentry *jbd2_debugfs_dir; 2508static struct dentry *jbd2_debug; 2509 2510static void __init jbd2_create_debugfs_entry(void) 2511{ 2512 jbd2_debugfs_dir = debugfs_create_dir("jbd2", NULL); 2513 if (jbd2_debugfs_dir) 2514 jbd2_debug = debugfs_create_u8(JBD2_DEBUG_NAME, 2515 S_IRUGO | S_IWUSR, 2516 jbd2_debugfs_dir, 2517 &jbd2_journal_enable_debug); 2518} 2519 2520static void __exit jbd2_remove_debugfs_entry(void) 2521{ 2522 debugfs_remove(jbd2_debug); 2523 debugfs_remove(jbd2_debugfs_dir); 2524} 2525 2526#else 2527 2528static void __init jbd2_create_debugfs_entry(void) 2529{ 2530} 2531 2532static void __exit jbd2_remove_debugfs_entry(void) 2533{ 2534} 2535 2536#endif 2537 | |
2538#ifdef CONFIG_PROC_FS 2539 2540#define JBD2_STATS_PROC_NAME "fs/jbd2" 2541 2542static void __init jbd2_create_jbd_stats_proc_entry(void) 2543{ 2544 proc_jbd2_stats = proc_mkdir(JBD2_STATS_PROC_NAME, NULL); 2545} --- 68 unchanged lines hidden (view full) --- 2614static int __init journal_init(void) 2615{ 2616 int ret; 2617 2618 BUILD_BUG_ON(sizeof(struct journal_superblock_s) != 1024); 2619 2620 ret = journal_init_caches(); 2621 if (ret == 0) { | 2506#ifdef CONFIG_PROC_FS 2507 2508#define JBD2_STATS_PROC_NAME "fs/jbd2" 2509 2510static void __init jbd2_create_jbd_stats_proc_entry(void) 2511{ 2512 proc_jbd2_stats = proc_mkdir(JBD2_STATS_PROC_NAME, NULL); 2513} --- 68 unchanged lines hidden (view full) --- 2582static int __init journal_init(void) 2583{ 2584 int ret; 2585 2586 BUILD_BUG_ON(sizeof(struct journal_superblock_s) != 1024); 2587 2588 ret = journal_init_caches(); 2589 if (ret == 0) { |
2622 jbd2_create_debugfs_entry(); | |
2623 jbd2_create_jbd_stats_proc_entry(); 2624 } else { 2625 jbd2_journal_destroy_caches(); 2626 } 2627 return ret; 2628} 2629 2630static void __exit journal_exit(void) 2631{ 2632#ifdef CONFIG_JBD2_DEBUG 2633 int n = atomic_read(&nr_journal_heads); 2634 if (n) 2635 printk(KERN_EMERG "JBD2: leaked %d journal_heads!\n", n); 2636#endif | 2590 jbd2_create_jbd_stats_proc_entry(); 2591 } else { 2592 jbd2_journal_destroy_caches(); 2593 } 2594 return ret; 2595} 2596 2597static void __exit journal_exit(void) 2598{ 2599#ifdef CONFIG_JBD2_DEBUG 2600 int n = atomic_read(&nr_journal_heads); 2601 if (n) 2602 printk(KERN_EMERG "JBD2: leaked %d journal_heads!\n", n); 2603#endif |
2637 jbd2_remove_debugfs_entry(); | |
2638 jbd2_remove_jbd_stats_proc_entry(); 2639 jbd2_journal_destroy_caches(); 2640} 2641 2642MODULE_LICENSE("GPL"); 2643module_init(journal_init); 2644module_exit(journal_exit); 2645 | 2604 jbd2_remove_jbd_stats_proc_entry(); 2605 jbd2_journal_destroy_caches(); 2606} 2607 2608MODULE_LICENSE("GPL"); 2609module_init(journal_init); 2610module_exit(journal_exit); 2611 |