ocfs2: Remove JBD compatibility layer
authorMark Fasheh <mfasheh@suse.com>
Wed, 19 Nov 2008 00:53:43 +0000 (16:53 -0800)
committerMark Fasheh <mfasheh@suse.com>
Mon, 5 Jan 2009 16:36:55 +0000 (08:36 -0800)
JBD2 is fully backwards compatible with JBD and it's been tested enough with
Ocfs2 that we can clean this code up now.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/Kconfig
fs/ocfs2/alloc.c
fs/ocfs2/aops.c
fs/ocfs2/journal.c
fs/ocfs2/journal.h
fs/ocfs2/ocfs2_jbd_compat.h [deleted file]

index e8a47f7..b93425a 100644 (file)
@@ -258,16 +258,6 @@ config OCFS2_DEBUG_FS
          this option for debugging only as it is likely to decrease
          performance of the filesystem.
 
-config OCFS2_COMPAT_JBD
-       bool "Use JBD for compatibility"
-       depends on OCFS2_FS
-       default n
-       select JBD
-       help
-         The ocfs2 filesystem now uses JBD2 for its journalling.  JBD2
-         is backwards compatible with JBD.  It is safe to say N here.
-         However, if you really want to use the original JBD, say Y here.
-
 config OCFS2_FS_POSIX_ACL
        bool "OCFS2 POSIX Access Control Lists"
        depends on OCFS2_FS
index e823a27..69d67ab 100644 (file)
@@ -6638,11 +6638,6 @@ static void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle,
                mlog_errno(ret);
        else if (ocfs2_should_order_data(inode)) {
                ret = ocfs2_jbd2_file_inode(handle, inode);
-#ifdef CONFIG_OCFS2_COMPAT_JBD
-               ret = walk_page_buffers(handle, page_buffers(page),
-                                       from, to, &partial,
-                                       ocfs2_journal_dirty_data);
-#endif
                if (ret < 0)
                        mlog_errno(ret);
        }
index e219f8b..6af79ad 100644 (file)
@@ -474,12 +474,6 @@ handle_t *ocfs2_start_walk_page_trans(struct inode *inode,
 
        if (ocfs2_should_order_data(inode)) {
                ret = ocfs2_jbd2_file_inode(handle, inode);
-#ifdef CONFIG_OCFS2_COMPAT_JBD
-               ret = walk_page_buffers(handle,
-                                       page_buffers(page),
-                                       from, to, NULL,
-                                       ocfs2_journal_dirty_data);
-#endif
                if (ret < 0)
                        mlog_errno(ret);
        }
@@ -1065,15 +1059,8 @@ static void ocfs2_write_failure(struct inode *inode,
                tmppage = wc->w_pages[i];
 
                if (page_has_buffers(tmppage)) {
-                       if (ocfs2_should_order_data(inode)) {
+                       if (ocfs2_should_order_data(inode))
                                ocfs2_jbd2_file_inode(wc->w_handle, inode);
-#ifdef CONFIG_OCFS2_COMPAT_JBD
-                               walk_page_buffers(wc->w_handle,
-                                                 page_buffers(tmppage),
-                                                 from, to, NULL,
-                                                 ocfs2_journal_dirty_data);
-#endif
-                       }
 
                        block_commit_write(tmppage, from, to);
                }
@@ -1912,15 +1899,8 @@ int ocfs2_write_end_nolock(struct address_space *mapping,
                }
 
                if (page_has_buffers(tmppage)) {
-                       if (ocfs2_should_order_data(inode)) {
+                       if (ocfs2_should_order_data(inode))
                                ocfs2_jbd2_file_inode(wc->w_handle, inode);
-#ifdef CONFIG_OCFS2_COMPAT_JBD
-                               walk_page_buffers(wc->w_handle,
-                                                 page_buffers(tmppage),
-                                                 from, to, NULL,
-                                                 ocfs2_journal_dirty_data);
-#endif
-                       }
                        block_commit_write(tmppage, from, to);
                }
        }
index 9223bfc..12b62a3 100644 (file)
@@ -434,20 +434,6 @@ int ocfs2_journal_dirty(handle_t *handle,
        return status;
 }
 
-#ifdef CONFIG_OCFS2_COMPAT_JBD
-int ocfs2_journal_dirty_data(handle_t *handle,
-                            struct buffer_head *bh)
-{
-       int err = journal_dirty_data(handle, bh);
-       if (err)
-               mlog_errno(err);
-       /* TODO: When we can handle it, abort the handle and go RO on
-        * error here. */
-
-       return err;
-}
-#endif
-
 #define OCFS2_DEFAULT_COMMIT_INTERVAL  (HZ * JBD2_DEFAULT_MAX_COMMIT_AGE)
 
 void ocfs2_set_journal_params(struct ocfs2_super *osb)
index d4d14e9..8203980 100644 (file)
 #define OCFS2_JOURNAL_H
 
 #include <linux/fs.h>
-#ifndef CONFIG_OCFS2_COMPAT_JBD
-# include <linux/jbd2.h>
-#else
-# include <linux/jbd.h>
-# include "ocfs2_jbd_compat.h"
-#endif
+#include <linux/jbd2.h>
 
 enum ocfs2_journal_state {
        OCFS2_JOURNAL_FREE = 0,
@@ -273,10 +268,6 @@ int                  ocfs2_journal_access(handle_t *handle,
  */
 int                  ocfs2_journal_dirty(handle_t *handle,
                                         struct buffer_head *bh);
-#ifdef CONFIG_OCFS2_COMPAT_JBD
-int                  ocfs2_journal_dirty_data(handle_t *handle,
-                                             struct buffer_head *bh);
-#endif
 
 /*
  *  Credit Macros:
diff --git a/fs/ocfs2/ocfs2_jbd_compat.h b/fs/ocfs2/ocfs2_jbd_compat.h
deleted file mode 100644 (file)
index b91c78f..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- mode: c; c-basic-offset: 8; -*-
- * vim: noexpandtab sw=8 ts=8 sts=0:
- *
- * ocfs2_jbd_compat.h
- *
- * Compatibility defines for JBD.
- *
- * Copyright (C) 2008 Oracle.  All rights reserved.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- */
-
-#ifndef OCFS2_JBD_COMPAT_H
-#define OCFS2_JBD_COMPAT_H
-
-#ifndef CONFIG_OCFS2_COMPAT_JBD
-# error Should not have been included
-#endif
-
-struct jbd2_inode {
-       unsigned int dummy;
-};
-
-#define JBD2_BARRIER                   JFS_BARRIER
-#define JBD2_DEFAULT_MAX_COMMIT_AGE    JBD_DEFAULT_MAX_COMMIT_AGE
-
-#define jbd2_journal_ack_err                   journal_ack_err
-#define jbd2_journal_clear_err                 journal_clear_err
-#define jbd2_journal_destroy                   journal_destroy
-#define jbd2_journal_dirty_metadata            journal_dirty_metadata
-#define jbd2_journal_errno                     journal_errno
-#define jbd2_journal_extend                    journal_extend
-#define jbd2_journal_flush                     journal_flush
-#define jbd2_journal_force_commit              journal_force_commit
-#define jbd2_journal_get_write_access          journal_get_write_access
-#define jbd2_journal_get_undo_access           journal_get_undo_access
-#define jbd2_journal_init_inode                        journal_init_inode
-#define jbd2_journal_invalidatepage            journal_invalidatepage
-#define jbd2_journal_load                      journal_load
-#define jbd2_journal_lock_updates              journal_lock_updates
-#define jbd2_journal_restart                   journal_restart
-#define jbd2_journal_start                     journal_start
-#define jbd2_journal_start_commit              journal_start_commit
-#define jbd2_journal_stop                      journal_stop
-#define jbd2_journal_try_to_free_buffers       journal_try_to_free_buffers
-#define jbd2_journal_unlock_updates            journal_unlock_updates
-#define jbd2_journal_wipe                      journal_wipe
-#define jbd2_log_wait_commit                   log_wait_commit
-
-static inline int jbd2_journal_file_inode(handle_t *handle,
-                                         struct jbd2_inode *inode)
-{
-       return 0;
-}
-
-static inline int jbd2_journal_begin_ordered_truncate(struct jbd2_inode *inode,
-                                                     loff_t new_size)
-{
-       return 0;
-}
-
-static inline void jbd2_journal_init_jbd_inode(struct jbd2_inode *jinode,
-                                              struct inode *inode)
-{
-       return;
-}
-
-static inline void jbd2_journal_release_jbd_inode(journal_t *journal,
-                                                 struct jbd2_inode *jinode)
-{
-       return;
-}
-
-
-#endif  /* OCFS2_JBD_COMPAT_H */