source: branches/fc15-dev/server/common/patches/openafs-0008-Linux-2.6.38-dentry-d_count-is-not-an-atomic.patch @ 1908

Last change on this file since 1908 was 1835, checked in by achernya, 13 years ago
OpenAFS builds on F15 Get OpenAFS to build on F15, using the cherry-picked patches.
File size: 2.7 KB
  • acinclude.m4

    From 7c3999e05c928991d22e3eeae2c69e5759c6ea4a Mon Sep 17 00:00:00 2001
    From: Marc Dionne <marc.c.dionne@gmail.com>
    Date: Wed, 2 Feb 2011 21:55:27 -0500
    Subject: [PATCH 8/8] Linux: 2.6.38: dentry->d_count is not an atomic
    
    d_count is now an int protected by the dentry's d_lock.
    Take the lock when we use it, instead of using an atomic_*
    function.
    
    Reviewed-on: http://gerrit.openafs.org/3883
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Derrick Brashear <shadow@dementia.org>
    (cherry picked from commit 281f5bf5fbb0a546edcce62ef4e097ae9bbdbf73)
    
    Change-Id: Id6b17d9cfe18d348a66df02f6b309fc53b00da86
    Signed-off-by: Anders Kaseorg <andersk@mit.edu>
    Reviewed-on: http://gerrit.openafs.org/3999
    Tested-by: BuildBot <buildbot@rampaginggeek.com>
    Reviewed-by: Russ Allbery <rra@stanford.edu>
    Reviewed-on: http://gerrit.openafs.org/4044
    Reviewed-by: Derrick Brashear <shadow@dementia.org>
    Tested-by: Derrick Brashear <shadow@dementia.org>
    ---
     acinclude.m4                 |    1 +
     src/afs/LINUX/osi_vnodeops.c |    9 +++++++++
     src/cf/linux-test4.m4        |   12 ++++++++++++
     3 files changed, 22 insertions(+), 0 deletions(-)
    
    diff --git a/acinclude.m4 b/acinclude.m4
    index 655fb11..c3f5e15 100644
    a b case $AFS_SYSNAME in *_linux* | *_umlinux*) 
    818818                 LINUX_INIT_WORK_HAS_DATA
    819819                 LINUX_REGISTER_SYSCTL_TABLE_NOFLAG
    820820                 LINUX_HAVE_DCACHE_LOCK
     821                 LINUX_D_COUNT_IS_INT
    821822                 LINUX_SYSCTL_TABLE_CHECKING
    822823                 LINUX_STRUCT_CTL_TABLE_HAS_CTL_NAME
    823824                 LINUX_HAVE_IGET
  • src/afs/LINUX/osi_vnodeops.c

    diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
    index e2a3e28..3118ec7 100644
    a b afs_linux_rename(struct inode *oldip, struct dentry *olddp, 
    13961396#endif
    13971397
    13981398#if defined(AFS_LINUX24_ENV)
     1399#if defined(D_COUNT_INT)
     1400    spin_lock(&olddp->d_lock);
     1401    if (olddp->d_count > 1) {
     1402        spin_unlock(&olddp->d_lock);
     1403        shrink_dcache_parent(olddp);
     1404    } else
     1405        spin_unlock(&olddp->d_lock);
     1406#else
    13991407    if (atomic_read(&olddp->d_count) > 1)
    14001408        shrink_dcache_parent(olddp);
    14011409#endif
     1410#endif
    14021411
    14031412    AFS_GLOCK();
    14041413    code = afs_rename(VTOAFS(oldip), oldname, VTOAFS(newip), newname, credp);
  • src/cf/linux-test4.m4

    diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
    index 2f426ce..b428f37 100644
    a b AC_DEFUN([LINUX_HAVE_DCACHE_LOCK], [ 
    13271327                        [])
    13281328])
    13291329
     1330
     1331AC_DEFUN([LINUX_D_COUNT_IS_INT], [
     1332  AC_CHECK_LINUX_BUILD([if dentry->d_count is an int],
     1333                        [ac_cv_linux_d_count_int],
     1334                        [#include <linux/dcache.h> ],
     1335                        [struct dentry _d;
     1336                        dget(&_d);
     1337                        _d.d_count = 1;],
     1338                        [D_COUNT_INT],
     1339                        [define if dentry->d_count is an int],
     1340                        [-Werror])
     1341])
Note: See TracBrowser for help on using the repository browser.