]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/journal.c
Merge ../scsi-misc-2.6
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / journal.c
index ae3440ca083c364f0f1b2f70274ad6278ba5a47e..f92bf1dd379a3faa46482d712c3f861aff8eb98e 100644 (file)
@@ -49,7 +49,7 @@
 
 #include "buffer_head_io.h"
 
-spinlock_t trans_inc_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(trans_inc_lock);
 
 static int ocfs2_force_read_journal(struct inode *inode);
 static int ocfs2_recover_node(struct ocfs2_super *osb,
@@ -117,7 +117,7 @@ struct ocfs2_journal_handle *ocfs2_alloc_handle(struct ocfs2_super *osb)
 {
        struct ocfs2_journal_handle *retval = NULL;
 
-       retval = kcalloc(1, sizeof(*retval), GFP_KERNEL);
+       retval = kcalloc(1, sizeof(*retval), GFP_NOFS);
        if (!retval) {
                mlog(ML_ERROR, "Failed to allocate memory for journal "
                     "handle!\n");
@@ -222,8 +222,7 @@ void ocfs2_handle_add_inode(struct ocfs2_journal_handle *handle,
        BUG_ON(!list_empty(&OCFS2_I(inode)->ip_handle_list));
 
        OCFS2_I(inode)->ip_handle = handle;
-       list_del(&(OCFS2_I(inode)->ip_handle_list));
-       list_add_tail(&(OCFS2_I(inode)->ip_handle_list), &(handle->inode_list));
+       list_move_tail(&(OCFS2_I(inode)->ip_handle_list), &(handle->inode_list));
 }
 
 static void ocfs2_handle_unlock_inodes(struct ocfs2_journal_handle *handle)
@@ -377,7 +376,7 @@ int ocfs2_journal_access(struct ocfs2_journal_handle *handle,
        BUG_ON(!bh);
        BUG_ON(!(handle->flags & OCFS2_HANDLE_STARTED));
 
-       mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %hu\n",
+       mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %zu\n",
                   (unsigned long long)bh->b_blocknr, type,
                   (type == OCFS2_JOURNAL_ACCESS_CREATE) ?
                   "OCFS2_JOURNAL_ACCESS_CREATE" :
@@ -582,7 +581,8 @@ int ocfs2_journal_init(struct ocfs2_journal *journal, int *dirty)
        }
 
        mlog(0, "inode->i_size = %lld\n", inode->i_size);
-       mlog(0, "inode->i_blocks = %lu\n", inode->i_blocks);
+       mlog(0, "inode->i_blocks = %llu\n",
+                       (unsigned long long)inode->i_blocks);
        mlog(0, "inode->ip_clusters = %u\n", OCFS2_I(inode)->ip_clusters);
 
        /* call the kernels journal init function now */
@@ -784,8 +784,7 @@ int ocfs2_journal_load(struct ocfs2_journal *journal)
        }
 
        /* Launch the commit thread */
-       osb->commit_task = kthread_run(ocfs2_commit_thread, osb, "ocfs2cmt-%d",
-                                      osb->osb_id);
+       osb->commit_task = kthread_run(ocfs2_commit_thread, osb, "ocfs2cmt");
        if (IS_ERR(osb->commit_task)) {
                status = PTR_ERR(osb->commit_task);
                osb->commit_task = NULL;
@@ -850,8 +849,9 @@ static int ocfs2_force_read_journal(struct inode *inode)
 
        memset(bhs, 0, sizeof(struct buffer_head *) * CONCURRENT_JOURNAL_FILL);
 
-       mlog(0, "Force reading %lu blocks\n",
-            (inode->i_blocks >> (inode->i_sb->s_blocksize_bits - 9)));
+       mlog(0, "Force reading %llu blocks\n",
+               (unsigned long long)(inode->i_blocks >>
+                       (inode->i_sb->s_blocksize_bits - 9)));
 
        v_blkno = 0;
        while (v_blkno <
@@ -868,9 +868,11 @@ static int ocfs2_force_read_journal(struct inode *inode)
                if (p_blocks > CONCURRENT_JOURNAL_FILL)
                        p_blocks = CONCURRENT_JOURNAL_FILL;
 
+               /* We are reading journal data which should not
+                * be put in the uptodate cache */
                status = ocfs2_read_blocks(OCFS2_SB(inode->i_sb),
                                           p_blkno, p_blocks, bhs, 0,
-                                          inode);
+                                          NULL);
                if (status < 0) {
                        mlog_errno(status);
                        goto bail;
@@ -980,7 +982,7 @@ static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal,
 {
        struct ocfs2_la_recovery_item *item;
 
-       item = kmalloc(sizeof(struct ocfs2_la_recovery_item), GFP_KERNEL);
+       item = kmalloc(sizeof(struct ocfs2_la_recovery_item), GFP_NOFS);
        if (!item) {
                /* Though we wish to avoid it, we are in fact safe in
                 * skipping local alloc cleanup as fsck.ocfs2 is more
@@ -1115,7 +1117,7 @@ void ocfs2_recovery_thread(struct ocfs2_super *osb, int node_num)
                goto out;
 
        osb->recovery_thread_task =  kthread_run(__ocfs2_recovery_thread, osb,
-                                                "ocfs2rec-%d", osb->osb_id);
+                                                "ocfs2rec");
        if (IS_ERR(osb->recovery_thread_task)) {
                mlog_errno((int)PTR_ERR(osb->recovery_thread_task));
                osb->recovery_thread_task = NULL;