Whamcloud - gitweb
LU-2800 autoconf: remove LC_RW_TREE_LOCK test 40/5340/8
authorJames Simmons <uja.ornl@gmail.com>
Sun, 18 Aug 2013 00:12:40 +0000 (20:12 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Tue, 3 Sep 2013 06:23:51 +0000 (06:23 +0000)
address_space.tree_lock has been a spinlock since v2.6.26.
We can remove the test and the dead code.

Change-Id: Ia9204ab7dfe76d053483244347f9a7194ac4e416
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/5340
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_compat25.h
lustre/include/linux/lustre_patchless_compat.h
lustre/llite/dir.c
lustre/llite/llite_lib.c

index bd5e8ae..cad617a 100644 (file)
@@ -329,29 +329,6 @@ AC_DEFUN([LC_CONFIG_GSS],
  fi
 ])
 
-# 2.6.12
-
-# ~2.6.12 merge patch from oracle to convert tree_lock from spinlock to rwlock
-# yet tree_lock is converted from rwlock to spin_lock since v2.6.26
-AC_DEFUN([LC_RW_TREE_LOCK],
-[AC_MSG_CHECKING([if kernel has tree_lock as rwlock])
-tmp_flags="$EXTRA_KCFLAGS"
-EXTRA_KCFLAGS="-Werror"
-LB_LINUX_TRY_COMPILE([
-        #include <linux/fs.h>
-],[
-       struct address_space a;
-
-       write_lock(&a.tree_lock);
-],[
-        AC_MSG_RESULT([yes])
-       AC_DEFINE(HAVE_RW_TREE_LOCK, 1, [kernel has tree_lock as rw_lock])
-],[
-        AC_MSG_RESULT([no])
-])
-EXTRA_KCFLAGS="$tmp_flags"
-])
-
 #2.6.18 + RHEL5 (fc6)
 
 # raid5-zerocopy patch
@@ -1403,9 +1380,6 @@ AC_DEFUN([LC_PROG_LINUX],
          LC_CONFIG_RMTCLIENT
          LC_CONFIG_GSS
 
-         # 2.6.12
-         LC_RW_TREE_LOCK
-
          # raid5-zerocopy patch
          LC_PAGE_CONSTANT
 
index c15c69d..c23e559 100644 (file)
@@ -148,14 +148,6 @@ static inline struct file *ll_dentry_open(struct path *path, int flags,
 # define inode_dio_done(i)             up_read(&(i)->i_alloc_sem)
 #endif
 
-#ifdef HAVE_RW_TREE_LOCK
-#define TREE_READ_LOCK_IRQ(mapping)    read_lock_irq(&(mapping)->tree_lock)
-#define TREE_READ_UNLOCK_IRQ(mapping)  read_unlock_irq(&(mapping)->tree_lock)
-#else
-#define TREE_READ_LOCK_IRQ(mapping)    spin_lock_irq(&(mapping)->tree_lock)
-#define TREE_READ_UNLOCK_IRQ(mapping)  spin_unlock_irq(&(mapping)->tree_lock)
-#endif
-
 #ifndef FS_HAS_FIEMAP
 #define FS_HAS_FIEMAP                  (0)
 #endif
index 1876f94..c948cda 100644 (file)
@@ -54,21 +54,13 @@ static inline void ll_remove_from_page_cache(struct page *page)
 
        BUG_ON(!PageLocked(page));
 
-#ifdef HAVE_RW_TREE_LOCK
-       write_lock_irq(&mapping->tree_lock);
-#else
        spin_lock_irq(&mapping->tree_lock);
-#endif
        radix_tree_delete(&mapping->page_tree, page->index);
        page->mapping = NULL;
        mapping->nrpages--;
        __dec_zone_page_state(page, NR_FILE_PAGES);
 
-#ifdef HAVE_RW_TREE_LOCK
-       write_unlock_irq(&mapping->tree_lock);
-#else
        spin_unlock_irq(&mapping->tree_lock);
-#endif
 }
 #else /* HAVE_REMOVE_FROM_PAGE_CACHE */
 #define ll_remove_from_page_cache(page) remove_from_page_cache(page)
index 870a94c..c90c543 100644 (file)
@@ -273,14 +273,14 @@ static struct page *ll_dir_page_locate(struct inode *dir, __u64 *hash,
         struct page *page;
         int found;
 
-        TREE_READ_LOCK_IRQ(mapping);
+       spin_lock_irq(&mapping->tree_lock);
         found = radix_tree_gang_lookup(&mapping->page_tree,
                                        (void **)&page, offset, 1);
         if (found > 0) {
                 struct lu_dirpage *dp;
 
                 page_cache_get(page);
-                TREE_READ_UNLOCK_IRQ(mapping);
+               spin_unlock_irq(&mapping->tree_lock);
                 /*
                  * In contrast to find_lock_page() we are sure that directory
                  * page cannot be truncated (while DLM lock is held) and,
@@ -324,7 +324,7 @@ static struct page *ll_dir_page_locate(struct inode *dir, __u64 *hash,
                 }
 
         } else {
-                TREE_READ_UNLOCK_IRQ(mapping);
+               spin_unlock_irq(&mapping->tree_lock);
                 page = NULL;
         }
         return page;
index afb5cd1..42e666f 100644 (file)
@@ -1924,8 +1924,8 @@ void ll_delete_inode(struct inode *inode)
 
         /* Workaround for LU-118 */
         if (inode->i_data.nrpages) {
-                TREE_READ_LOCK_IRQ(&inode->i_data);
-                TREE_READ_UNLOCK_IRQ(&inode->i_data);
+               spin_lock_irq(&inode->i_data.tree_lock);
+               spin_unlock_irq(&inode->i_data.tree_lock);
                 LASSERTF(inode->i_data.nrpages == 0,
                          "inode=%lu/%u(%p) nrpages=%lu, see "
                          "http://jira.whamcloud.com/browse/LU-118\n",