]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ocfs2: Rollback commit ea455f8ab68338ba69f5d3362b342c115bea8e13
authorSunil Mushran <sunil.mushran@oracle.com>
Fri, 23 Mar 2012 01:44:51 +0000 (18:44 -0700)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Fri, 23 Mar 2012 01:55:44 +0000 (18:55 -0700)
This patch is part 3 of 3 patches that rolls back changes that appear
to have broken delete.

Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Conflicts:

fs/ocfs2/dcache.c

Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
fs/ocfs2/dcache.c
fs/ocfs2/dcache.h
fs/ocfs2/ocfs2.h
fs/ocfs2/super.c

index 17e0d3a49c54749afa8c4ecea396799089ca9d48..5472e616d1e98714e9cd2c3f9dab9053d26c500c 100644 (file)
@@ -37,7 +37,6 @@
 #include "dlmglue.h"
 #include "file.h"
 #include "inode.h"
-#include "super.h"
 #include "ocfs2_trace.h"
 
 void ocfs2_dentry_attach_gen(struct dentry *dentry)
@@ -352,34 +351,6 @@ out_attach:
        return ret;
 }
 
-static DEFINE_SPINLOCK(dentry_list_lock);
-
-/* We limit the number of dentry locks to drop in one go. We have
- * this limit so that we don't starve other users of ocfs2_wq. */
-#define DL_INODE_DROP_COUNT 64
-
-/* Drop inode references from dentry locks */
-void ocfs2_drop_dl_inodes(struct work_struct *work)
-{
-       struct ocfs2_super *osb = container_of(work, struct ocfs2_super,
-                                              dentry_lock_work);
-       struct ocfs2_dentry_lock *dl;
-       int drop_count = DL_INODE_DROP_COUNT;
-
-       spin_lock(&dentry_list_lock);
-       while (osb->dentry_lock_list && drop_count--) {
-               dl = osb->dentry_lock_list;
-               osb->dentry_lock_list = dl->dl_next;
-               spin_unlock(&dentry_list_lock);
-               iput(dl->dl_inode);
-               kfree(dl);
-               spin_lock(&dentry_list_lock);
-       }
-       if (osb->dentry_lock_list)
-               queue_work(ocfs2_wq, &osb->dentry_lock_work);
-       spin_unlock(&dentry_list_lock);
-}
-
 /*
  * ocfs2_dentry_iput() and friends.
  *
@@ -404,23 +375,16 @@ void ocfs2_drop_dl_inodes(struct work_struct *work)
 static void ocfs2_drop_dentry_lock(struct ocfs2_super *osb,
                                   struct ocfs2_dentry_lock *dl)
 {
+       iput(dl->dl_inode);
        ocfs2_simple_drop_lockres(osb, &dl->dl_lockres);
        ocfs2_lock_res_free(&dl->dl_lockres);
-
-       /* We leave dropping of inode reference to ocfs2_wq as that can
-        * possibly lead to inode deletion which gets tricky */
-       spin_lock(&dentry_list_lock);
-       if (!osb->dentry_lock_list)
-               queue_work(ocfs2_wq, &osb->dentry_lock_work);
-       dl->dl_next = osb->dentry_lock_list;
-       osb->dentry_lock_list = dl;
-       spin_unlock(&dentry_list_lock);
+       kfree(dl);
 }
 
 void ocfs2_dentry_lock_put(struct ocfs2_super *osb,
                           struct ocfs2_dentry_lock *dl)
 {
-       int unlock;
+       int unlock = 0;
 
        BUG_ON(dl->dl_count == 0);
 
index b67f781146ac3c58a6fc36f89fb24718149644f5..55f58892b153ab3a4a953928d0423aadba62ba86 100644 (file)
 extern const struct dentry_operations ocfs2_dentry_ops;
 
 struct ocfs2_dentry_lock {
-       /* Use count of dentry lock */
        unsigned int            dl_count;
-       union {
-               /* Linked list of dentry locks to release */
-               struct ocfs2_dentry_lock *dl_next;
-               u64                     dl_parent_blkno;
-       };
+       u64                     dl_parent_blkno;
 
        /*
         * The ocfs2_dentry_lock keeps an inode reference until
@@ -52,8 +47,6 @@ int ocfs2_dentry_attach_lock(struct dentry *dentry, struct inode *inode,
 void ocfs2_dentry_lock_put(struct ocfs2_super *osb,
                           struct ocfs2_dentry_lock *dl);
 
-void ocfs2_drop_dl_inodes(struct work_struct *work);
-
 struct dentry *ocfs2_find_local_alias(struct inode *inode, u64 parent_blkno,
                                      int skip_unhashed);
 
index 5370bea3614982c77665bdc05f44757031dac5de..b9ac900acf4180c7884206c74973d6e5d83e72b4 100644 (file)
@@ -285,7 +285,6 @@ struct ocfs2_slot_info;
 struct ocfs2_recovery_map;
 struct ocfs2_replay_map;
 struct ocfs2_quota_recovery;
-struct ocfs2_dentry_lock;
 struct ocfs2_super
 {
        struct task_struct *commit_task;
@@ -413,11 +412,6 @@ struct ocfs2_super
        struct list_head blocked_lock_list;
        unsigned long blocked_lock_count;
 
-       /* List of dentry locks to release. Anyone can add locks to
-        * the list, ocfs2_wq processes the list  */
-       struct ocfs2_dentry_lock *dentry_lock_list;
-       struct work_struct dentry_lock_work;
-
        wait_queue_head_t               osb_mount_event;
 
        /* Truncate log info */
index 62f78ae5ea1bcf17377ff3db003bf573adada78d..63aca10e838110ad65e8182b2e6e7a7925788062 100644 (file)
@@ -2269,9 +2269,6 @@ static int ocfs2_initialize_super(struct super_block *sb,
        INIT_WORK(&journal->j_recovery_work, ocfs2_complete_recovery);
        journal->j_state = OCFS2_JOURNAL_FREE;
 
-       INIT_WORK(&osb->dentry_lock_work, ocfs2_drop_dl_inodes);
-       osb->dentry_lock_list = NULL;
-
        /* get some pseudo constants for clustersize bits */
        osb->s_clustersize_bits =
                le32_to_cpu(di->id2.i_super.s_clustersize_bits);