Changeset 8724
- Timestamp:
- 02/03/11 13:20:37 (2 years ago)
- Location:
- branches/Orange-Branch
- Files:
-
- 9 modified
-
configure (modified) (3 diffs)
-
maint/config/kernel.m4 (modified) (3 diffs)
-
pvfs2-config.h.in (modified) (3 diffs)
-
src/kernel/linux-2.6/acl.c (modified) (6 diffs)
-
src/kernel/linux-2.6/file.c (modified) (3 diffs)
-
src/kernel/linux-2.6/pvfs2-kernel.h (modified) (2 diffs)
-
src/kernel/linux-2.6/xattr-default.c (modified) (2 diffs)
-
src/kernel/linux-2.6/xattr-trusted.c (modified) (3 diffs)
-
src/kernel/linux-2.6/xattr.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/Orange-Branch/configure
r8714 r8724 8474 8474 $as_echo "yes" >&6; } 8475 8475 8476 $as_echo "#define HAVE_XATTR_HAN LDER_GET_FIVE_PARAM 1" >>confdefs.h8476 $as_echo "#define HAVE_XATTR_HANDLER_GET_FIVE_PARAM 1" >>confdefs.h 8477 8477 8478 8478 else … … 8512 8512 $as_echo "yes" >&6; } 8513 8513 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 8516 else 8517 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 8518 $as_echo "no" >&6; } 8519 8520 fi 8521 rm -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 8537 int 8538 main () 8539 { 8540 8541 sb.s_xattr = x; 8542 8543 ; 8544 return 0; 8545 } 8546 _ACEOF 8547 if 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 8515 8552 8516 8553 else … … 8546 8583 8547 8584 $as_echo "#define HAVE_TRUE_FALSE_ENUM 1" >>confdefs.h 8585 8586 else 8587 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 8588 $as_echo "no" >&6; } 8589 8590 fi 8591 rm -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 8608 int 8609 main () 8610 { 8611 8612 f.fsync = local_fsync; 8613 8614 ; 8615 return 0; 8616 } 8617 _ACEOF 8618 if 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 8548 8623 8549 8624 else -
branches/Orange-Branch/maint/config/kernel.m4
r8714 r8724 1340 1340 ], 1341 1341 AC_MSG_RESULT(yes) 1342 AC_DEFINE(HAVE_XATTR_HAN LDER_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]), 1343 1343 AC_MSG_RESULT(no) 1344 1344 ) … … 1364 1364 ], 1365 1365 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]), 1367 1387 AC_MSG_RESULT(no) 1368 1388 ) … … 1385 1405 CFLAGS=$tmp_cflags 1386 1406 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 1387 1428 CFLAGS=$oldcflags 1388 1429 -
branches/Orange-Branch/pvfs2-config.h.in
r8714 r8724 50 50 #undef HAVE_COMPAT_IOCTL_HANDLER 51 51 52 /* Define if s_xattr member of super_block struct is const */ 53 #undef HAVE_CONST_S_XATTR_IN_SUPERBLOCK 54 52 55 /* Define if third param (message) to DB error callback function is const */ 53 56 #undef HAVE_CONST_THIRD_PARAMETER_TO_DB_ERROR_CALLBACK … … 114 117 #undef HAVE_FSTAB_H 115 118 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 116 123 /* Define if kernel has generic_file_readv */ 117 124 #undef HAVE_GENERIC_FILE_READV … … 448 455 /* Define if kernel xattr_handle get function has dentry as first parameter 449 456 and a fifth parameter */ 450 #undef HAVE_XATTR_HAN LDER_GET_FIVE_PARAM457 #undef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 451 458 452 459 /* Define if kernel xattr_handle set function has dentry as first parameter 453 460 and a sixth parameter */ 454 #undef HAVE_XATTR_HAN LDER_SET_SIX_PARAM461 #undef HAVE_XATTR_HANDLER_SET_SIX_PARAM 455 462 456 463 /* 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 382 382 383 383 static int pvfs2_xattr_get_acl_access( 384 #ifdef HAVE_XATTR_HAN LDER_GET_FIVE_PARAM384 #ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 385 385 struct dentry *dentry, 386 386 #else 387 387 struct inode *inode, 388 #endif /* HAVE_XATTR_HAN LDER_GET_FIVE_PARAM */388 #endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 389 389 const char *name, 390 390 void *buffer, 391 391 size_t size 392 #ifdef HAVE_XATTR_HAN LDER_GET_FIVE_PARAM392 #ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 393 393 , int handler_flag 394 #endif /* HAVE_XATTR_HAN LDER_GET_FIVE_PARAM */394 #endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 395 395 ) 396 396 { … … 401 401 return -EINVAL; 402 402 } 403 #ifdef HAVE_XATTR_HAN LDER_GET_FIVE_PARAM403 #ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 404 404 return pvfs2_xattr_get_acl(dentry->d_inode, ACL_TYPE_ACCESS, buffer, size); 405 405 #else 406 406 return pvfs2_xattr_get_acl(inode, ACL_TYPE_ACCESS, buffer, size); 407 #endif /* HAVE_XATTR_HAN LDER_GET_FIVE_PARAM */407 #endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 408 408 } 409 409 410 410 static int pvfs2_xattr_get_acl_default( 411 #ifdef HAVE_XATTR_HAN LDER_GET_FIVE_PARAM411 #ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 412 412 struct dentry *dentry, 413 413 #else 414 414 struct inode *inode, 415 #endif /* HAVE_XATTR_HAN LDER_GET_FIVE_PARAM */415 #endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 416 416 const char *name, 417 417 void *buffer, 418 418 size_t size 419 #ifdef HAVE_XATTR_HAN LDER_GET_FIVE_PARAM419 #ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 420 420 , int handler_flags 421 #endif /* HAVE_XATTR_HAN LDER_GET_FIVE_PARAM */421 #endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 422 422 ) 423 423 { … … 428 428 return -EINVAL; 429 429 } 430 #ifdef HAVE_XATTR_HAN LDER_GET_FIVE_PARAM430 #ifdef HAVE_XATTR_HANDLER_GET_FIVE_PARAM 431 431 return pvfs2_xattr_get_acl(dentry->d_inode, ACL_TYPE_DEFAULT, buffer, size); 432 432 #else 433 433 return pvfs2_xattr_get_acl(inode, ACL_TYPE_DEFAULT, buffer, size); 434 #endif /* HAVE_XATTR_HAN LDER_GET_FIVE_PARAM */434 #endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 435 435 } 436 436 … … 497 497 498 498 static int pvfs2_xattr_set_acl_access( 499 #ifdef HAVE_XATTR_HAN LDER_SET_SIX_PARAM499 #ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 500 500 struct dentry *dentry, 501 501 #else 502 502 struct inode *inode, 503 #endif /* HAVE_XATTR_HAN LDER_SET_SIX_PARAM */503 #endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 504 504 const char *name, 505 505 const void *buffer, 506 506 size_t size, 507 507 int flags 508 #ifdef HAVE_XATTR_HAN LDER_SET_SIX_PARAM508 #ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 509 509 , int handler_flags 510 #endif /* HAVE_XATTR_HAN LDER_SET_SIX_PARAM */510 #endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 511 511 ) 512 512 { … … 517 517 return -EINVAL; 518 518 } 519 #ifdef HAVE_XATTR_HAN LDER_SET_SIX_PARAM519 #ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 520 520 return pvfs2_xattr_set_acl(dentry->d_inode, ACL_TYPE_ACCESS, buffer, size); 521 521 #else 522 522 return pvfs2_xattr_set_acl(inode, ACL_TYPE_ACCESS, buffer, size); 523 #endif /* HAVE_XATTR_HAN LDER_SET_SIX_PARAM */523 #endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 524 524 } 525 525 526 526 static int pvfs2_xattr_set_acl_default( 527 #ifdef HAVE_XATTR_HAN LDER_SET_SIX_PARAM527 #ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 528 528 struct dentry *dentry, 529 529 #else 530 530 struct inode *inode, 531 #endif 531 #endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 532 532 const char *name, 533 533 const void *buffer, 534 534 size_t size, 535 535 int flags 536 #ifdef HAVE_XATTR_HAN LDER_SET_SIX_PARAM536 #ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 537 537 , int handler_flags 538 #endif /* #ifdef HAVE_XATTR_HANLDER_SET_SIX_PARAM */538 #endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 539 539 ) 540 540 { … … 545 545 return -EINVAL; 546 546 } 547 #ifdef HAVE_XATTR_HAN LDER_SET_SIX_PARAM547 #ifdef HAVE_XATTR_HANDLER_SET_SIX_PARAM 548 548 return pvfs2_xattr_set_acl(dentry->d_inode, ACL_TYPE_DEFAULT, buffer, size); 549 549 #else -
branches/Orange-Branch/src/kernel/linux-2.6/file.c
r8713 r8724 2991 2991 { 2992 2992 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 ); 2996 3006 if(ret < 0 && ret != -ENODATA) 2997 3007 { … … 3030 3040 gossip_debug(GOSSIP_FILE_DEBUG, "pvfs2_ioctl: FS_IOC_SETFLAGS: %llu\n", 3031 3041 (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 ); 3035 3056 } 3036 3057 … … 3118 3139 int pvfs2_fsync( 3119 3140 struct file *file, 3141 #ifdef HAVE_FSYNC_DENTRY_PARAM 3120 3142 struct dentry *dentry, 3143 #endif 3121 3144 int datasync) 3122 3145 { -
branches/Orange-Branch/src/kernel/linux-2.6/pvfs2-kernel.h
r8714 r8724 276 276 extern int pvfs2_init_acl(struct inode *inode, struct inode *dir); 277 277 278 #ifdef HAVE_CONST_S_XATTR_IN_SUPERBLOCK 279 extern const struct xattr_handler *pvfs2_xattr_handlers[]; 280 #else 278 281 extern struct xattr_handler *pvfs2_xattr_handlers[]; 282 #endif /* HAVE_CONST_S_XATTR_IN_SUPERBLOCK */ 283 279 284 extern struct xattr_handler pvfs2_xattr_acl_default_handler, pvfs2_xattr_acl_access_handler; 280 285 extern struct xattr_handler pvfs2_xattr_trusted_handler; … … 300 305 } 301 306 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); 307 int 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 322 int 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 336 int 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 351 int 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 ); 310 364 311 365 -
branches/Orange-Branch/src/kernel/linux-2.6/xattr-default.c
r7968 r8724 20 20 #include <linux/xattr.h> 21 21 22 int pvfs2_xattr_set_default(struct inode *inode, 23 const char *name, const void *buffer, size_t size, int flags) 22 int 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 ) 24 36 { 25 37 int internal_flag = 0; … … 27 39 if (strcmp(name, "") == 0) 28 40 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 29 52 if (!S_ISREG(inode->i_mode) && 30 53 (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX)) 31 54 { 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); 34 57 return -EPERM; 35 58 } 59 #endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 60 36 61 gossip_debug(GOSSIP_XATTR_DEBUG, "pvfs2_setxattr_default %s\n", name); 37 62 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 38 68 return pvfs2_inode_setxattr(inode, PVFS2_XATTR_NAME_DEFAULT_PREFIX, 39 69 name, buffer, size, internal_flag); 70 #endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 40 71 } 41 72 42 int pvfs2_xattr_get_default(struct inode *inode, 43 const char *name, void *buffer, size_t size) 73 int 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 ) 44 87 { 45 88 if (strcmp(name, "") == 0) 46 89 return -EINVAL; 47 90 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 48 96 return pvfs2_inode_getxattr(inode, PVFS2_XATTR_NAME_DEFAULT_PREFIX, 49 97 name, buffer, size); 98 #endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 99 50 100 } 51 101 #endif -
branches/Orange-Branch/src/kernel/linux-2.6/xattr-trusted.c
r5524 r8724 18 18 #include <linux/xattr.h> 19 19 20 int pvfs2_xattr_set_trusted(struct inode *inode, 21 const char *name, const void *buffer, size_t size, int flags) 20 int 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 ) 22 34 { 23 35 int internal_flag = 0; … … 33 45 } 34 46 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 35 52 return pvfs2_inode_setxattr(inode, PVFS2_XATTR_NAME_TRUSTED_PREFIX, 36 53 name, buffer, size, internal_flag); 54 #endif /* HAVE_XATTR_HANDLER_SET_SIX_PARAM */ 37 55 } 38 56 39 int pvfs2_xattr_get_trusted(struct inode *inode, 40 const char *name, void *buffer, size_t size) 57 int 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 ) 41 70 { 42 71 gossip_debug(GOSSIP_XATTR_DEBUG, "pvfs2_xattr_get_trusted: name %s, buffer_size %zd\n", … … 49 78 return -EPERM; 50 79 } 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 51 84 return pvfs2_inode_getxattr(inode, PVFS2_XATTR_NAME_TRUSTED_PREFIX, 52 85 name, buffer, size); 86 #endif /* HAVE_XATTR_HANDLER_GET_FIVE_PARAM */ 53 87 } 54 88 -
branches/Orange-Branch/src/kernel/linux-2.6/xattr.c
r5502 r8724 30 30 * hang a pointer to it off of the s_xattr field of the superblock. 31 31 */ 32 struct xattr_handler *pvfs2_xattr_handlers[] = { 32 #ifdef HAVE_CONST_S_XATTR_IN_SUPERBLOCK 33 const struct xattr_handler *pvfs2_xattr_handlers[] = 34 #else 35 struct xattr_handler *pvfs2_xattr_handlers[] = 36 #endif 37 { 33 38 /* 34 39 * ACL xattrs have special prefixes that I am handling separately
