]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ocfs2: Rollback commit f7b1aa69be138ad9d7d3f31fa56f4c9407f56b6a
authorSunil Mushran <sunil.mushran@oracle.com>
Fri, 23 Mar 2012 01:43:54 +0000 (18:43 -0700)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Fri, 23 Mar 2012 01:55:38 +0000 (18:55 -0700)
This patch is part 2 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/super.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 e5ba348183321d133ab7f75c715b305dbed28a07..17e0d3a49c54749afa8c4ecea396799089ca9d48 100644 (file)
@@ -352,19 +352,22 @@ out_attach:
        return ret;
 }
 
-DEFINE_SPINLOCK(dentry_list_lock);
+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 */
-static void __ocfs2_drop_dl_inodes(struct ocfs2_super *osb, int drop_count)
+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 < 0 || drop_count--)) {
+       while (osb->dentry_lock_list && drop_count--) {
                dl = osb->dentry_lock_list;
                osb->dentry_lock_list = dl->dl_next;
                spin_unlock(&dentry_list_lock);
@@ -372,32 +375,11 @@ static void __ocfs2_drop_dl_inodes(struct ocfs2_super *osb, int drop_count)
                kfree(dl);
                spin_lock(&dentry_list_lock);
        }
-       spin_unlock(&dentry_list_lock);
-}
-
-void ocfs2_drop_dl_inodes(struct work_struct *work)
-{
-       struct ocfs2_super *osb = container_of(work, struct ocfs2_super,
-                                              dentry_lock_work);
-
-       __ocfs2_drop_dl_inodes(osb, DL_INODE_DROP_COUNT);
-       /*
-        * Don't queue dropping if umount is in progress. We flush the
-        * list in ocfs2_dismount_volume
-        */
-       spin_lock(&dentry_list_lock);
-       if (osb->dentry_lock_list &&
-           !ocfs2_test_osb_flag(osb, OCFS2_OSB_DROP_DENTRY_LOCK_IMMED))
+       if (osb->dentry_lock_list)
                queue_work(ocfs2_wq, &osb->dentry_lock_work);
        spin_unlock(&dentry_list_lock);
 }
 
-/* Flush the whole work queue */
-void ocfs2_drop_all_dl_inodes(struct ocfs2_super *osb)
-{
-       __ocfs2_drop_dl_inodes(osb, -1);
-}
-
 /*
  * ocfs2_dentry_iput() and friends.
  *
@@ -428,8 +410,7 @@ static void ocfs2_drop_dentry_lock(struct ocfs2_super *osb,
        /* 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 &&
-           !ocfs2_test_osb_flag(osb, OCFS2_OSB_DROP_DENTRY_LOCK_IMMED))
+       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;
index b79eff709958f806ce92f937cbfd7730e4d36a29..b67f781146ac3c58a6fc36f89fb24718149644f5 100644 (file)
@@ -49,13 +49,10 @@ struct ocfs2_dentry_lock {
 int ocfs2_dentry_attach_lock(struct dentry *dentry, struct inode *inode,
                             u64 parent_blkno);
 
-extern spinlock_t dentry_list_lock;
-
 void ocfs2_dentry_lock_put(struct ocfs2_super *osb,
                           struct ocfs2_dentry_lock *dl);
 
 void ocfs2_drop_dl_inodes(struct work_struct *work);
-void ocfs2_drop_all_dl_inodes(struct ocfs2_super *osb);
 
 struct dentry *ocfs2_find_local_alias(struct inode *inode, u64 parent_blkno,
                                      int skip_unhashed);
index 0d06f354db544fdbb0290692fd0f3a9d098cc8fe..5370bea3614982c77665bdc05f44757031dac5de 100644 (file)
@@ -275,12 +275,10 @@ enum ocfs2_mount_options
        OCFS2_MOUNT_COMPAT_OCFS = 1 << 30, /* ocfs1 compatibility mode */
 };
 
-#define OCFS2_OSB_SOFT_RO                      0x0001
-#define OCFS2_OSB_HARD_RO                      0x0002
-#define OCFS2_OSB_ERROR_FS                     0x0004
-#define OCFS2_OSB_DROP_DENTRY_LOCK_IMMED       0x0008
-
-#define OCFS2_DEFAULT_ATIME_QUANTUM            60
+#define OCFS2_OSB_SOFT_RO      0x0001
+#define OCFS2_OSB_HARD_RO      0x0002
+#define OCFS2_OSB_ERROR_FS     0x0004
+#define OCFS2_DEFAULT_ATIME_QUANTUM    60
 
 struct ocfs2_journal;
 struct ocfs2_slot_info;
@@ -580,18 +578,6 @@ static inline void ocfs2_set_osb_flag(struct ocfs2_super *osb,
        spin_unlock(&osb->osb_lock);
 }
 
-
-static inline unsigned long  ocfs2_test_osb_flag(struct ocfs2_super *osb,
-                                                unsigned long flag)
-{
-       unsigned long ret;
-
-       spin_lock(&osb->osb_lock);
-       ret = osb->osb_flags & flag;
-       spin_unlock(&osb->osb_lock);
-       return ret;
-}
-
 static inline void ocfs2_set_ro_flag(struct ocfs2_super *osb,
                                     int hard)
 {
index b838e0ec8ba49058f81597aa48d10379ccae22db..62f78ae5ea1bcf17377ff3db003bf573adada78d 100644 (file)
@@ -1249,26 +1249,13 @@ static struct dentry *ocfs2_mount(struct file_system_type *fs_type,
        return mount_bdev(fs_type, flags, dev_name, data, ocfs2_fill_super);
 }
 
-static void ocfs2_kill_sb(struct super_block *sb)
-{
-       struct ocfs2_super *osb = OCFS2_SB(sb);
-
-       /* Prevent further queueing of inode drop events */
-       spin_lock(&dentry_list_lock);
-       ocfs2_set_osb_flag(osb, OCFS2_OSB_DROP_DENTRY_LOCK_IMMED);
-       spin_unlock(&dentry_list_lock);
-       /* Wait for work to finish and/or remove it */
-       cancel_work_sync(&osb->dentry_lock_work);
-
-       kill_block_super(sb);
-}
-
 static struct file_system_type ocfs2_fs_type = {
        .owner          = THIS_MODULE,
        .name           = "ocfs2",
        .mount          = ocfs2_mount,
-       .kill_sb        = ocfs2_kill_sb,
-
+       .kill_sb        = kill_block_super, /* set to the generic one
+                                            * right now, but do we
+                                            * need to change that? */
        .fs_flags       = FS_REQUIRES_DEV|FS_RENAME_DOES_D_MOVE,
        .next           = NULL
 };
@@ -1949,12 +1936,6 @@ static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err)
 
        debugfs_remove(osb->osb_ctxt);
 
-       /*
-        * Flush inode dropping work queue so that deletes are
-        * performed while the filesystem is still working
-        */
-       ocfs2_drop_all_dl_inodes(osb);
-
        /* Orphan scan should be stopped as early as possible */
        ocfs2_orphan_scan_stop(osb);