and changed files
[powerpc.git] / fs / ocfs2 / journal.h
index 899112a..3db5de4 100644 (file)
@@ -157,7 +157,7 @@ int    ocfs2_journal_init(struct ocfs2_journal *journal,
 void   ocfs2_journal_shutdown(struct ocfs2_super *osb);
 int    ocfs2_journal_wipe(struct ocfs2_journal *journal,
                          int full);
-int    ocfs2_journal_load(struct ocfs2_journal *journal);
+int    ocfs2_journal_load(struct ocfs2_journal *journal, int local);
 int    ocfs2_check_journals_nolocks(struct ocfs2_super *osb);
 void   ocfs2_recovery_thread(struct ocfs2_super *osb,
                             int node_num);
@@ -174,6 +174,9 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode)
 {
        struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 
+       if (ocfs2_mount_local(osb))
+               return;
+
        if (!ocfs2_inode_fully_checkpointed(inode)) {
                /* WARNING: This only kicks off a single
                 * checkpoint. If someone races you and adds more
@@ -303,8 +306,8 @@ int                  ocfs2_journal_dirty_data(handle_t *handle,
  * for the dinode, one for the new block. */
 #define OCFS2_SIMPLE_DIR_EXTEND_CREDITS (2)
 
-/* file update (nlink, etc) + dir entry block */
-#define OCFS2_LINK_CREDITS  (OCFS2_INODE_UPDATE_CREDITS + 1)
+/* file update (nlink, etc) + directory mtime/ctime + dir entry block */
+#define OCFS2_LINK_CREDITS  (2*OCFS2_INODE_UPDATE_CREDITS + 1)
 
 /* inode + dir inode (if we unlink a dir), + dir entry block + orphan
  * dir inode link */
@@ -387,7 +390,7 @@ static inline int ocfs2_calc_tree_trunc_credits(struct super_block *sb,
        /* We may be deleting metadata blocks, so metadata alloc dinode +
           one desc. block for each possible delete. */
        if (tree_depth && next_free == 1 &&
-           le32_to_cpu(last_el->l_recs[i].e_clusters) == clusters_to_del)
+           ocfs2_rec_clusters(last_el, &last_el->l_recs[i]) == clusters_to_del)
                credits += 1 + tree_depth;
 
        /* update to the truncate log. */