Whamcloud - gitweb
b=19024
[fs/lustre-release.git] / lustre / kernel_patches / patches / jbd-stats-2.6-rhel5.patch
index c770722..67832a6 100644 (file)
@@ -1,8 +1,8 @@
-Index: linux-2.6.18-8.1.8/include/linux/jbd.h
+Index: linux-2.6.18-128.1.6/include/linux/jbd.h
 ===================================================================
---- linux-2.6.18-8.1.8.orig/include/linux/jbd.h        2007-08-28 22:22:10.000000000 +0200
-+++ linux-2.6.18-8.1.8/include/linux/jbd.h     2007-08-28 22:22:29.000000000 +0200
-@@ -455,6 +455,16 @@ struct handle_s 
+--- linux-2.6.18-128.1.6.orig/include/linux/jbd.h      2009-06-02 23:22:50.000000000 -0600
++++ linux-2.6.18-128.1.6/include/linux/jbd.h   2009-06-02 23:24:00.000000000 -0600
+@@ -428,6 +428,16 @@
  };
  
  
@@ -19,7 +19,7 @@ Index: linux-2.6.18-8.1.8/include/linux/jbd.h
  /* The transaction_t type is the guts of the journaling mechanism.  It
   * tracks a compound transaction through its various states:
   *
-@@ -592,6 +602,21 @@ struct transaction_s 
+@@ -565,6 +575,21 @@
        spinlock_t              t_handle_lock;
  
        /*
@@ -41,7 +41,7 @@ Index: linux-2.6.18-8.1.8/include/linux/jbd.h
         * Number of outstanding updates running on this transaction
         * [t_handle_lock]
         */
-@@ -631,6 +656,57 @@ struct transaction_s 
+@@ -604,6 +629,57 @@
        struct list_head        t_jcb;
  };
  
@@ -99,7 +99,7 @@ Index: linux-2.6.18-8.1.8/include/linux/jbd.h
  /**
   * struct journal_s - The journal_s type is the concrete type associated with
   *     journal_t.
-@@ -884,6 +960,16 @@ struct journal_s
+@@ -857,6 +933,16 @@
        pid_t                   j_last_sync_writer;
  
        /*
@@ -116,11 +116,11 @@ Index: linux-2.6.18-8.1.8/include/linux/jbd.h
         * An opaque pointer to fs-private information.  ext3 puts its
         * superblock pointer here
         */
-Index: linux-2.6.18-8.1.8/fs/jbd/transaction.c
+Index: linux-2.6.18-128.1.6/fs/jbd/transaction.c
 ===================================================================
---- linux-2.6.18-8.1.8.orig/fs/jbd/transaction.c       2007-08-28 22:22:10.000000000 +0200
-+++ linux-2.6.18-8.1.8/fs/jbd/transaction.c    2007-08-28 22:22:29.000000000 +0200
-@@ -60,6 +60,8 @@ get_transaction(journal_t *journal, tran
+--- linux-2.6.18-128.1.6.orig/fs/jbd/transaction.c     2009-06-02 23:22:50.000000000 -0600
++++ linux-2.6.18-128.1.6/fs/jbd/transaction.c  2009-06-02 23:24:00.000000000 -0600
+@@ -60,6 +60,8 @@
  
        J_ASSERT(journal->j_running_transaction == NULL);
        journal->j_running_transaction = transaction;
@@ -129,7 +129,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/transaction.c
  
        return transaction;
  }
-@@ -86,6 +88,7 @@ static int start_this_handle(journal_t *
+@@ -86,6 +88,7 @@
        int nblocks = handle->h_buffer_credits;
        transaction_t *new_transaction = NULL;
        int ret = 0;
@@ -137,7 +137,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/transaction.c
  
        if (nblocks > journal->j_max_transaction_buffers) {
                printk(KERN_ERR "JBD: %s wants too many credits (%d > %d)\n",
-@@ -219,6 +222,12 @@ repeat_locked:
+@@ -219,6 +222,12 @@
        /* OK, account for the buffers that this operation expects to
         * use and add the handle to the running transaction. */
  
@@ -150,10 +150,10 @@ Index: linux-2.6.18-8.1.8/fs/jbd/transaction.c
        handle->h_transaction = transaction;
        transaction->t_outstanding_credits += nblocks;
        transaction->t_updates++;
-Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
+Index: linux-2.6.18-128.1.6/fs/jbd/journal.c
 ===================================================================
---- linux-2.6.18-8.1.8.orig/fs/jbd/journal.c   2007-08-28 22:22:10.000000000 +0200
-+++ linux-2.6.18-8.1.8/fs/jbd/journal.c        2007-08-28 22:22:29.000000000 +0200
+--- linux-2.6.18-128.1.6.orig/fs/jbd/journal.c 2009-06-02 23:23:03.000000000 -0600
++++ linux-2.6.18-128.1.6/fs/jbd/journal.c      2009-06-02 23:24:00.000000000 -0600
 @@ -36,6 +36,7 @@
  #include <linux/kthread.h>
  #include <linux/poison.h>
@@ -162,7 +162,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
  
  #include <asm/uaccess.h>
  #include <asm/page.h>
-@@ -639,6 +640,300 @@ struct journal_head *journal_get_descrip
+@@ -638,6 +639,300 @@
        return journal_add_journal_head(bh);
  }
  
@@ -463,7 +463,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
  /*
   * Management for journal control blocks: functions to create and
   * destroy journal_t structures, and to initialise and read existing
-@@ -681,6 +976,9 @@ static journal_t * journal_init_common (
+@@ -680,6 +975,9 @@
                kfree(journal);
                goto fail;
        }
@@ -473,7 +473,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
        return journal;
  fail:
        return NULL;
-@@ -724,6 +1022,7 @@ journal_t * journal_init_dev(struct bloc
+@@ -723,6 +1021,7 @@
        journal->j_blk_offset = start;
        journal->j_maxlen = len;
        journal->j_blocksize = blocksize;
@@ -481,7 +481,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
  
        bh = __getblk(journal->j_dev, start, journal->j_blocksize);
        J_ASSERT(bh != NULL);
-@@ -773,6 +1072,7 @@ journal_t * journal_init_inode (struct i
+@@ -772,6 +1071,7 @@
  
        journal->j_maxlen = inode->i_size >> inode->i_sb->s_blocksize_bits;
        journal->j_blocksize = inode->i_sb->s_blocksize;
@@ -489,7 +489,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
  
        /* journal descriptor can store up to n blocks -bzzz */
        n = journal->j_blocksize / sizeof(journal_block_tag_t);
-@@ -1161,6 +1461,8 @@ void journal_destroy(journal_t *journal)
+@@ -1168,6 +1468,8 @@
                brelse(journal->j_sb_buffer);
        }
  
@@ -498,7 +498,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
        if (journal->j_inode)
                iput(journal->j_inode);
        if (journal->j_revoke)
-@@ -2027,6 +2329,28 @@ static void __exit remove_jbd_proc_entry
+@@ -2015,6 +2317,28 @@
  
  #endif
  
@@ -527,7 +527,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
  kmem_cache_t *jbd_handle_cache;
  
  static int __init journal_init_handle_cache(void)
-@@ -2090,6 +2414,7 @@ static int __init journal_init(void)
+@@ -2078,6 +2402,7 @@
        if (ret != 0)
                journal_destroy_caches();
        create_jbd_proc_entry();
@@ -535,7 +535,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
        return ret;
  }
  
-@@ -2101,6 +2426,7 @@ static void __exit journal_exit(void)
+@@ -2089,6 +2414,7 @@
                printk(KERN_EMERG "JBD: leaked %d journal_heads!\n", n);
  #endif
        remove_jbd_proc_entry();
@@ -543,11 +543,11 @@ Index: linux-2.6.18-8.1.8/fs/jbd/journal.c
        journal_destroy_caches();
  }
  
-Index: linux-2.6.18-8.1.8/fs/jbd/checkpoint.c
+Index: linux-2.6.18-128.1.6/fs/jbd/checkpoint.c
 ===================================================================
---- linux-2.6.18-8.1.8.orig/fs/jbd/checkpoint.c        2007-08-28 22:22:10.000000000 +0200
-+++ linux-2.6.18-8.1.8/fs/jbd/checkpoint.c     2007-08-28 22:23:23.000000000 +0200
-@@ -231,7 +231,7 @@ __flush_batch(journal_t *journal, struct
+--- linux-2.6.18-128.1.6.orig/fs/jbd/checkpoint.c      2009-06-02 23:22:50.000000000 -0600
++++ linux-2.6.18-128.1.6/fs/jbd/checkpoint.c   2009-06-02 23:24:00.000000000 -0600
+@@ -242,7 +242,7 @@
   * Called under jbd_lock_bh_state(jh2bh(jh)), and drops it
   */
  static int __process_buffer(journal_t *journal, struct journal_head *jh,
@@ -556,7 +556,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/checkpoint.c
  {
        struct buffer_head *bh = jh2bh(jh);
        int ret = 0;
-@@ -249,6 +249,7 @@ static int __process_buffer(journal_t *j
+@@ -260,6 +260,7 @@
                transaction_t *t = jh->b_transaction;
                tid_t tid = t->t_tid;
  
@@ -564,7 +564,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/checkpoint.c
                spin_unlock(&journal->j_list_lock);
                jbd_unlock_bh_state(bh);
                log_start_commit(journal, tid);
-@@ -278,6 +279,7 @@ static int __process_buffer(journal_t *j
+@@ -291,6 +292,7 @@
                bhs[*batch_count] = bh;
                __buffer_relink_io(jh);
                jbd_unlock_bh_state(bh);
@@ -572,7 +572,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/checkpoint.c
                (*batch_count)++;
                if (*batch_count == NR_BATCH) {
                        spin_unlock(&journal->j_list_lock);
-@@ -321,6 +323,8 @@ int log_do_checkpoint(journal_t *journal
+@@ -336,6 +338,8 @@
        if (!journal->j_checkpoint_transactions)
                goto out;
        transaction = journal->j_checkpoint_transactions;
@@ -581,17 +581,17 @@ Index: linux-2.6.18-8.1.8/fs/jbd/checkpoint.c
        this_tid = transaction->t_tid;
  restart:
        /*
-@@ -345,7 +349,8 @@ restart:
+@@ -360,7 +364,8 @@
                                retry = 1;
                                break;
                        }
 -                      retry = __process_buffer(journal, jh, bhs,&batch_count);
 +                      retry = __process_buffer(journal, jh, bhs,&batch_count,
 +                                               transaction);
-                       if (retry < 0 && !result)
-                               result = retry;
-                       if (!retry && lock_need_resched(&journal->j_list_lock)){
-@@ -667,6 +672,8 @@ void __journal_insert_checkpoint(struct 
+                       if (retry < 0 && !result)
+                               result = retry;
+                       if (!retry && lock_need_resched(&journal->j_list_lock)){
+@@ -692,6 +697,8 @@
  
  void __journal_drop_transaction(journal_t *journal, transaction_t *transaction)
  {
@@ -600,7 +600,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/checkpoint.c
        assert_spin_locked(&journal->j_list_lock);
        if (transaction->t_cpnext) {
                transaction->t_cpnext->t_cpprev = transaction->t_cpprev;
-@@ -693,5 +700,25 @@ void __journal_drop_transaction(journal_
+@@ -718,5 +725,25 @@
        J_ASSERT(journal->j_running_transaction != transaction);
  
        jbd_debug(1, "Dropping transaction %d, all done\n", transaction->t_tid);
@@ -626,10 +626,10 @@ Index: linux-2.6.18-8.1.8/fs/jbd/checkpoint.c
 +
        kfree(transaction);
  }
-Index: linux-2.6.18-8.1.8/fs/jbd/commit.c
+Index: linux-2.6.18-128.1.6/fs/jbd/commit.c
 ===================================================================
---- linux-2.6.18-8.1.8.orig/fs/jbd/commit.c    2007-08-28 22:22:10.000000000 +0200
-+++ linux-2.6.18-8.1.8/fs/jbd/commit.c 2007-08-28 22:22:29.000000000 +0200
+--- linux-2.6.18-128.1.6.orig/fs/jbd/commit.c  2009-06-02 23:22:50.000000000 -0600
++++ linux-2.6.18-128.1.6/fs/jbd/commit.c       2009-06-02 23:24:00.000000000 -0600
 @@ -13,6 +13,7 @@
   * part of the ext2fs journaling system.
   */
@@ -638,15 +638,15 @@ Index: linux-2.6.18-8.1.8/fs/jbd/commit.c
  #include <linux/time.h>
  #include <linux/fs.h>
  #include <linux/jbd.h>
-@@ -23,6 +24,7 @@
+@@ -22,6 +23,7 @@
+ #include <linux/pagemap.h>
  #include <linux/smp_lock.h>
- #include <linux/crc32.h>
  
 +
  /*
   * Default IO end handler for temporary BJ_IO buffer_heads.
   */
-@@ -355,6 +357,7 @@ write_out_data:
+@@ -288,6 +290,7 @@
   */
  void journal_commit_transaction(journal_t *journal)
  {
@@ -654,7 +654,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/commit.c
        transaction_t *commit_transaction;
        struct journal_head *jh, *new_jh, *descriptor;
        struct buffer_head **wbuf = journal->j_wbuf;
-@@ -403,6 +406,11 @@ void journal_commit_transaction(journal_
+@@ -334,6 +337,11 @@
        spin_lock(&journal->j_state_lock);
        commit_transaction->t_state = T_LOCKED;
  
@@ -666,7 +666,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/commit.c
        spin_lock(&commit_transaction->t_handle_lock);
        while (commit_transaction->t_updates) {
                DEFINE_WAIT(wait);
-@@ -473,6 +481,9 @@ void journal_commit_transaction(journal_
+@@ -404,6 +412,9 @@
         */
        journal_switch_revoke_table(journal);
  
@@ -676,9 +676,9 @@ Index: linux-2.6.18-8.1.8/fs/jbd/commit.c
        commit_transaction->t_state = T_FLUSH;
        journal->j_committing_transaction = commit_transaction;
        journal->j_running_transaction = NULL;
-@@ -540,6 +551,11 @@ void journal_commit_transaction(journal_
-        */
-       commit_transaction->t_state = T_COMMIT;
+@@ -484,6 +495,11 @@
+       J_ASSERT(commit_transaction->t_nr_buffers <=
+                commit_transaction->t_outstanding_credits);
  
 +      stats.ts_logging = CURRENT_MSECS;
 +      stats.ts_flushing = jbd_time_diff(stats.ts_flushing, stats.ts_logging);
@@ -688,7 +688,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/commit.c
        descriptor = NULL;
        bufs = 0;
        while (commit_transaction->t_buffers) {
-@@ -698,6 +714,7 @@ start_journal_io:
+@@ -633,6 +649,7 @@
                                submit_bh(WRITE, bh);
                        }
                        cond_resched();
@@ -696,7 +696,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/commit.c
  
                        /* Force a new descriptor to be generated next
                             time round the loop. */
-@@ -915,6 +932,7 @@ restart_loop:
+@@ -832,6 +849,7 @@
                cp_transaction = jh->b_cp_transaction;
                if (cp_transaction) {
                        JBUFFER_TRACE(jh, "remove from old cp transaction");
@@ -704,7 +704,7 @@ Index: linux-2.6.18-8.1.8/fs/jbd/commit.c
                        __journal_remove_checkpoint(jh);
                }
  
-@@ -989,6 +1007,36 @@ restart_loop:
+@@ -908,6 +926,36 @@
  
        J_ASSERT(commit_transaction->t_state == T_COMMIT);
  
@@ -741,4 +741,3 @@ Index: linux-2.6.18-8.1.8/fs/jbd/commit.c
        commit_transaction->t_state = T_FINISHED;
        J_ASSERT(commit_transaction == journal->j_committing_transaction);
        journal->j_commit_sequence = commit_transaction->t_tid;
-