Changeset 8842

Show
Ignore:
Timestamp:
05/25/11 16:55:16 (2 years ago)
Author:
mtmoore
Message:

update configure checks and kernel code for 2.6.38

Location:
branches/Orange-Branch
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • branches/Orange-Branch/configure

    r8836 r8842  
    71777177rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
    71787178 
     7179                        tmp_cflags=$CFLAGS 
     7180        CFLAGS="$CFLAGS -Werror" 
     7181        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for four-param generic_permission" >&5 
     7182$as_echo_n "checking for four-param generic_permission... " >&6; } 
     7183        cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     7184/* end confdefs.h.  */ 
     7185 
     7186                #define __KERNEL__ 
     7187                #include <linux/fs.h> 
     7188                struct inode *f; 
     7189 
     7190int 
     7191main () 
     7192{ 
     7193 
     7194                generic_permission(f, 0, 0, NULL); 
     7195 
     7196  ; 
     7197  return 0; 
     7198} 
     7199_ACEOF 
     7200if ac_fn_c_try_compile "$LINENO"; then : 
     7201  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 
     7202$as_echo "yes" >&6; } 
     7203 
     7204$as_echo "#define HAVE_FOUR_PARAM_GENERIC_PERMISSION 1" >>confdefs.h 
     7205 
     7206else 
     7207  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     7208$as_echo "no" >&6; } 
     7209 
     7210fi 
     7211rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     7212 
    71797213        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for generic_getxattr api in kernel" >&5 
    71807214$as_echo_n "checking for generic_getxattr api in kernel... " >&6; } 
     
    87218755        CFLAGS=$tmp_cflags 
    87228756 
    8723  
     8757                        tmp_cflags=$CFLAGS 
     8758        CFLAGS="$CFLAGS -Werror" 
     8759        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for three-param dentry_operations.d_hash" >&5 
     8760$as_echo_n "checking for three-param dentry_operations.d_hash... " >&6; } 
     8761        cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     8762/* end confdefs.h.  */ 
     8763 
     8764                #define __KERNEL__ 
     8765                #include <linux/fs.h> 
     8766                #include <linux/dcache.h> 
     8767                static struct dentry_operations d; 
     8768                static int d_hash_t(const struct dentry *d, 
     8769                                    const struct inode *i, 
     8770                                    struct qstr * q) 
     8771                { return 0; } 
     8772 
     8773int 
     8774main () 
     8775{ 
     8776 
     8777                d.d_hash = d_hash_t; 
     8778 
     8779  ; 
     8780  return 0; 
     8781} 
     8782_ACEOF 
     8783if ac_fn_c_try_compile "$LINENO"; then : 
     8784  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 
     8785$as_echo "yes" >&6; } 
     8786 
     8787$as_echo "#define HAVE_THREE_PARAM_D_HASH 1" >>confdefs.h 
     8788 
     8789else 
     8790  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     8791$as_echo "no" >&6; } 
     8792 
     8793fi 
     8794rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     8795        CFLAGS=$tmp_cflags 
     8796 
     8797 
     8798                                tmp_cflags=$CFLAGS 
     8799        CFLAGS="$CFLAGS -Werror" 
     8800        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for seven-param dentry_operations.d_compare" >&5 
     8801$as_echo_n "checking for seven-param dentry_operations.d_compare... " >&6; } 
     8802        cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     8803/* end confdefs.h.  */ 
     8804 
     8805                #define __KERNEL__ 
     8806                #include <linux/fs.h> 
     8807                #include <linux/dcache.h> 
     8808                static struct dentry_operations d; 
     8809                static int d_compare_t(const struct dentry *d1, 
     8810                                       const struct inode *i1, 
     8811                                       const struct dentry *d2, 
     8812                                       const struct inode *i2, 
     8813                                       unsigned int len, 
     8814                                       const char *str, 
     8815                                       const struct qstr *qstr) 
     8816                { return 0; } 
     8817 
     8818int 
     8819main () 
     8820{ 
     8821 
     8822                d.d_compare = d_compare_t; 
     8823 
     8824  ; 
     8825  return 0; 
     8826} 
     8827_ACEOF 
     8828if ac_fn_c_try_compile "$LINENO"; then : 
     8829  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 
     8830$as_echo "yes" >&6; } 
     8831 
     8832$as_echo "#define HAVE_SEVEN_PARAM_D_COMPARE 1" >>confdefs.h 
     8833 
     8834else 
     8835  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     8836$as_echo "no" >&6; } 
     8837 
     8838fi 
     8839rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     8840        CFLAGS=$tmp_cflags 
     8841 
     8842 
     8843                        tmp_cflags=$CFLAGS 
     8844        CFLAGS="$CFLAGS -Werror" 
     8845        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for constified dentry_operations.d_delete" >&5 
     8846$as_echo_n "checking for constified dentry_operations.d_delete... " >&6; } 
     8847        cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     8848/* end confdefs.h.  */ 
     8849 
     8850                #define __KERNEL__ 
     8851                #include <linux/fs.h> 
     8852                #include <linux/dcache.h> 
     8853                static struct dentry_operations d; 
     8854                static int d_delete_t(const struct dentry *d) 
     8855                { return 0; } 
     8856 
     8857int 
     8858main () 
     8859{ 
     8860 
     8861                d.d_delete = d_delete_t; 
     8862 
     8863  ; 
     8864  return 0; 
     8865} 
     8866_ACEOF 
     8867if ac_fn_c_try_compile "$LINENO"; then : 
     8868  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 
     8869$as_echo "yes" >&6; } 
     8870 
     8871$as_echo "#define HAVE_D_DELETE_CONST 1" >>confdefs.h 
     8872 
     8873else 
     8874  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     8875$as_echo "no" >&6; } 
     8876 
     8877fi 
     8878rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     8879        CFLAGS=$tmp_cflags 
     8880 
     8881                        tmp_cflags=$CFLAGS 
     8882        CFLAGS="$CFLAGS -Werror" 
     8883        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dentry.d_count atomic_t type" >&5 
     8884$as_echo_n "checking for dentry.d_count atomic_t type... " >&6; } 
     8885        cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     8886/* end confdefs.h.  */ 
     8887 
     8888                #define __KERNEL__ 
     8889                #include <linux/fs.h> 
     8890                #include <linux/dcache.h> 
     8891                struct dentry d; 
     8892                atomic_t x; 
     8893 
     8894int 
     8895main () 
     8896{ 
     8897 
     8898                x = d.d_count; 
     8899 
     8900  ; 
     8901  return 0; 
     8902} 
     8903_ACEOF 
     8904if ac_fn_c_try_compile "$LINENO"; then : 
     8905  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 
     8906$as_echo "yes" >&6; } 
     8907 
     8908$as_echo "#define HAVE_DENTRY_D_COUNT_ATOMIC 1" >>confdefs.h 
     8909 
     8910else 
     8911  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     8912$as_echo "no" >&6; } 
     8913 
     8914fi 
     8915rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     8916        CFLAGS=$tmp_cflags 
     8917 
     8918                                tmp_cflags=$CFLAGS 
     8919        CFLAGS="$CFLAGS -Werror" 
     8920        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for three-param inode_operations permission" >&5 
     8921$as_echo_n "checking for three-param inode_operations permission... " >&6; } 
     8922        cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     8923/* end confdefs.h.  */ 
     8924 
     8925                #define __KERNEL__ 
     8926                #include <linux/fs.h> 
     8927                struct inode_operations i; 
     8928                int p(struct inode *i, int mode, unsigned int flags) 
     8929                { return 0; } 
     8930 
     8931int 
     8932main () 
     8933{ 
     8934 
     8935            i.permission = p; 
     8936 
     8937  ; 
     8938  return 0; 
     8939} 
     8940_ACEOF 
     8941if ac_fn_c_try_compile "$LINENO"; then : 
     8942  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 
     8943$as_echo "yes" >&6; } 
     8944 
     8945$as_echo "#define HAVE_THREE_PARAM_PERMISSION_WITH_FLAG 1" >>confdefs.h 
     8946 
     8947else 
     8948  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     8949$as_echo "no" >&6; } 
     8950 
     8951fi 
     8952rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     8953        CFLAGS=$tmp_cflags 
     8954 
     8955                        tmp_cflags=$CFLAGS 
     8956        CFLAGS="$CFLAGS -Werror" 
     8957        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for three-param acl_check of generic_permission" >&5 
     8958$as_echo_n "checking for three-param acl_check of generic_permission... " >&6; } 
     8959        cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     8960/* end confdefs.h.  */ 
     8961 
     8962                #define __KERNEL__ 
     8963                #include <linux/fs.h> 
     8964                struct inode *i; 
     8965                int p(struct inode *i, int mode, unsigned int flags) 
     8966                { return 0; } 
     8967 
     8968int 
     8969main () 
     8970{ 
     8971 
     8972            generic_permission(i, 0, 0, p); 
     8973 
     8974  ; 
     8975  return 0; 
     8976} 
     8977_ACEOF 
     8978if ac_fn_c_try_compile "$LINENO"; then : 
     8979  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 
     8980$as_echo "yes" >&6; } 
     8981 
     8982$as_echo "#define HAVE_THREE_PARAM_ACL_CHECK 1" >>confdefs.h 
     8983 
     8984else 
     8985  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     8986$as_echo "no" >&6; } 
     8987 
     8988fi 
     8989rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     8990        CFLAGS=$tmp_cflags 
    87248991 
    87258992 
  • branches/Orange-Branch/maint/config/kernel.m4

    r8805 r8842  
    710710        ) 
    711711 
     712        dnl generic_permission in 2.6.38 and newer has a four parameter  
     713        dnl signature 
     714        tmp_cflags=$CFLAGS 
     715        CFLAGS="$CFLAGS -Werror" 
     716        AC_MSG_CHECKING(for four-param generic_permission) 
     717        AC_TRY_COMPILE([ 
     718                #define __KERNEL__ 
     719                #include <linux/fs.h> 
     720                struct inode *f; 
     721        ],  
     722        [  
     723                generic_permission(f, 0, 0, NULL); 
     724        ], 
     725        AC_MSG_RESULT(yes) 
     726        AC_DEFINE(HAVE_FOUR_PARAM_GENERIC_PERMISSION, 1, [Define if generic_permission takes four parameters]), 
     727        AC_MSG_RESULT(no) 
     728        ) 
     729 
    712730        AC_MSG_CHECKING(for generic_getxattr api in kernel) 
    713731        dnl if this test passes, the kernel does not have it 
     
    14751493        CFLAGS=$tmp_cflags 
    14761494 
    1477  
     1495        dnl dentry operations struct d_hash function has a different signature 
     1496        dnl in 2.6.38 and newer, second param is an inode 
     1497        tmp_cflags=$CFLAGS 
     1498        CFLAGS="$CFLAGS -Werror" 
     1499        AC_MSG_CHECKING(for three-param dentry_operations.d_hash) 
     1500        AC_TRY_COMPILE([ 
     1501                #define __KERNEL__ 
     1502                #include <linux/fs.h> 
     1503                #include <linux/dcache.h> 
     1504                static struct dentry_operations d; 
     1505                static int d_hash_t(const struct dentry *d,  
     1506                                    const struct inode *i,  
     1507                                    struct qstr * q) 
     1508                { return 0; } 
     1509        ],  
     1510        [  
     1511                d.d_hash = d_hash_t; 
     1512        ], 
     1513        AC_MSG_RESULT(yes) 
     1514        AC_DEFINE(HAVE_THREE_PARAM_D_HASH, 1, [Define if d_hash member of dentry_operations has three params, the second inode paramsbeing the difference]), 
     1515        AC_MSG_RESULT(no) 
     1516        ) 
     1517        CFLAGS=$tmp_cflags 
     1518 
     1519 
     1520        dnl dentry operations struct d_compare function has a different  
     1521        dnl signature in 2.6.38 and newer, split out dentry/inodes, string and 
     1522        dnl qstr params 
     1523        tmp_cflags=$CFLAGS 
     1524        CFLAGS="$CFLAGS -Werror" 
     1525        AC_MSG_CHECKING(for seven-param dentry_operations.d_compare) 
     1526        AC_TRY_COMPILE([ 
     1527                #define __KERNEL__ 
     1528                #include <linux/fs.h> 
     1529                #include <linux/dcache.h> 
     1530                static struct dentry_operations d; 
     1531                static int d_compare_t(const struct dentry *d1,  
     1532                                       const struct inode *i1, 
     1533                                       const struct dentry *d2,  
     1534                                       const struct inode *i2,  
     1535                                       unsigned int len,  
     1536                                       const char *str,  
     1537                                       const struct qstr *qstr) 
     1538                { return 0; } 
     1539        ],  
     1540        [  
     1541                d.d_compare = d_compare_t; 
     1542        ], 
     1543        AC_MSG_RESULT(yes) 
     1544        AC_DEFINE(HAVE_SEVEN_PARAM_D_COMPARE, 1, [Define if d_compare member of dentry_operations has seven params]), 
     1545        AC_MSG_RESULT(no) 
     1546        ) 
     1547        CFLAGS=$tmp_cflags 
     1548 
     1549 
     1550        dnl dentry operations struct d_delete argumentis constified in   
     1551        dnl 2.6.38 and newer 
     1552        tmp_cflags=$CFLAGS 
     1553        CFLAGS="$CFLAGS -Werror" 
     1554        AC_MSG_CHECKING(for constified dentry_operations.d_delete) 
     1555        AC_TRY_COMPILE([ 
     1556                #define __KERNEL__ 
     1557                #include <linux/fs.h> 
     1558                #include <linux/dcache.h> 
     1559                static struct dentry_operations d; 
     1560                static int d_delete_t(const struct dentry *d) 
     1561                { return 0; } 
     1562        ],  
     1563        [  
     1564                d.d_delete = d_delete_t; 
     1565        ], 
     1566        AC_MSG_RESULT(yes) 
     1567        AC_DEFINE(HAVE_D_DELETE_CONST, 1, [Define if d_delete member of dentry_operations has a const dentry param]), 
     1568        AC_MSG_RESULT(no) 
     1569        ) 
     1570        CFLAGS=$tmp_cflags 
     1571 
     1572        dnl dentry member d_count is no longer atomic and has it's own spinlock 
     1573        dnl in 2.6.38 and newer 
     1574        tmp_cflags=$CFLAGS 
     1575        CFLAGS="$CFLAGS -Werror" 
     1576        AC_MSG_CHECKING(for dentry.d_count atomic_t type) 
     1577        AC_TRY_COMPILE([ 
     1578                #define __KERNEL__ 
     1579                #include <linux/fs.h> 
     1580                #include <linux/dcache.h> 
     1581                struct dentry d; 
     1582                atomic_t x; 
     1583        ],  
     1584        [  
     1585                x = d.d_count; 
     1586        ], 
     1587        AC_MSG_RESULT(yes) 
     1588        AC_DEFINE(HAVE_DENTRY_D_COUNT_ATOMIC, 1, [Define if d_count member of dentry is of type atomic_t]), 
     1589        AC_MSG_RESULT(no) 
     1590        ) 
     1591        CFLAGS=$tmp_cflags 
     1592 
     1593        dnl permission function pointer in the inode_operations struct now 
     1594        dnl takes three params with the third being an unsigned int (circa 
     1595        dnl 2.6.38 
     1596        tmp_cflags=$CFLAGS 
     1597        CFLAGS="$CFLAGS -Werror" 
     1598        AC_MSG_CHECKING(for three-param inode_operations permission) 
     1599        AC_TRY_COMPILE([ 
     1600                #define __KERNEL__ 
     1601                #include <linux/fs.h> 
     1602                struct inode_operations i; 
     1603                int p(struct inode *i, int mode, unsigned int flags) 
     1604                { return 0; } 
     1605        ],  
     1606        [  
     1607            i.permission = p; 
     1608        ], 
     1609        AC_MSG_RESULT(yes) 
     1610        AC_DEFINE(HAVE_THREE_PARAM_PERMISSION_WITH_FLAG, 1, [Define if permission function pointer of inode_operations struct has three parameters and the third parameter is for flags (unsigned int)]), 
     1611        AC_MSG_RESULT(no) 
     1612        ) 
     1613        CFLAGS=$tmp_cflags 
     1614 
     1615        dnl the acl_check parameter of the generic_permission function has a 
     1616        dnl third parameter circa 2.6.38 
     1617        tmp_cflags=$CFLAGS 
     1618        CFLAGS="$CFLAGS -Werror" 
     1619        AC_MSG_CHECKING(for three-param acl_check of generic_permission) 
     1620        AC_TRY_COMPILE([ 
     1621                #define __KERNEL__ 
     1622                #include <linux/fs.h> 
     1623                struct inode *i; 
     1624                int p(struct inode *i, int mode, unsigned int flags) 
     1625                { return 0; } 
     1626        ],  
     1627        [  
     1628            generic_permission(i, 0, 0, p); 
     1629        ], 
     1630        AC_MSG_RESULT(yes) 
     1631        AC_DEFINE(HAVE_THREE_PARAM_ACL_CHECK, 1, [Define if acl_check param of generic_permission function has three parameters]), 
     1632        AC_MSG_RESULT(no) 
     1633        ) 
     1634        CFLAGS=$tmp_cflags 
    14781635 
    14791636 
  • branches/Orange-Branch/pvfs2-config.h.in

    r8795 r8842  
    7474#undef HAVE_DB_GET_PAGESIZE 
    7575 
     76/* Define if d_count member of dentry is of type atomic_t */ 
     77#undef HAVE_DENTRY_D_COUNT_ATOMIC 
     78 
    7679/* Define if super_operations statfs has dentry argument */ 
    7780#undef HAVE_DENTRY_STATFS_SOP 
     
    8285/* Define if dcache.h contains d_alloc_annon */ 
    8386#undef HAVE_D_ALLOC_ANON 
     87 
     88/* Define if d_delete member of dentry_operations has a const dentry param */ 
     89#undef HAVE_D_DELETE_CONST 
    8490 
    8591/* Define if export_operations has an encode_fh member */ 
     
    108114#undef HAVE_FIND_INODE_HANDLE_SUPER_OPERATIONS 
    109115 
     116/* Define if generic_permission takes four parameters */ 
     117#undef HAVE_FOUR_PARAM_GENERIC_PERMISSION 
     118 
    110119/* Define to 1 if you have the `fsetxattr' function. */ 
    111120#undef HAVE_FSETXATTR 
     
    345354#undef HAVE_SETXATTR_CONST_ARG 
    346355 
     356/* Define if d_compare member of dentry_operations has seven params */ 
     357#undef HAVE_SEVEN_PARAM_D_COMPARE 
     358 
    347359/* Define if SLAB_KERNEL is defined in kernel */ 
    348360#undef HAVE_SLAB_KERNEL 
     
    418430/* Define if TAU library is used */ 
    419431#undef HAVE_TAU 
     432 
     433/* Define if acl_check param of generic_permission function has three 
     434   parameters */ 
     435#undef HAVE_THREE_PARAM_ACL_CHECK 
     436 
     437/* Define if d_hash member of dentry_operations has three params, the second 
     438   inode paramsbeing the difference */ 
     439#undef HAVE_THREE_PARAM_D_HASH 
     440 
     441/* Define if permission function pointer of inode_operations struct has three 
     442   parameters and the third parameter is for flags (unsigned int) */ 
     443#undef HAVE_THREE_PARAM_PERMISSION_WITH_FLAG 
    420444 
    421445/* Define if kernel stddef has true/false enum */ 
  • branches/Orange-Branch/src/kernel/linux-2.6/acl.c

    r8724 r8842  
    712712} 
    713713 
    714 static int pvfs2_check_acl(struct inode *inode, int mask) 
     714static int pvfs2_check_acl(struct inode *inode, int mask 
     715#ifdef HAVE_THREE_PARAM_ACL_CHECK 
     716                           , unsigned int flags 
     717#endif /* HAVE_THREE_PARAM_ACL_CHECK */ 
     718                          ) 
    715719{ 
    716720    struct posix_acl *acl = NULL; 
     
    743747int pvfs2_permission(struct inode *inode, int mask) 
    744748#else 
    745 int pvfs2_permission(struct inode *inode, int mask, struct nameidata *nd) 
    746 #endif 
     749int pvfs2_permission(struct inode *inode, int mask,  
     750#ifdef HAVE_THREE_PARAM_PERMISSION_WITH_FLAG 
     751unsigned int flags) 
     752#else 
     753struct nameidata *nd) 
     754#endif /* HAVE_THREE_PARAM_PERMISSION_WITH_FLAG */ 
     755#endif /* HAVE_TWO_PARAM_PERMISSION */ 
    747756{ 
    748757#ifdef HAVE_CURRENT_FSUID 
     
    755764    int ret; 
    756765 
    757     ret = generic_permission(inode, mask, pvfs2_check_acl); 
     766    ret = generic_permission(inode, mask,  
     767#ifdef HAVE_FOUR_PARAM_GENERIC_PERMISSION 
     768                             0, 
     769#endif /* HAVE_FOUR_PARAM_GENERIC_PERMISSION */  
     770                             pvfs2_check_acl); 
    758771    if (ret != 0) 
    759772    { 
  • branches/Orange-Branch/src/kernel/linux-2.6/dcache.c

    r8726 r8842  
    152152} 
    153153 
    154 static int pvfs2_d_delete (struct dentry * dentry) 
     154static int pvfs2_d_delete ( 
     155#ifdef HAVE_D_DELETE_CONST 
     156const 
     157#endif /* HAVE_D_DELETE_CONST */ 
     158struct dentry * dentry 
     159) 
    155160{ 
    156161    gossip_debug(GOSSIP_DCACHE_DEBUG, 
     
    208213*/ 
    209214static int pvfs2_d_hash( 
     215#ifdef HAVE_THREE_PARAM_D_HASH 
     216    const struct dentry *parent, 
     217    const struct inode *inode, 
     218    struct qstr *hash 
     219#else 
    210220    struct dentry *parent, 
    211     struct qstr *hash) 
     221    struct qstr *hash 
     222#endif /* HAVE_THREE_PARAM_D_HASH */ 
     223                        ) 
    212224{ 
    213225/*     gossip_debug(GOSSIP_DCACHE_DEBUG, "pvfs2: pvfs2_d_hash called " */ 
     
    217229} 
    218230 
     231#ifdef HAVE_SEVEN_PARAM_D_COMPARE 
     232static int pvfs2_d_compare( 
     233                            const struct dentry *parent,  
     234                            const struct inode * pinode, 
     235                            const struct dentry *dentry,  
     236                            const struct inode *inode, 
     237                            unsigned int len,  
     238                            const char *str,  
     239                            const struct qstr *name) 
     240{ 
     241    int i = 0; 
     242    gossip_debug(GOSSIP_DCACHE_DEBUG, "pvfs2_d_compare: " 
     243                 "called on parent %p\n  (name1: %s| name2: %s)\n",  
     244                 parent, str, name->name); 
     245 
     246    if( len != name->len )  
     247        return 1; 
     248   
     249    for( i=0; i < len; i++ ) 
     250    { 
     251        if( str[i] != name->name[i] ) 
     252            return 1; 
     253    } 
     254    return 0; 
     255} 
     256#else 
    219257static int pvfs2_d_compare( 
    220258    struct dentry *parent, 
     
    230268             (memcmp(d_name->name, name->name, d_name->len) == 0)); 
    231269} 
     270#endif /* HAVE_SEVEN_PARAM_D_COMPARE */ 
     271 
    232272 
    233273/** PVFS2 implementation of VFS dentry operations */ 
     
    247287static void __attribute__ ((unused)) print_dentry(struct dentry *entry, int ret) 
    248288{ 
     289  unsigned int local_count = 0; 
    249290  if(!entry) 
    250291  { 
     
    265306  } 
    266307 
     308#ifdef HAVE_DENTRY_D_COUNT_ATOMIC 
     309  local_count = atomic_read(&entry->d_count); 
     310#else 
     311  spin_lock(&entry->d_lock); 
     312  local_count = entry->d_count; 
     313  spin_unlock(&entry->d_lock); 
     314#endif /* HAVE_DENTRY_D_COUNT_ATOMIC */ 
     315 
    267316  printk("--- dentry %p: d_count: %d, name: %s, parent: %p, parent name: %s, ret: %d\n", 
    268317        entry, 
    269         atomic_read(&entry->d_count), 
     318        local_count, 
    270319        entry->d_name.name, 
    271320        entry->d_parent, 
  • branches/Orange-Branch/src/kernel/linux-2.6/namei.c

    r8317 r8842  
    395395{ 
    396396    int ret = -EINVAL, are_directories = 0; 
     397    unsigned int local_count = 0; 
    397398    pvfs2_inode_t *pvfs2_old_parent_inode = PVFS2_I(old_dir); 
    398399    pvfs2_inode_t *pvfs2_new_parent_inode = PVFS2_I(new_dir); 
     
    400401    struct super_block *sb = NULL; 
    401402 
     403 
     404#ifdef HAVE_DENTRY_D_COUNT_ATOMIC 
     405    local_count = atomic_read(&new_dentry->d_count); 
     406#else 
     407    spin_lock( &new_dentry->d_lock ); 
     408    local_count = new_dentry->d_count; 
     409    spin_unlock( &new_dentry->d_lock ); 
     410#endif /* HAVE_DENTRY_D_COUNT_ATOMIC */ 
    402411    gossip_debug(GOSSIP_NAME_DEBUG, "pvfs2_rename: called (%s/%s => %s/%s) ct=%d\n", 
    403412                old_dentry->d_parent->d_name.name, old_dentry->d_name.name, 
    404413                new_dentry->d_parent->d_name.name, new_dentry->d_name.name, 
    405                 atomic_read(&new_dentry->d_count)); 
     414                local_count); 
    406415 
    407416    are_directories = S_ISDIR(old_dentry->d_inode->i_mode); 
  • branches/Orange-Branch/src/kernel/linux-2.6/pvfs2-kernel.h

    r8724 r8842  
    866866int pvfs2_permission(struct inode *, int); 
    867867#else 
    868 int pvfs2_permission(struct inode *inode,  
    869                                          int mask, struct nameidata *nd); 
     868int pvfs2_permission(struct inode *, int mask,  
     869#ifdef HAVE_THREE_PARAM_PERMISSION_WITH_FLAG 
     870                     unsigned int flags); 
     871#else 
     872                     struct nameidata *nd); 
     873#endif /* HAVE_THREE_PARAM_PERMISSION_WITH_FLAG */ 
    870874#endif 
    871875