Changeset 8724

Show
Ignore:
Timestamp:
02/03/11 13:20:37 (2 years ago)
Author:
mtmoore
Message:

additional kernel module changes around xattr_handler and fixing of checks from HANLDER to HANDLER. Also add check for fsync in newer kernels that don't take second dentry parameter

Location:
branches/Orange-Branch
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • branches/Orange-Branch/configure

    r8714 r8724  
    84748474$as_echo "yes" >&6; } 
    84758475 
    8476 $as_echo "#define HAVE_XATTR_HANLDER_GET_FIVE_PARAM 1" >>confdefs.h 
     8476$as_echo "#define HAVE_XATTR_HANDLER_GET_FIVE_PARAM 1" >>confdefs.h 
    84778477 
    84788478else 
     
    85128512$as_echo "yes" >&6; } 
    85138513 
    8514 $as_echo "#define HAVE_XATTR_HANLDER_SET_SIX_PARAM 1" >>confdefs.h 
     8514$as_echo "#define HAVE_XATTR_HANDLER_SET_SIX_PARAM 1" >>confdefs.h 
     8515 
     8516else 
     8517  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     8518$as_echo "no" >&6; } 
     8519 
     8520fi 
     8521rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     8522        CFLAGS=$tmp_cflags 
     8523 
     8524                tmp_cflags=$CFLAGS 
     8525        CFLAGS="$CFLAGS -Werror" 
     8526        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for const s_xattr member in super_block struct" >&5 
     8527$as_echo_n "checking for const s_xattr member in super_block struct... " >&6; } 
     8528        cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     8529/* end confdefs.h.  */ 
     8530 
     8531                #define __KERNEL__ 
     8532                #include <linux/fs.h> 
     8533                #include <linux/xattr.h> 
     8534                struct super_block sb; 
     8535                const struct xattr_handler *x[] = { NULL }; 
     8536 
     8537int 
     8538main () 
     8539{ 
     8540 
     8541            sb.s_xattr = x; 
     8542 
     8543  ; 
     8544  return 0; 
     8545} 
     8546_ACEOF 
     8547if ac_fn_c_try_compile "$LINENO"; then : 
     8548  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 
     8549$as_echo "yes" >&6; } 
     8550 
     8551$as_echo "#define HAVE_CONST_S_XATTR_IN_SUPERBLOCK 1" >>confdefs.h 
    85158552 
    85168553else 
     
    85468583 
    85478584$as_echo "#define HAVE_TRUE_FALSE_ENUM 1" >>confdefs.h 
     8585 
     8586else 
     8587  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
     8588$as_echo "no" >&6; } 
     8589 
     8590fi 
     8591rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
     8592        CFLAGS=$tmp_cflags 
     8593 
     8594 
     8595                tmp_cflags=$CFLAGS 
     8596        CFLAGS="$CFLAGS -Werror" 
     8597        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dentry argument in fsync" >&5 
     8598$as_echo_n "checking for dentry argument in fsync... " >&6; } 
     8599        cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
     8600/* end confdefs.h.  */ 
     8601 
     8602                #define __KERNEL__ 
     8603                #include <linux/fs.h> 
     8604                static struct file_operations f; 
     8605                static int local_fsync(struct file *f, struct dentry *d, int i) 
     8606                { return 0; } 
     8607 
     8608int 
     8609main () 
     8610{ 
     8611 
     8612            f.fsync = local_fsync; 
     8613 
     8614  ; 
     8615  return 0; 
     8616} 
     8617_ACEOF 
     8618if ac_fn_c_try_compile "$LINENO"; then : 
     8619  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 
     8620$as_echo "yes" >&6; } 
     8621 
     8622$as_echo "#define HAVE_FSYNC_DENTRY_PARAM 1" >>confdefs.h 
    85488623 
    85498624else 
  • branches/Orange-Branch/maint/config/kernel.m4

    r8714 r8724  
    13401340        ], 
    13411341        AC_MSG_RESULT(yes) 
    1342         AC_DEFINE(HAVE_XATTR_HANLDER_GET_FIVE_PARAM, 1, [Define if kernel xattr_handle get function has dentry as first parameter and a fifth parameter]), 
     1342        AC_DEFINE(HAVE_XATTR_HANDLER_GET_FIVE_PARAM, 1, [Define if kernel xattr_handle get function has dentry as first parameter and a fifth parameter]), 
    13431343        AC_MSG_RESULT(no) 
    13441344        ) 
     
    13641364        ], 
    13651365        AC_MSG_RESULT(yes) 
    1366         AC_DEFINE(HAVE_XATTR_HANLDER_SET_SIX_PARAM, 1, [Define if kernel xattr_handle set function has dentry as first parameter and a sixth parameter]), 
     1366        AC_DEFINE(HAVE_XATTR_HANDLER_SET_SIX_PARAM, 1, [Define if kernel xattr_handle set function has dentry as first parameter and a sixth parameter]), 
     1367        AC_MSG_RESULT(no) 
     1368        ) 
     1369        CFLAGS=$tmp_cflags 
     1370 
     1371        dnl xattr_handler is also a const 
     1372        tmp_cflags=$CFLAGS 
     1373        CFLAGS="$CFLAGS -Werror" 
     1374        AC_MSG_CHECKING(for const s_xattr member in super_block struct) 
     1375        AC_TRY_COMPILE([ 
     1376                #define __KERNEL__ 
     1377                #include <linux/fs.h> 
     1378                #include <linux/xattr.h> 
     1379                struct super_block sb; 
     1380                const struct xattr_handler *x[] = { NULL }; 
     1381        ],  
     1382        [  
     1383            sb.s_xattr = x; 
     1384        ], 
     1385        AC_MSG_RESULT(yes) 
     1386        AC_DEFINE(HAVE_CONST_S_XATTR_IN_SUPERBLOCK, 1, [Define if s_xattr member of super_block struct is const]), 
    13671387        AC_MSG_RESULT(no) 
    13681388        ) 
     
    13851405        CFLAGS=$tmp_cflags 
    13861406 
     1407 
     1408        dnl fsync no longer has a dentry second parameter 
     1409        tmp_cflags=$CFLAGS 
     1410        CFLAGS="$CFLAGS -Werror" 
     1411        AC_MSG_CHECKING(for dentry argument in fsync) 
     1412        AC_TRY_COMPILE([ 
     1413                #define __KERNEL__ 
     1414                #include <linux/fs.h> 
     1415                static struct file_operations f; 
     1416                static int local_fsync(struct file *f, struct dentry *d, int i) 
     1417                { return 0; } 
     1418        ],  
     1419        [  
     1420            f.fsync = local_fsync; 
     1421        ], 
     1422        AC_MSG_RESULT(yes) 
     1423        AC_DEFINE(HAVE_FSYNC_DENTRY_PARAM, 1, [Define if fsync function in file_operations struct wants a dentry pointer as the second parameter]), 
     1424        AC_MSG_RESULT(no) 
     1425        ) 
     1426        CFLAGS=$tmp_cflags 
     1427 
    13871428        CFLAGS=$oldcflags 
    13881429 
  • branches/Orange-Branch/pvfs2-config.h.in

    r8714 r8724  
    5050#undef HAVE_COMPAT_IOCTL_HANDLER 
    5151 
     52/* Define if s_xattr member of super_block struct is const */ 
     53#undef HAVE_CONST_S_XATTR_IN_SUPERBLOCK 
     54 
    5255/* Define if third param (message) to DB error callback function is const */ 
    5356#undef HAVE_CONST_THIRD_PARAMETER_TO_DB_ERROR_CALLBACK 
     
    114117#undef HAVE_FSTAB_H 
    115118 
     119/* Define if fsync function in file_operations struct wants a dentry pointer 
     120   as the second parameter */ 
     121#undef HAVE_FSYNC_DENTRY_PARAM 
     122 
    116123/* Define if kernel has generic_file_readv */ 
    117124#undef HAVE_GENERIC_FILE_READV 
     
    448455/* Define if kernel xattr_handle get function has dentry as first parameter 
    449456   and a fifth parameter */ 
    450 #undef HAVE_XATTR_HANLDER_GET_FIVE_PARAM 
     457#undef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
    451458 
    452459/* Define if kernel xattr_handle set function has dentry as first parameter 
    453460   and a sixth parameter */ 
    454 #undef HAVE_XATTR_HANLDER_SET_SIX_PARAM 
     461#undef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
    455462 
    456463/* Define to the address where bug reports for this package should be sent. */ 
  • branches/Orange-Branch/src/kernel/linux-2.6/acl.c

    r8686 r8724  
    382382 
    383383static int pvfs2_xattr_get_acl_access( 
    384 #ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM 
     384#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
    385385        struct dentry *dentry, 
    386386#else 
    387387        struct inode *inode, 
    388 #endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */ 
     388#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
    389389        const char *name,  
    390390        void *buffer,  
    391391        size_t size 
    392 #ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM 
     392#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
    393393        , int handler_flag 
    394 #endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */ 
     394#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
    395395        ) 
    396396{ 
     
    401401        return -EINVAL; 
    402402    } 
    403 #ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM 
     403#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
    404404    return pvfs2_xattr_get_acl(dentry->d_inode, ACL_TYPE_ACCESS, buffer, size); 
    405405#else 
    406406    return pvfs2_xattr_get_acl(inode, ACL_TYPE_ACCESS, buffer, size); 
    407 #endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */ 
     407#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
    408408} 
    409409 
    410410static int pvfs2_xattr_get_acl_default( 
    411 #ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM 
     411#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
    412412        struct dentry *dentry, 
    413413#else 
    414414        struct inode *inode, 
    415 #endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */ 
     415#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
    416416        const char *name,  
    417417        void *buffer,  
    418418        size_t size 
    419 #ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM 
     419#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
    420420        , int handler_flags 
    421 #endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */ 
     421#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
    422422        ) 
    423423{ 
     
    428428        return -EINVAL; 
    429429    } 
    430 #ifdef HAVE_XATTR_HANLDER_GET_FIVE_PARAM 
     430#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
    431431    return pvfs2_xattr_get_acl(dentry->d_inode, ACL_TYPE_DEFAULT, buffer, size); 
    432432#else 
    433433    return pvfs2_xattr_get_acl(inode, ACL_TYPE_DEFAULT, buffer, size); 
    434 #endif /* HAVE_XATTR_HANLDER_GET_FIVE_PARAM */ 
     434#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
    435435} 
    436436 
     
    497497 
    498498static int pvfs2_xattr_set_acl_access( 
    499 #ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM 
     499#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
    500500        struct dentry *dentry, 
    501501#else 
    502502        struct inode *inode,  
    503 #endif /* HAVE_XATTR_HANLDER_SET_SIX_PARAM */ 
     503#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
    504504        const char *name,  
    505505        const void *buffer,  
    506506        size_t size,  
    507507        int flags 
    508 #ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM 
     508#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
    509509        , int handler_flags 
    510 #endif /* HAVE_XATTR_HANLDER_SET_SIX_PARAM */ 
     510#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
    511511        ) 
    512512{ 
     
    517517        return -EINVAL; 
    518518    } 
    519 #ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM 
     519#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
    520520    return pvfs2_xattr_set_acl(dentry->d_inode, ACL_TYPE_ACCESS, buffer, size); 
    521521#else 
    522522    return pvfs2_xattr_set_acl(inode, ACL_TYPE_ACCESS, buffer, size); 
    523 #endif /* HAVE_XATTR_HANLDER_SET_SIX_PARAM */ 
     523#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
    524524} 
    525525 
    526526static int pvfs2_xattr_set_acl_default( 
    527 #ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM 
     527#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
    528528        struct dentry *dentry, 
    529529#else 
    530530        struct inode *inode,  
    531 #endif 
     531#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
    532532        const char *name,  
    533533        const void *buffer,  
    534534        size_t size,  
    535535        int flags 
    536 #ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM 
     536#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
    537537        , int handler_flags 
    538 #endif /* #ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM */ 
     538#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
    539539        ) 
    540540{ 
     
    545545        return -EINVAL; 
    546546    } 
    547 #ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM 
     547#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
    548548    return pvfs2_xattr_set_acl(dentry->d_inode, ACL_TYPE_DEFAULT, buffer, size); 
    549549#else 
  • branches/Orange-Branch/src/kernel/linux-2.6/file.c

    r8713 r8724  
    29912991    { 
    29922992        val = 0; 
    2993         ret = pvfs2_xattr_get_default(inode, 
    2994                                       "user.pvfs2.meta_hint", 
    2995                                       &val, sizeof(val)); 
     2993        ret = pvfs2_xattr_get_default( 
     2994#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     2995                file->f_dentry, 
     2996#else 
     2997                inode, 
     2998#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
     2999                "user.pvfs2.meta_hint", 
     3000                &val,  
     3001                sizeof(val) 
     3002#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     3003                , 0 
     3004#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
     3005                ); 
    29963006        if(ret < 0 && ret != -ENODATA) 
    29973007        { 
     
    30303040        gossip_debug(GOSSIP_FILE_DEBUG, "pvfs2_ioctl: FS_IOC_SETFLAGS: %llu\n", 
    30313041                     (unsigned long long)val); 
    3032         ret = pvfs2_xattr_set_default(inode, 
    3033                                       "user.pvfs2.meta_hint", 
    3034                                       &val, sizeof(val), 0); 
     3042        ret = pvfs2_xattr_set_default( 
     3043#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM  
     3044                file->f_dentry, 
     3045#else 
     3046                inode, 
     3047#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
     3048                "user.pvfs2.meta_hint", 
     3049                &val,  
     3050                sizeof(val),  
     3051                0 
     3052#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM  
     3053                , 0                                       
     3054#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
     3055                ); 
    30353056    } 
    30363057 
     
    31183139int pvfs2_fsync( 
    31193140    struct file *file, 
     3141#ifdef HAVE_FSYNC_DENTRY_PARAM 
    31203142    struct dentry *dentry, 
     3143#endif 
    31213144    int datasync) 
    31223145{ 
  • branches/Orange-Branch/src/kernel/linux-2.6/pvfs2-kernel.h

    r8714 r8724  
    276276extern int pvfs2_init_acl(struct inode *inode, struct inode *dir); 
    277277 
     278#ifdef HAVE_CONST_S_XATTR_IN_SUPERBLOCK 
     279extern const struct xattr_handler *pvfs2_xattr_handlers[]; 
     280#else 
    278281extern struct xattr_handler *pvfs2_xattr_handlers[]; 
     282#endif /* HAVE_CONST_S_XATTR_IN_SUPERBLOCK */ 
     283 
    279284extern struct xattr_handler pvfs2_xattr_acl_default_handler, pvfs2_xattr_acl_access_handler; 
    280285extern struct xattr_handler pvfs2_xattr_trusted_handler; 
     
    300305} 
    301306 
    302 int pvfs2_xattr_set_trusted(struct inode *inode,  
    303     const char *name, const void *buffer, size_t size, int flags); 
    304 int pvfs2_xattr_get_trusted(struct inode *inode, 
    305     const char *name, void *buffer, size_t size); 
    306 int pvfs2_xattr_set_default(struct inode *inode,  
    307     const char *name, const void *buffer, size_t size, int flags); 
    308 int pvfs2_xattr_get_default(struct inode *inode, 
    309     const char *name, void *buffer, size_t size); 
     307int pvfs2_xattr_set_trusted( 
     308#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
     309    struct dentry *dentry,  
     310#else 
     311    struct inode *inode,  
     312#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
     313    const char *name,  
     314    const void *buffer,  
     315    size_t size,  
     316    int flags 
     317#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
     318    , int handler_flags 
     319#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
     320    ); 
     321 
     322int pvfs2_xattr_get_trusted( 
     323#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     324    struct dentry *dentry, 
     325#else 
     326    struct inode *inode, 
     327#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
     328    const char *name,  
     329    void *buffer,  
     330    size_t size 
     331#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     332    , int handler_flags 
     333#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
     334    ); 
     335 
     336int pvfs2_xattr_set_default( 
     337#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
     338    struct dentry *dentry,  
     339#else 
     340    struct inode *inode,  
     341#endif /*HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
     342    const char *name,  
     343    const void *buffer,  
     344    size_t size,  
     345    int flags 
     346#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
     347    , int handler_flags 
     348#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
     349    ); 
     350 
     351int pvfs2_xattr_get_default( 
     352#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     353    struct dentry *dentry, 
     354#else 
     355    struct inode *inode, 
     356#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
     357    const char *name,  
     358    void *buffer,  
     359    size_t size 
     360#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     361    , int handler_flags 
     362#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
     363    ); 
    310364 
    311365 
  • branches/Orange-Branch/src/kernel/linux-2.6/xattr-default.c

    r7968 r8724  
    2020#include <linux/xattr.h> 
    2121 
    22 int pvfs2_xattr_set_default(struct inode *inode,  
    23     const char *name, const void *buffer, size_t size, int flags) 
     22int pvfs2_xattr_set_default( 
     23#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
     24    struct dentry *dentry, 
     25#else 
     26    struct inode *inode,  
     27#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
     28    const char *name,  
     29    const void *buffer,  
     30    size_t size,  
     31    int flags 
     32#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
     33    , int handler_flags 
     34#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
     35    ) 
    2436{ 
    2537    int internal_flag = 0; 
     
    2739    if (strcmp(name, "") == 0) 
    2840        return -EINVAL; 
     41 
     42#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
     43    if (!S_ISREG(dentry->d_inode->i_mode) && 
     44       (!S_ISDIR(dentry->d_inode->i_mode) ||  
     45        dentry->d_inode->i_mode & S_ISVTX)) 
     46    { 
     47        gossip_err("pvfs2_xattr_set_default: Returning EPERM for inode %p.\n", 
     48                    dentry->d_inode); 
     49        return -EPERM; 
     50    } 
     51#else 
    2952    if (!S_ISREG(inode->i_mode) && 
    3053       (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX)) 
    3154    { 
    32         gossip_err("pvfs2_xattr_set_default: Returning EPERM for inode %p.\n" 
    33                   ,inode); 
     55        gossip_err("pvfs2_xattr_set_default: Returning EPERM for inode %p.\n", 
     56                  inode); 
    3457        return -EPERM; 
    3558    } 
     59#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
     60 
    3661    gossip_debug(GOSSIP_XATTR_DEBUG, "pvfs2_setxattr_default %s\n", name); 
    3762    internal_flag = convert_to_internal_xattr_flags(flags); 
     63 
     64#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
     65    return pvfs2_inode_setxattr(dentry->d_inode,  
     66        PVFS2_XATTR_NAME_DEFAULT_PREFIX, name, buffer, size, internal_flag); 
     67#else 
    3868    return pvfs2_inode_setxattr(inode, PVFS2_XATTR_NAME_DEFAULT_PREFIX, 
    3969        name, buffer, size, internal_flag); 
     70#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
    4071} 
    4172 
    42 int pvfs2_xattr_get_default(struct inode *inode, 
    43     const char *name, void *buffer, size_t size) 
     73int pvfs2_xattr_get_default( 
     74#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     75    struct dentry *dentry, 
     76#else 
     77    struct inode *inode, 
     78#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
     79    const char *name,  
     80    void *buffer,  
     81    size_t size 
     82#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     83    , int handler_flags 
     84#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
     85 
     86    ) 
    4487{ 
    4588    if (strcmp(name, "") == 0) 
    4689        return -EINVAL; 
    4790    gossip_debug(GOSSIP_XATTR_DEBUG, "pvfs2_getxattr_default %s\n", name); 
     91 
     92#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     93    return pvfs2_inode_getxattr(dentry->d_inode,  
     94        PVFS2_XATTR_NAME_DEFAULT_PREFIX, name, buffer, size); 
     95#else 
    4896    return pvfs2_inode_getxattr(inode, PVFS2_XATTR_NAME_DEFAULT_PREFIX, 
    4997        name, buffer, size); 
     98#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
     99 
    50100} 
    51101#endif 
  • branches/Orange-Branch/src/kernel/linux-2.6/xattr-trusted.c

    r5524 r8724  
    1818#include <linux/xattr.h> 
    1919 
    20 int pvfs2_xattr_set_trusted(struct inode *inode,  
    21     const char *name, const void *buffer, size_t size, int flags) 
     20int pvfs2_xattr_set_trusted( 
     21#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
     22        struct dentry *dentry, 
     23#else 
     24    struct inode *inode,  
     25#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
     26    const char *name,  
     27    const void *buffer,  
     28    size_t size, 
     29    int flags 
     30#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
     31    , int handler_flags 
     32#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
     33    ) 
    2234{ 
    2335    int internal_flag = 0; 
     
    3345    } 
    3446    internal_flag = convert_to_internal_xattr_flags(flags); 
     47 
     48#ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 
     49    return pvfs2_inode_setxattr(dentry->d_inode,  
     50        PVFS2_XATTR_NAME_TRUSTED_PREFIX, name, buffer, size, internal_flag); 
     51#else 
    3552    return pvfs2_inode_setxattr(inode, PVFS2_XATTR_NAME_TRUSTED_PREFIX, 
    3653        name, buffer, size, internal_flag); 
     54#endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 
    3755} 
    3856 
    39 int pvfs2_xattr_get_trusted(struct inode *inode, 
    40     const char *name, void *buffer, size_t size) 
     57int pvfs2_xattr_get_trusted( 
     58#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     59    struct dentry *dentry, 
     60#else 
     61    struct inode *inode, 
     62#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
     63    const char *name,  
     64    void *buffer,  
     65    size_t size 
     66#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     67    , int handler_flags 
     68#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
     69    ) 
    4170{ 
    4271    gossip_debug(GOSSIP_XATTR_DEBUG, "pvfs2_xattr_get_trusted: name %s, buffer_size %zd\n", 
     
    4978        return -EPERM; 
    5079    } 
     80#ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 
     81    return pvfs2_inode_getxattr(dentry->d_inode,  
     82        PVFS2_XATTR_NAME_TRUSTED_PREFIX, name, buffer, size); 
     83#else 
    5184    return pvfs2_inode_getxattr(inode, PVFS2_XATTR_NAME_TRUSTED_PREFIX, 
    5285        name, buffer, size); 
     86#endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 
    5387} 
    5488 
  • branches/Orange-Branch/src/kernel/linux-2.6/xattr.c

    r5502 r8724  
    3030 * hang a pointer to it off of the s_xattr field of the superblock. 
    3131 */ 
    32 struct xattr_handler *pvfs2_xattr_handlers[] = { 
     32#ifdef HAVE_CONST_S_XATTR_IN_SUPERBLOCK 
     33const struct xattr_handler *pvfs2_xattr_handlers[] =  
     34#else 
     35struct xattr_handler *pvfs2_xattr_handlers[] =  
     36#endif 
     37{ 
    3338    /* 
    3439     * ACL xattrs have special prefixes that I am handling separately