]> err.no Git - linux-2.6/commitdiff
ocfs2: remove unused ocfs2_handle_add_inode()
authorMark Fasheh <mark.fasheh@oracle.com>
Sat, 7 Oct 2006 01:51:46 +0000 (18:51 -0700)
committerMark Fasheh <mark.fasheh@oracle.com>
Sat, 2 Dec 2006 02:27:55 +0000 (18:27 -0800)
We can also delete the unused infrastructure which was once in place to
support this functionality. ocfs2_inode_private loses ip_handle and
ip_handle_list. ocfs2_journal_handle loses handle_list.

Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
fs/ocfs2/inode.c
fs/ocfs2/inode.h
fs/ocfs2/journal.c
fs/ocfs2/journal.h
fs/ocfs2/super.c

index 16e8e74dc966d452401d55a8381e5d89afa64737..20e60e4b1f10584fa4282ead59dccf7e8d465747 100644 (file)
@@ -1067,12 +1067,6 @@ void ocfs2_clear_inode(struct inode *inode)
        mlog_bug_on_msg(oi->ip_open_count,
                        "Clear inode of %llu has open count %d\n",
                        (unsigned long long)oi->ip_blkno, oi->ip_open_count);
-       mlog_bug_on_msg(!list_empty(&oi->ip_handle_list),
-                       "Clear inode of %llu has non empty handle list\n",
-                       (unsigned long long)oi->ip_blkno);
-       mlog_bug_on_msg(oi->ip_handle,
-                       "Clear inode of %llu has non empty handle pointer\n",
-                       (unsigned long long)oi->ip_blkno);
 
        /* Clear all other flags. */
        oi->ip_flags = OCFS2_INODE_CACHE_INLINE;
index 9957810fdf85e3b712cc0eef92e9f1606b787309..9b7354545cb4b3f5515cdb0a0fcc444677bea365 100644 (file)
@@ -48,13 +48,6 @@ struct ocfs2_inode_info
 
        struct mutex                    ip_io_mutex;
 
-       /* Used by the journalling code to attach an inode to a
-        * handle.  These are protected by ip_io_mutex in order to lock
-        * out other I/O to the inode until we either commit or
-        * abort. */
-       struct list_head                ip_handle_list;
-       struct ocfs2_journal_handle     *ip_handle;
-
        u32                             ip_flags; /* see below */
        u32                             ip_attr; /* inode attributes */
 
index ca6f2094b0067f9c1657b41f0ae4c91fd18f5690..f02af63e5faef60ca7972c8f3b7717b03346cf51 100644 (file)
@@ -128,7 +128,6 @@ struct ocfs2_journal_handle *ocfs2_alloc_handle(struct ocfs2_super *osb)
        retval->k_handle = NULL;
 
        INIT_LIST_HEAD(&retval->locks);
-       INIT_LIST_HEAD(&retval->inode_list);
        retval->journal = osb->journal;
 
        return retval;
@@ -202,51 +201,12 @@ done_free:
        return ERR_PTR(ret);
 }
 
-void ocfs2_handle_add_inode(struct ocfs2_journal_handle *handle,
-                           struct inode *inode)
-{
-       BUG_ON(!handle);
-       BUG_ON(!inode);
-
-       atomic_inc(&inode->i_count);
-
-       /* we're obviously changing it... */
-       mutex_lock(&inode->i_mutex);
-
-       /* sanity check */
-       BUG_ON(OCFS2_I(inode)->ip_handle);
-       BUG_ON(!list_empty(&OCFS2_I(inode)->ip_handle_list));
-
-       OCFS2_I(inode)->ip_handle = handle;
-       list_move_tail(&(OCFS2_I(inode)->ip_handle_list), &(handle->inode_list));
-}
-
-static void ocfs2_handle_unlock_inodes(struct ocfs2_journal_handle *handle)
-{
-       struct list_head *p, *n;
-       struct inode *inode;
-       struct ocfs2_inode_info *oi;
-
-       list_for_each_safe(p, n, &handle->inode_list) {
-               oi = list_entry(p, struct ocfs2_inode_info,
-                               ip_handle_list);
-               inode = &oi->vfs_inode;
-
-               OCFS2_I(inode)->ip_handle = NULL;
-               list_del_init(&OCFS2_I(inode)->ip_handle_list);
-
-               mutex_unlock(&inode->i_mutex);
-               iput(inode);
-       }
-}
-
 /* This is trivial so we do it out of the main commit
  * paths. Beware, it can be called from start_trans too! */
 static void ocfs2_commit_unstarted_handle(struct ocfs2_journal_handle *handle)
 {
        mlog_entry_void();
 
-       ocfs2_handle_unlock_inodes(handle);
        /* You are allowed to add journal locks before the transaction
         * has started. */
        ocfs2_handle_cleanup_locks(handle->journal, handle);
@@ -272,9 +232,6 @@ void ocfs2_commit_trans(struct ocfs2_journal_handle *handle)
                return;
        }
 
-       /* release inode semaphores we took during this transaction */
-       ocfs2_handle_unlock_inodes(handle);
-
        /* ocfs2_extend_trans may have had to call journal_restart
         * which will always commit the transaction, but may return
         * error for any number of reasons. If this is the case, we
index 6b5d548ca1175f91f4ca5ae7cb1fa5c5e04849e8..3a16d7d88e1c4452abf2230a349c7781e02af7a3 100644 (file)
@@ -149,8 +149,6 @@ struct ocfs2_journal_handle {
        struct list_head    locks;     /* A bunch of locks to
                                        * release on commit. This
                                        * should be a list_head */
-
-       struct list_head     inode_list;
 };
 
 /* Exported only for the journal struct init code in super.c. Do not call. */
@@ -236,7 +234,6 @@ static inline void ocfs2_checkpoint_inode(struct inode *inode)
  *                          ocfs2_handle_add_lock to indicate that a lock needs
  *                          to be released at the end of that handle. Locks
  *                          will be released in the order that they are added.
- *  ocfs2_handle_add_inode - Add a locked inode to a transaction.
  */
 
 /* You must always start_trans with a number of buffs > 0, but it's
@@ -293,12 +290,6 @@ int                  ocfs2_journal_dirty_data(handle_t *handle,
                                              struct buffer_head *bh);
 int                  ocfs2_handle_add_lock(struct ocfs2_journal_handle *handle,
                                           struct inode *inode);
-/*
- * Use this to protect from other processes reading buffer state while
- * it's in flight.
- */
-void                 ocfs2_handle_add_inode(struct ocfs2_journal_handle *handle,
-                                           struct inode *inode);
 
 /*
  *  Credit Macros:
index 76b46ebbb10c1b36f17b11879f329b77433ec825..f3027c2fe2b6a598abfcf97211ca5c218851b7bc 100644 (file)
@@ -914,9 +914,7 @@ static void ocfs2_inode_init_once(void *data,
                oi->ip_open_count = 0;
                spin_lock_init(&oi->ip_lock);
                ocfs2_extent_map_init(&oi->vfs_inode);
-               INIT_LIST_HEAD(&oi->ip_handle_list);
                INIT_LIST_HEAD(&oi->ip_io_markers);
-               oi->ip_handle = NULL;
                oi->ip_created_trans = 0;
                oi->ip_last_trans = 0;
                oi->ip_dir_start_lookup = 0;