9 #define _XOPEN_SOURCE 700 17 #include <sys/types.h> 26 #include "sion_hints.h" 27 #include "sion_hints_gpfs.h" 30 #if defined(_SION_LINUX) 31 #elif defined(_SION_AIX) 32 #elif defined(_SION_BGP) 49 int rc = SION_SUCCESS;
60 #ifdef SION_HINTS_LINUX 63 #ifdef SION_HINTS_GPFS 81 DPRINTFP((2,
"_sion_hints_check_env", -1,
"usehints=%d hinttype=%d\n", sion_filedesc->
usehints, sion_filedesc->
hinttype));
94 int _sion_apply_hints(
_sion_filedesc *sion_filedesc,
int access_type) {
97 DPRINTFP((2,
"_sion_apply_hints", -1,
"start usehints=%d hinttype=%d access_type=%d\n",
104 #ifdef SION_HINTS_LINUX 106 DPRINTFP((2,
"_sion_apply_hints", -1,
"apply Linux hints\n"));
109 if(access_type==SION_HINTS_ACCESS_TYPE_METADATABLOCK1) {
110 long long startpos = 0;
111 long long length = _sion_get_size_metadatablock1( sion_filedesc );
113 DPRINTFP((2,
"_sion_apply_hints", -1,
"apply linux hints for metablock1 (%d,%lld,%lld)\n",fd, startpos, length));
114 rc=_sion_apply_hint_linux_access_range(fd, startpos, length, iswrite);
119 #ifdef SION_HINTS_GPFS 124 if(access_type==SION_HINTS_ACCESS_TYPE_METADATABLOCK1) {
125 long long startpos = 0;
126 long long length = _sion_get_size_metadatablock1( sion_filedesc );
127 DPRINTFP((2,
"_sion_apply_hints", -1,
"apply GPFS hints for metablock1 (%d,%lld,%lld)\n",fd, startpos, length));
128 rc=_sion_apply_hint_gpfs_access_range(fd, startpos, length, iswrite);
131 if(access_type==SION_HINTS_ACCESS_TYPE_CHUNK) {
133 long long length = sion_filedesc->
chunksize;
134 DPRINTFP((2,
"_sion_apply_hints", -1,
"apply GPFS hints (access) for chunk (%d,%lld,%lld)\n",fd, startpos, length));
135 rc=_sion_apply_hint_gpfs_access_range(fd, startpos, length, iswrite);
138 if(access_type==SION_HINTS_FREE_TYPE_CHUNK) {
140 long long length = sion_filedesc->
chunksize;
141 DPRINTFP((2,
"_sion_apply_hints", -1,
"apply GPFS hints (free) for metablock1 (%d,%lld,%lld)\n",fd, startpos, length));
142 rc=_sion_apply_hint_gpfs_free_range(fd, startpos, length, iswrite);
Sion File Descriptor Structure.
int _sion_file_get_fd(_sion_fileptr *sion_fileptr)
Utility function: Get POSIX fp.
char * _sion_getenv(const char *name)
#define SION_HINTS_TYPE_GPFS
#define SION_HINTS_TYPE_LINUX
sion_int32 currentblocknr
#define SION_FILEMODE_WRITE