15 #include <sys/types.h> 23 #include "sion_hints_gpfs.h" 25 #ifdef SION_HINTS_GPFS 26 #include <gpfs_fcntl.h> 40 int _sion_apply_hint_gpfs_access_range(
int fd,
long long start,
long long length,
int iswrite ) {
44 #ifdef SION_HINTS_GPFS 48 gpfsFcntlHeader_t hdr;
49 gpfsAccessRange_t acc;
53 DPRINTFP((2,
"_sion_apply_hint_gpfs_access_range", -1,
"start fd=%d start=%lld length=%lld\n",
57 #ifdef SION_HINTS_GPFS 58 DPRINTFP((2,
"_sion_apply_hint_gpfs_access_range", -1,
"do apply\n"));
61 accHint.hdr.totalLength =
sizeof(accHint);
62 accHint.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
63 accHint.hdr.fcntlReserved = 0;
64 accHint.acc.structLen =
sizeof(accHint.acc);
65 accHint.acc.structType = GPFS_ACCESS_RANGE;
66 accHint.acc.start = start;
67 accHint.acc.length = length;
68 accHint.acc.isWrite = iswrite;
69 grc = gpfs_fcntl(fd, &accHint);
71 return(
_sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
"cannot set GPFS hint (access) for file fd=%d start=%lld length=%lld ... rc=%d\n",
72 fd, start, length, rc));
74 DPRINTFP((2,
"_sion_apply_hint_gpfs_access_range", -1,
"apply done rc=%d\n",rc));
92 int _sion_apply_hint_gpfs_free_range(
int fd,
long long start,
long long length,
int iswrite ) {
96 #ifdef SION_HINTS_GPFS 100 gpfsFcntlHeader_t hdr;
101 gpfsFreeRange_t free;
105 DPRINTFP((2,
"_sion_apply_hint_gpfs_free_range", -1,
"start fd=%d start=%lld length=%lld\n",
109 #ifdef SION_HINTS_GPFS 110 DPRINTFP((2,
"_sion_apply_hint_gpfs_free_range", -1,
"do apply\n"));
113 freeHint.hdr.totalLength =
sizeof(freeHint);
114 freeHint.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION;
115 freeHint.hdr.fcntlReserved = 0;
116 freeHint.free.structLen =
sizeof(freeHint.free);
117 freeHint.free.structType = GPFS_FREE_RANGE;
118 freeHint.free.start = start;
119 freeHint.free.length = length;
120 grc = gpfs_fcntl(fd, &freeHint);
122 _sion_errorprint(SION_NOT_SUCCESS,_SION_ERROR_RETURN,
"cannot set GPFS hint (free) for file fd=%d start=%lld length=%lld ... rc=%d\n",
123 fd, start, length, rc);
126 DPRINTFP((2,
"_sion_apply_hint_gpfs_free_range", -1,
"apply done rc=%d\n",rc));
int _sion_errorprint(int rc, int level, const char *format,...)
Internal SION error.