Caching & direct i/o stuff for HP-UX, via VX_xxx ioctls.
This commit is contained in:
parent
3ce7d71749
commit
e42921d04a
|
@ -53,6 +53,10 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#ifdef __hpux__
|
||||||
|
# include <sys/fs/vx_ioctl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "core/debug.h"
|
#include "core/debug.h"
|
||||||
#include "core/corestrings.h"
|
#include "core/corestrings.h"
|
||||||
#include "core/fsservices.h"
|
#include "core/fsservices.h"
|
||||||
|
@ -223,7 +227,7 @@ void cFile::Open( const TSTRING& sFileNameC, uint32 flags )
|
||||||
|
|
||||||
cFile::Rewind();
|
cFile::Rewind();
|
||||||
|
|
||||||
#ifdef F_NOCACHE
|
#ifdef F_NOCACHE //OSX
|
||||||
if ((flags & OPEN_DIRECT) && (flags & OPEN_SCANNING))
|
if ((flags & OPEN_DIRECT) && (flags & OPEN_SCANNING))
|
||||||
fcntl(fh, F_NOCACHE, 1);
|
fcntl(fh, F_NOCACHE, 1);
|
||||||
#endif
|
#endif
|
||||||
|
@ -233,8 +237,22 @@ void cFile::Open( const TSTRING& sFileNameC, uint32 flags )
|
||||||
directio(fh, DIRECTIO_ON);
|
directio(fh, DIRECTIO_ON);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __hpux__
|
||||||
|
|
||||||
|
if (flags & OPEN_SCANNING)
|
||||||
|
{
|
||||||
|
if (flags & OPEN_DIRECT)
|
||||||
|
ioctl(fh, VX_SETCACHE, VX_DIRECT);
|
||||||
|
else
|
||||||
|
ioctl(fh, VX_SETCACHE, VX_SEQ | VX_NOREUSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_POSIX_FADVISE
|
#ifdef HAVE_POSIX_FADVISE
|
||||||
if (flags & OPEN_SCANNING) {
|
if (flags & OPEN_SCANNING)
|
||||||
|
{
|
||||||
posix_fadvise(fh,0,0, POSIX_FADV_SEQUENTIAL);
|
posix_fadvise(fh,0,0, POSIX_FADV_SEQUENTIAL);
|
||||||
posix_fadvise(fh,0,0, POSIX_FADV_NOREUSE);
|
posix_fadvise(fh,0,0, POSIX_FADV_NOREUSE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue