Update version of Reliance Edge.

This commit is contained in:
Richard Barry 2016-11-21 04:30:49 +00:00
parent 7cce089e40
commit 7fcc976248
16 changed files with 4069 additions and 3493 deletions

View file

@ -0,0 +1,38 @@
/* ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
Copyright (c) 2014-2015 Datalight, Inc.
All Rights Reserved Worldwide.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; use version 2 of the License.
This program is distributed in the hope that it will be useful,
but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* Businesses and individuals that for commercial or other reasons cannot
comply with the terms of the GPLv2 license may obtain a commercial license
before incorporating Reliance Edge into proprietary software for
distribution in any form. Visit http://www.datalight.com/reliance-edge for
more information.
*/
/** @file
@brief Interfaces of path utilities for the POSIX-like API layer.
*/
#ifndef REDPATH_H
#define REDPATH_H
REDSTATUS RedPathSplit(const char *pszPath, uint8_t *pbVolNum, const char **ppszLocalPath);
REDSTATUS RedPathLookup(const char *pszLocalPath, uint32_t *pulInode);
REDSTATUS RedPathToName(const char *pszLocalPath, uint32_t *pulPInode, const char **ppszName);
#endif

View file

@ -1,249 +1,265 @@
/* ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
Copyright (c) 2014-2015 Datalight, Inc.
All Rights Reserved Worldwide.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; use version 2 of the License.
This program is distributed in the hope that it will be useful,
but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* Businesses and individuals that for commercial or other reasons cannot
comply with the terms of the GPLv2 license may obtain a commercial license
before incorporating Reliance Edge into proprietary software for
distribution in any form. Visit http://www.datalight.com/reliance-edge for
more information.
*/
/** @file
@brief Prototypes for Reliance Edge test entry points.
*/
#ifndef REDTESTS_H
#define REDTESTS_H
#include <redtypes.h>
#include "redtestutils.h"
#include "redver.h"
/* This macro is only defined by the error injection project.
*/
#ifdef REDCONF_ERROR_INJECTION
#include <rederrinject.h>
#endif
#define FSSTRESS_SUPPORTED \
( ((RED_KIT == RED_KIT_GPL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_PATH_SEPARATOR == '/') \
&& (REDCONF_API_POSIX == 1) && (REDCONF_API_POSIX_UNLINK == 1) && (REDCONF_API_POSIX_MKDIR == 1) \
&& (REDCONF_API_POSIX_RMDIR == 1) && (REDCONF_API_POSIX_RENAME == 1) && (REDCONF_API_POSIX_LINK == 1) \
&& (REDCONF_API_POSIX_FTRUNCATE == 1) && (REDCONF_API_POSIX_READDIR == 1))
#define FSE_STRESS_TEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_API_FSE == 1) \
&& (REDCONF_API_FSE_FORMAT == 1) && (REDCONF_API_FSE_TRANSMASKSET == 1) && (REDCONF_API_FSE_TRANSMASKGET == 1) \
&& (REDCONF_API_FSE_TRUNCATE == 1))
#define POSIX_API_TEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_API_POSIX == 1) \
&& (REDCONF_API_POSIX_FORMAT == 1) && (REDCONF_API_POSIX_UNLINK == 1))
#define FSE_API_TEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_API_FSE == 1) \
&& (REDCONF_API_FSE_FORMAT == 1))
#define STOCH_POSIX_TEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_API_POSIX == 1) \
&& (REDCONF_READ_ONLY == 0) && (REDCONF_API_POSIX_FORMAT == 1) && (REDCONF_API_POSIX_READDIR == 1) \
&& (REDCONF_API_POSIX_MKDIR == 1) && (REDCONF_API_POSIX_RMDIR == 1) && (REDCONF_API_POSIX_UNLINK == 1) \
&& (REDCONF_API_POSIX_RENAME == 1))
#define FSIOTEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_API_POSIX == 1))
#define BDEVTEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0))
#define DISKFULL_TEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_API_POSIX == 1) \
&& (REDCONF_API_POSIX_FORMAT == 1) && (REDCONF_API_POSIX_FTRUNCATE == 1))
typedef enum
{
PARAMSTATUS_OK, /* Parameters were good; continue. */
PARAMSTATUS_BAD, /* Parameters were bad; stop. */
PARAMSTATUS_HELP /* Help request; not an error, but stop. */
} PARAMSTATUS;
#if FSSTRESS_SUPPORTED
typedef struct
{
bool fNoCleanup; /**< --no-cleanup */
uint32_t ulLoops; /**< --loops */
uint32_t ulNops; /**< --nops */
bool fNamePad; /**< --namepad */
uint32_t ulSeed; /**< --seed */
bool fVerbose; /**< --verbose */
} FSSTRESSPARAM;
PARAMSTATUS FsstressParseParams(int argc, char *argv[], FSSTRESSPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void FsstressDefaultParams(FSSTRESSPARAM *pParam);
int FsstressStart(const FSSTRESSPARAM *pParam);
#endif
#if STOCH_POSIX_TEST_SUPPORTED
typedef struct
{
const char *pszVolume; /**< Volume path prefix. */
uint32_t ulIterations; /**< --iterations */
uint32_t ulFileListMax; /**< --files */
uint32_t ulDirListMax; /**< --dirs */
uint32_t ulOpenFileListMax; /**< --open-files */
uint32_t ulOpenDirListMax; /**< --open-dirs */
uint32_t ulRandomSeed; /**< --seed */
} STOCHPOSIXPARAM;
PARAMSTATUS RedStochPosixParseParams(int argc, char *argv[], STOCHPOSIXPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void RedStochPosixDefaultParams(STOCHPOSIXPARAM *pParam);
int RedStochPosixStart(const STOCHPOSIXPARAM *pParam);
#endif
#if FSE_STRESS_TEST_SUPPORTED
typedef struct
{
uint8_t bVolNum; /**< Volume number. */
uint32_t ulFileCount; /**< --files */
uint32_t ulMaxFileSize; /**< --max */
uint32_t ulMaxOpSize; /**< --buffer-size */
uint32_t ulNops; /**< --nops */
uint32_t ulLoops; /**< --loops */
uint32_t ulSampleRate; /**< --sample-rate */
uint64_t ullSeed; /**< --seed */
} FSESTRESSPARAM;
PARAMSTATUS FseStressParseParams(int argc, char *argv[], FSESTRESSPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void FseStressDefaultParams(FSESTRESSPARAM *pParam);
int FseStressStart(const FSESTRESSPARAM *pParam);
#endif
#if POSIX_API_TEST_SUPPORTED
typedef struct
{
const char *pszVolume; /**< Volume path prefix. */
bool fQuick; /**< --quick */
bool fQuitOnFailure; /**< --quit-on-failure */
bool fDebugErrors; /**< --debug */
} POSIXTESTPARAM;
PARAMSTATUS RedPosixTestParseParams(int argc, char *argv[], POSIXTESTPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void RedPosixTestDefaultParams(POSIXTESTPARAM *pParam);
int RedPosixTestStart(const POSIXTESTPARAM *pParam);
#endif
#if FSE_API_TEST_SUPPORTED
typedef struct
{
uint8_t bVolNum; /**< Volume number. */
bool fQuitOnFailure; /**< --quit-on-failure */
bool fDebugErrors; /**< --debug */
} FSETESTPARAM;
PARAMSTATUS RedFseTestParseParams(int argc, char *argv[], FSETESTPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void RedFseTestDefaultParams(FSETESTPARAM *pParam);
int RedFseTestStart(const FSETESTPARAM *pParam);
#endif
#if FSIOTEST_SUPPORTED
typedef enum
{
TESTFS_RELEDGE, /* Datalight Reliance Edge */
TESTFS_FATFS, /* ChaN's FatFs */
TESTFS_FATSL /* FreeRTOS+FAT SL */
} TESTFS;
typedef struct
{
TESTFS testfs; /**< --fs */
const char *pszVolume; /**< Volume path prefix. */
bool fSeqRead; /**< --seq=r */
bool fSeqWrite; /**< --seq=w */
bool fSeqRewrite; /**< --seq=e */
bool fRandomRead; /**< --rand=r */
bool fRandomWrite; /**< --rand=w */
bool fMixedWrite; /**< --mixed */
bool fScanTest; /**< --scan */
uint32_t ulFSBlockSize; /**< --block-size */
uint32_t ulMaxFileSize; /**< --max */
uint32_t ulRandomReadPasses; /**< --rand-pass=r:w (r part) */
uint32_t ulRandomWritePasses; /**< --rand-pass=r:w (w part) */
uint32_t ulMixedWritePasses; /**< --mixed-pass */
int32_t iFlushOnWriteRatio; /**< --rand-fow */
uint32_t ulBufferMin; /**< --start */
uint32_t ulBufferSize; /**< --buffer-size */
bool fWriteVerify; /**< --verify */
uint32_t ulSampleRate; /**< --sample-rate */
uint32_t ulScanCount; /**< --scan-files */
uint64_t ullSeed; /**< --seed */
} FSIOTESTPARAM;
PARAMSTATUS FSIOTestParseParams(int argc, char *argv[], FSIOTESTPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void FSIOTestDefaultParams(FSIOTESTPARAM *pParam);
int FSIOTestStart(const FSIOTESTPARAM *pParam);
#endif
#if BDEVTEST_SUPPORTED
typedef struct
{
uint8_t bDrvNum; /**< Volume number (for sector size/count). */
bool fSeqWrite; /**< --seq:w */
bool fSeqRead; /**< --seq:r */
bool fRandWrite; /**< --rand:w */
bool fRandRead; /**< --rand:r */
uint32_t ulSampleSecs; /**< --sample-rate */
uint32_t ulPasses; /**< --passes */
uint32_t ulMinIOSectors; /**< --count=min[:max] (min part) */
uint32_t ulMaxIOSectors; /**< --count=min[:max] (max part) */
uint32_t ulMaxSizeKB; /**< --max */
uint32_t ulTestSeconds; /**< --time */
bool fVerify; /**< --verify */
bool fAsyncWrites; /**< --async */
uint64_t ullSeed; /**< --seed */
} BDEVTESTPARAM;
PARAMSTATUS BDevTestParseParams(int argc, char *argv[], BDEVTESTPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void BDevTestDefaultParams(BDEVTESTPARAM *pParam);
int BDevTestStart(const BDEVTESTPARAM *pParam);
#endif
#if DISKFULL_TEST_SUPPORTED
typedef struct
{
const char *pszVolume; /**< Volume path prefix. */
bool fQuitOnFailure; /**< --quit-on-failure */
bool fDebugErrors; /**< --debug */
} DISKFULLTESTPARAM;
PARAMSTATUS DiskFullTestParseParams(int argc, char *argv[], DISKFULLTESTPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void DiskFullTestDefaultParams(DISKFULLTESTPARAM *pParam);
int DiskFullTestStart(const DISKFULLTESTPARAM *pParam);
#endif
#endif
/* ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
Copyright (c) 2014-2015 Datalight, Inc.
All Rights Reserved Worldwide.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; use version 2 of the License.
This program is distributed in the hope that it will be useful,
but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* Businesses and individuals that for commercial or other reasons cannot
comply with the terms of the GPLv2 license may obtain a commercial license
before incorporating Reliance Edge into proprietary software for
distribution in any form. Visit http://www.datalight.com/reliance-edge for
more information.
*/
/** @file
@brief Prototypes for Reliance Edge test entry points.
*/
#ifndef REDTESTS_H
#define REDTESTS_H
#include <redtypes.h>
#include "redtestutils.h"
#include "redver.h"
/* This macro is only defined by the error injection project.
*/
#ifdef REDCONF_ERROR_INJECTION
#include <rederrinject.h>
#endif
#define FSSTRESS_SUPPORTED \
( ((RED_KIT == RED_KIT_GPL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_PATH_SEPARATOR == '/') \
&& (REDCONF_API_POSIX == 1) && (REDCONF_API_POSIX_UNLINK == 1) && (REDCONF_API_POSIX_MKDIR == 1) \
&& (REDCONF_API_POSIX_RMDIR == 1) && (REDCONF_API_POSIX_RENAME == 1) && (REDCONF_API_POSIX_LINK == 1) \
&& (REDCONF_API_POSIX_FTRUNCATE == 1) && (REDCONF_API_POSIX_READDIR == 1))
#define FSE_STRESS_TEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_API_FSE == 1) \
&& (REDCONF_API_FSE_FORMAT == 1) && (REDCONF_API_FSE_TRANSMASKSET == 1) && (REDCONF_API_FSE_TRANSMASKGET == 1) \
&& (REDCONF_API_FSE_TRUNCATE == 1))
#define POSIX_API_TEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_API_POSIX == 1) \
&& (REDCONF_API_POSIX_FORMAT == 1) && (REDCONF_API_POSIX_UNLINK == 1))
#define FSE_API_TEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_API_FSE == 1) \
&& (REDCONF_API_FSE_FORMAT == 1))
#define STOCH_POSIX_TEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_API_POSIX == 1) \
&& (REDCONF_READ_ONLY == 0) && (REDCONF_API_POSIX_FORMAT == 1) && (REDCONF_API_POSIX_READDIR == 1) \
&& (REDCONF_API_POSIX_MKDIR == 1) && (REDCONF_API_POSIX_RMDIR == 1) && (REDCONF_API_POSIX_UNLINK == 1) \
&& (REDCONF_API_POSIX_RENAME == 1))
#define FSIOTEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_API_POSIX == 1))
#define BDEVTEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0))
#define DISKFULL_TEST_SUPPORTED \
( ((RED_KIT == RED_KIT_COMMERCIAL) || (RED_KIT == RED_KIT_SANDBOX)) \
&& (REDCONF_OUTPUT == 1) && (REDCONF_READ_ONLY == 0) && (REDCONF_API_POSIX == 1) \
&& (REDCONF_API_POSIX_FORMAT == 1) && (REDCONF_API_POSIX_FTRUNCATE == 1))
typedef enum
{
PARAMSTATUS_OK, /* Parameters were good; continue. */
PARAMSTATUS_BAD, /* Parameters were bad; stop. */
PARAMSTATUS_HELP /* Help request; not an error, but stop. */
} PARAMSTATUS;
#if FSSTRESS_SUPPORTED
typedef struct
{
bool fNoCleanup; /**< --no-cleanup */
uint32_t ulLoops; /**< --loops */
uint32_t ulNops; /**< --nops */
bool fNamePad; /**< --namepad */
uint32_t ulSeed; /**< --seed */
bool fVerbose; /**< --verbose */
} FSSTRESSPARAM;
PARAMSTATUS FsstressParseParams(int argc, char *argv[], FSSTRESSPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void FsstressDefaultParams(FSSTRESSPARAM *pParam);
int FsstressStart(const FSSTRESSPARAM *pParam);
#endif
#if STOCH_POSIX_TEST_SUPPORTED
typedef struct
{
const char *pszVolume; /**< Volume path prefix. */
uint32_t ulIterations; /**< --iterations */
uint32_t ulFileListMax; /**< --files */
uint32_t ulDirListMax; /**< --dirs */
uint32_t ulOpenFileListMax; /**< --open-files */
uint32_t ulOpenDirListMax; /**< --open-dirs */
uint32_t ulRandomSeed; /**< --seed */
} STOCHPOSIXPARAM;
PARAMSTATUS RedStochPosixParseParams(int argc, char *argv[], STOCHPOSIXPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void RedStochPosixDefaultParams(STOCHPOSIXPARAM *pParam);
int RedStochPosixStart(const STOCHPOSIXPARAM *pParam);
#endif
#if FSE_STRESS_TEST_SUPPORTED
typedef struct
{
uint8_t bVolNum; /**< Volume number. */
uint32_t ulFileCount; /**< --files */
uint32_t ulMaxFileSize; /**< --max */
uint32_t ulMaxOpSize; /**< --buffer-size */
uint32_t ulNops; /**< --nops */
uint32_t ulLoops; /**< --loops */
uint32_t ulSampleRate; /**< --sample-rate */
uint64_t ullSeed; /**< --seed */
} FSESTRESSPARAM;
PARAMSTATUS FseStressParseParams(int argc, char *argv[], FSESTRESSPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void FseStressDefaultParams(FSESTRESSPARAM *pParam);
int FseStressStart(const FSESTRESSPARAM *pParam);
#endif
#if POSIX_API_TEST_SUPPORTED
typedef struct
{
const char *pszVolume; /**< Volume path prefix. */
bool fQuick; /**< --quick */
bool fQuitOnFailure; /**< --quit-on-failure */
bool fDebugErrors; /**< --debug */
} POSIXTESTPARAM;
PARAMSTATUS RedPosixTestParseParams(int argc, char *argv[], POSIXTESTPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void RedPosixTestDefaultParams(POSIXTESTPARAM *pParam);
int RedPosixTestStart(const POSIXTESTPARAM *pParam);
#endif
#if POSIX_API_TEST_SUPPORTED
typedef struct
{
const char *pszVolume; /**< Volume path prefix. */
bool fQuick; /**< --quick */
bool fVerbose; /**< --verbose */
bool fQuitOnFailure; /**< --quit-on-failure */
bool fDebugErrors; /**< --debug */
} OSAPITESTPARAM;
PARAMSTATUS RedOsApiTestParseParams(int argc, char *argv[], OSAPITESTPARAM *pParam, const char **ppszDevice);
void RedOsApiTestDefaultParams(OSAPITESTPARAM *pParam);
int RedOsApiTestStart(const OSAPITESTPARAM *pParam);
#endif
#if FSE_API_TEST_SUPPORTED
typedef struct
{
uint8_t bVolNum; /**< Volume number. */
bool fQuitOnFailure; /**< --quit-on-failure */
bool fDebugErrors; /**< --debug */
} FSETESTPARAM;
PARAMSTATUS RedFseTestParseParams(int argc, char *argv[], FSETESTPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void RedFseTestDefaultParams(FSETESTPARAM *pParam);
int RedFseTestStart(const FSETESTPARAM *pParam);
#endif
#if FSIOTEST_SUPPORTED
typedef enum
{
TESTFS_RELEDGE, /* Datalight Reliance Edge */
TESTFS_FATFS, /* ChaN's FatFs */
TESTFS_FATSL /* FreeRTOS+FAT SL */
} TESTFS;
typedef struct
{
TESTFS testfs; /**< --fs */
const char *pszVolume; /**< Volume path prefix. */
bool fSeqRead; /**< --seq=r */
bool fSeqWrite; /**< --seq=w */
bool fSeqRewrite; /**< --seq=e */
bool fRandomRead; /**< --rand=r */
bool fRandomWrite; /**< --rand=w */
bool fMixedWrite; /**< --mixed */
bool fScanTest; /**< --scan */
uint32_t ulFSBlockSize; /**< --block-size */
uint32_t ulMaxFileSize; /**< --max */
uint32_t ulRandomReadPasses; /**< --rand-pass=r:w (r part) */
uint32_t ulRandomWritePasses; /**< --rand-pass=r:w (w part) */
uint32_t ulMixedWritePasses; /**< --mixed-pass */
int32_t iFlushOnWriteRatio; /**< --rand-fow */
uint32_t ulBufferMin; /**< --start */
uint32_t ulBufferSize; /**< --buffer-size */
bool fWriteVerify; /**< --verify */
uint32_t ulSampleRate; /**< --sample-rate */
uint32_t ulScanCount; /**< --scan-files */
uint64_t ullSeed; /**< --seed */
} FSIOTESTPARAM;
PARAMSTATUS FSIOTestParseParams(int argc, char *argv[], FSIOTESTPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void FSIOTestDefaultParams(FSIOTESTPARAM *pParam);
int FSIOTestStart(const FSIOTESTPARAM *pParam);
#endif
#if BDEVTEST_SUPPORTED
typedef struct
{
uint8_t bDrvNum; /**< Volume number (for sector size/count). */
bool fSeqWrite; /**< --seq:w */
bool fSeqRead; /**< --seq:r */
bool fRandWrite; /**< --rand:w */
bool fRandRead; /**< --rand:r */
uint32_t ulSampleSecs; /**< --sample-rate */
uint32_t ulPasses; /**< --passes */
uint32_t ulMinIOSectors; /**< --count=min[:max] (min part) */
uint32_t ulMaxIOSectors; /**< --count=min[:max] (max part) */
uint32_t ulMaxSizeKB; /**< --max */
uint32_t ulTestSeconds; /**< --time */
bool fVerify; /**< --verify */
bool fAsyncWrites; /**< --async */
uint64_t ullSeed; /**< --seed */
} BDEVTESTPARAM;
PARAMSTATUS BDevTestParseParams(int argc, char *argv[], BDEVTESTPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void BDevTestDefaultParams(BDEVTESTPARAM *pParam);
int BDevTestStart(const BDEVTESTPARAM *pParam);
#endif
#if DISKFULL_TEST_SUPPORTED
typedef struct
{
const char *pszVolume; /**< Volume path prefix. */
bool fQuitOnFailure; /**< --quit-on-failure */
bool fDebugErrors; /**< --debug */
} DISKFULLTESTPARAM;
PARAMSTATUS DiskFullTestParseParams(int argc, char *argv[], DISKFULLTESTPARAM *pParam, uint8_t *pbVolNum, const char **ppszDevice);
void DiskFullTestDefaultParams(DISKFULLTESTPARAM *pParam);
int DiskFullTestStart(const DISKFULLTESTPARAM *pParam);
#endif
#endif

View file

@ -33,7 +33,7 @@
<!-- This macro is updated automatically: do not edit! -->
*/
#define RED_BUILD_NUMBER "664"
#define RED_BUILD_NUMBER "677"
#define RED_KIT_GPL 0U /* Open source GPL kit. */
#define RED_KIT_COMMERCIAL 1U /* Commercially-licensed kit. */
@ -48,7 +48,7 @@
/** @brief Version number to display in output.
*/
#define RED_VERSION "v1.0"
#define RED_VERSION "v1.0.4"
/** @brief On-disk version number.
@ -78,12 +78,12 @@
/** @brief Full product name and version.
*/
#define RED_PRODUCT_NAME "Datalight "RED_PRODUCT_BASE_NAME" "RED_VERSION" Build "RED_BUILD_NUMBER ALPHABETA
#define RED_PRODUCT_NAME "Datalight " RED_PRODUCT_BASE_NAME " " RED_VERSION " Build " RED_BUILD_NUMBER ALPHABETA
/** @brief Product copyright.
*/
#define RED_PRODUCT_LEGAL "Copyright (c) 2014-2015 Datalight, Inc. All Rights Reserved Worldwide."
#define RED_PRODUCT_LEGAL "Copyright (c) 2014-2016 Datalight, Inc. All Rights Reserved Worldwide."
/** @brief Product patents.
@ -94,11 +94,11 @@
/** @brief Product edition.
*/
#if RED_KIT == RED_KIT_GPL
#define RED_PRODUCT_EDITION "Open-Source GPLv2 Edition -- Compiled "__DATE__" at "__TIME__
#define RED_PRODUCT_EDITION "Open-Source GPLv2 Edition -- Compiled " __DATE__ " at " __TIME__
#elif RED_KIT == RED_KIT_COMMERCIAL
#define RED_PRODUCT_EDITION "Commercial Edition -- Compiled "__DATE__" at "__TIME__
#define RED_PRODUCT_EDITION "Commercial Edition -- Compiled " __DATE__ " at " __TIME__
#else
#define RED_PRODUCT_EDITION "Developer Sandbox -- Compiled "__DATE__" at "__TIME__
#define RED_PRODUCT_EDITION "Developer Sandbox -- Compiled " __DATE__ " at " __TIME__
#endif

View file

@ -1,134 +1,141 @@
/* ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
Copyright (c) 2014-2015 Datalight, Inc.
All Rights Reserved Worldwide.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; use version 2 of the License.
This program is distributed in the hope that it will be useful,
but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* Businesses and individuals that for commercial or other reasons cannot
comply with the terms of the GPLv2 license may obtain a commercial license
before incorporating Reliance Edge into proprietary software for
distribution in any form. Visit http://www.datalight.com/reliance-edge for
more information.
*/
/** @file
*/
#ifndef REDVOLUME_H
#define REDVOLUME_H
/** @brief Per-volume configuration structure.
Contains the configuration values that may differ between volumes. Must be
declared in an array in redconf.c in the Reliance Edge project directory and
statically initialized with values representing the volume configuration of
the target system.
*/
typedef struct
{
/** The sector size for the block device underlying the volume: the basic
unit for reading and writing to the storage media. Commonly ranges
between 512 and 4096, but any power-of-two value not greater than the
block size will work.
*/
uint32_t ulSectorSize;
/** The number of sectors in this file system volume.
*/
uint64_t ullSectorCount;
/** Whether a sector write on the block device underlying the volume is
atomic. It is atomic if when the sector write is interrupted, the
contents of the sector are guaranteed to be either all of the new data,
or all of the old data. If unsure, leave as false.
*/
bool fAtomicSectorWrite;
/** This is the maximum number of inodes (files and directories). This
number includes the root directory inode (inode 2; created during
format), but does not include inodes 0 or 1, which do not exist on
disk. The number of inodes cannot be less than 1.
*/
uint32_t ulInodeCount;
#if REDCONF_API_POSIX == 1
/** The path prefix for the volume; for example, "VOL1:", "FlashDisk", etc.
*/
const char *pszPathPrefix;
#endif
} VOLCONF;
extern const VOLCONF gaRedVolConf[REDCONF_VOLUME_COUNT];
extern const VOLCONF * CONST_IF_ONE_VOLUME gpRedVolConf;
/** @brief Per-volume run-time data.
*/
typedef struct
{
/** Whether the volume is currently mounted.
*/
bool fMounted;
#if REDCONF_READ_ONLY == 0
/** Whether the volume is read-only.
*/
bool fReadOnly;
/** The active automatic transaction mask.
*/
uint32_t ulTransMask;
#endif
/** The power of 2 difference between sector size and block size.
*/
uint8_t bBlockSectorShift;
/** The number of logical blocks in this file system volume. The unit here
is the global block size.
*/
uint32_t ulBlockCount;
/** The total number of allocable blocks; Also the maximum count of free
blocks.
*/
uint32_t ulBlocksAllocable;
/** The maximum number of bytes that an inode is capable of addressing.
*/
uint64_t ullMaxInodeSize;
/** The current metadata sequence number. This value is included in all
metadata nodes and incremented every time a metadata node is written.
It is assumed to never wrap around.
*/
uint64_t ullSequence;
} VOLUME;
/* Array of VOLUME structures, populated at during RedCoreInit().
*/
extern VOLUME gaRedVolume[REDCONF_VOLUME_COUNT];
/* Volume number currently being accessed; populated during
RedCoreVolSetCurrent().
*/
extern CONST_IF_ONE_VOLUME uint8_t gbRedVolNum;
/* Pointer to the volume currently being accessed; populated during
RedCoreVolSetCurrent().
*/
extern VOLUME * CONST_IF_ONE_VOLUME gpRedVolume;
#endif
/* ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
Copyright (c) 2014-2015 Datalight, Inc.
All Rights Reserved Worldwide.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; use version 2 of the License.
This program is distributed in the hope that it will be useful,
but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* Businesses and individuals that for commercial or other reasons cannot
comply with the terms of the GPLv2 license may obtain a commercial license
before incorporating Reliance Edge into proprietary software for
distribution in any form. Visit http://www.datalight.com/reliance-edge for
more information.
*/
/** @file
*/
#ifndef REDVOLUME_H
#define REDVOLUME_H
/** @brief Per-volume configuration structure.
Contains the configuration values that may differ between volumes. Must be
declared in an array in redconf.c in the Reliance Edge project directory and
statically initialized with values representing the volume configuration of
the target system.
*/
typedef struct
{
/** The sector size for the block device underlying the volume: the basic
unit for reading and writing to the storage media. Commonly ranges
between 512 and 4096, but any power-of-two value not greater than the
block size will work.
*/
uint32_t ulSectorSize;
/** The number of sectors in this file system volume.
*/
uint64_t ullSectorCount;
/** Whether a sector write on the block device underlying the volume is
atomic. It is atomic if when the sector write is interrupted, the
contents of the sector are guaranteed to be either all of the new data,
or all of the old data. If unsure, leave as false.
*/
bool fAtomicSectorWrite;
/** This is the maximum number of inodes (files and directories). This
number includes the root directory inode (inode 2; created during
format), but does not include inodes 0 or 1, which do not exist on
disk. The number of inodes cannot be less than 1.
*/
uint32_t ulInodeCount;
/** This is the maximum number of times a block device I/O operation will
be retried. If a block device read, write, or flush fails, Reliance
Edge will try again up to this number of times until the operation is
successful. Set this to 0 to disable retries.
*/
uint8_t bBlockIoRetries;
#if REDCONF_API_POSIX == 1
/** The path prefix for the volume; for example, "VOL1:", "FlashDisk", etc.
*/
const char *pszPathPrefix;
#endif
} VOLCONF;
extern const VOLCONF gaRedVolConf[REDCONF_VOLUME_COUNT];
extern const VOLCONF * CONST_IF_ONE_VOLUME gpRedVolConf;
/** @brief Per-volume run-time data.
*/
typedef struct
{
/** Whether the volume is currently mounted.
*/
bool fMounted;
#if REDCONF_READ_ONLY == 0
/** Whether the volume is read-only.
*/
bool fReadOnly;
/** The active automatic transaction mask.
*/
uint32_t ulTransMask;
#endif
/** The power of 2 difference between sector size and block size.
*/
uint8_t bBlockSectorShift;
/** The number of logical blocks in this file system volume. The unit here
is the global block size.
*/
uint32_t ulBlockCount;
/** The total number of allocable blocks; Also the maximum count of free
blocks.
*/
uint32_t ulBlocksAllocable;
/** The maximum number of bytes that an inode is capable of addressing.
*/
uint64_t ullMaxInodeSize;
/** The current metadata sequence number. This value is included in all
metadata nodes and incremented every time a metadata node is written.
It is assumed to never wrap around.
*/
uint64_t ullSequence;
} VOLUME;
/* Array of VOLUME structures, populated at during RedCoreInit().
*/
extern VOLUME gaRedVolume[REDCONF_VOLUME_COUNT];
/* Volume number currently being accessed; populated during
RedCoreVolSetCurrent().
*/
extern CONST_IF_ONE_VOLUME uint8_t gbRedVolNum;
/* Pointer to the volume currently being accessed; populated during
RedCoreVolSetCurrent().
*/
extern VOLUME * CONST_IF_ONE_VOLUME gpRedVolume;
#endif