Changeset 9249
- Timestamp:
- 03/14/12 02:55:14 (14 months ago)
- Location:
- branches/stable
- Files:
-
- 3 modified
-
configure.in (modified) (1 diff)
-
src/apps/user/getmattr.c (modified) (3 diffs)
-
src/apps/user/setmattr.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/configure.in
r9245 r9249 1175 1175 AC_MSG_RESULT(yes) 1176 1176 AC_DEFINE(HAVE_FGETXATTR_EXTRA_ARGS, 1, Define if fgetxattr takes position and option arguments), 1177 AC_MSG_RESULT(no) 1178 ) 1179 1180 dnl 1181 dnl check if setxattr takes extra arguments 1182 AC_MSG_CHECKING([for setxattr extra arguments]) 1183 AC_TRY_COMPILE([ 1184 #include <sys/types.h> 1185 #ifdef HAVE_ATTR_XATTR_H 1186 #include <attr/xattr.h> 1187 #endif 1188 #ifdef HAVE_SYS_XATTR_H 1189 #include <sys/xattr.h> 1190 #endif 1191 ], 1192 [ 1193 setxattr(0, 0, 0, 0, 0, 0); 1194 ], 1195 AC_MSG_RESULT(yes) 1196 AC_DEFINE(HAVE_SETXATTR_EXTRA_ARGS, 1, Define if setxattr takes position and option arguments), 1197 AC_MSG_RESULT(no) 1198 ) 1199 1200 dnl 1201 dnl check if getxattr takes extra arguments 1202 AC_MSG_CHECKING([for getxattr extra arguments]) 1203 AC_TRY_COMPILE([ 1204 #include <sys/types.h> 1205 #ifdef HAVE_ATTR_XATTR_H 1206 #include <attr/xattr.h> 1207 #endif 1208 #ifdef HAVE_SYS_XATTR_H 1209 #include <sys/xattr.h> 1210 #endif 1211 ], 1212 [ 1213 getxattr(0, 0, 0, 0, 0, 0); 1214 ], 1215 AC_MSG_RESULT(yes) 1216 AC_DEFINE(HAVE_GETXATTR_EXTRA_ARGS, 1, Define if getxattr takes position and option arguments), 1177 1217 AC_MSG_RESULT(no) 1178 1218 ) -
branches/stable/src/apps/user/getmattr.c
r7760 r9249 5 5 */ 6 6 7 #include "pvfs2-config.h" 7 8 #include <unistd.h> 8 9 #include <stdio.h> … … 58 59 /*Get the mirroring attributes for the given file*/ 59 60 if (my_args.mode) { 61 #ifdef HAVE_GETXATTR_EXTRA_ARGS 62 ret = getxattr(my_args.filename 63 ,"user.pvfs2.mirror.mode" 64 ,&mode 65 ,sizeof(mode) 66 ,0 67 ,0 ); 68 #else 60 69 ret = getxattr(my_args.filename 61 70 ,"user.pvfs2.mirror.mode" 62 71 ,&mode 63 72 ,sizeof(mode) ); 73 #endif 64 74 if (!ret) 65 75 perror("Failure to get mirror mode"); … … 89 99 90 100 if (my_args.copies){ 101 #ifdef HAVE_GETXATTR_EXTRA_ARGS 102 ret = getxattr(my_args.filename 103 ,"user.pvfs2.mirror.copies" 104 ,&(copies) 105 ,sizeof(copies) 106 ,0 107 ,0); 108 #else 91 109 ret = getxattr(my_args.filename 92 110 ,"user.pvfs2.mirror.copies" 93 111 ,&(copies) 94 112 ,sizeof(copies) ); 113 #endif 95 114 if (!ret) 96 115 perror("Failure to get mirror copies"); -
branches/stable/src/apps/user/setmattr.c
r7760 r9249 5 5 */ 6 6 7 #include "pvfs2-config.h" 7 8 #include <unistd.h> 8 9 #include <stdio.h> … … 58 59 printf("Setting mirror mode to %d\n" 59 60 ,my_args.mode); 61 #ifdef HAVE_SETXATTR_EXTRA_ARGS 62 ret = setxattr(my_args.filename 63 ,"user.pvfs2.mirror.mode" 64 ,&(my_args.mode) 65 ,sizeof(my_args.mode) 66 ,0 67 ,0); 68 #else 60 69 ret = setxattr(my_args.filename 61 70 ,"user.pvfs2.mirror.mode" … … 63 72 ,sizeof(my_args.mode) 64 73 ,0); 74 #endif 65 75 if (ret) 66 76 perror("Failure to set mirror mode"); … … 70 80 printf("Setting number of mirrored copies to %d\n" 71 81 ,my_args.copies); 82 #ifdef HAVE_SETXATTR_EXTRA_ARGS 83 ret = setxattr(my_args.filename 84 ,"user.pvfs2.mirror.copies" 85 ,&(my_args.copies) 86 ,sizeof(my_args.copies) 87 ,0 88 ,0); 89 #else 72 90 ret = setxattr(my_args.filename 73 91 ,"user.pvfs2.mirror.copies" … … 75 93 ,sizeof(my_args.copies) 76 94 ,0); 95 #endif 77 96 if (ret) 78 97 perror("Failure to set mirror copies");
