 #define STORAGE_SIZE        1085440
 #define DATAFILE            "./data.bin"
 #define OUTPUTFILE          "./snapshot.bin"
+#define FILE_ENTRIES		1024
+#define DNE					0xffffffff
 typedef unsigned char uchar;
 typedef uint32_t u32;
 const int G_WRITE   = 1;

// ******************************************************************

// ******************************************************************
// FS Operation
__device__ u32 open(char *name, int type) {
    u32 fp = 0;
    printf("Open %s %d\n", name, type);
    return fp;
}

__device__ void write(uchar *src, int len, u32 fp) {
    // Not implement
    printf("Write %s %d %d\n", src, len, fp);
}

__device__ void read(uchar *dst, int len, u32 fp) {
    // Not implement
    printf("Read %s %d %d\n", dst, len, fp);
}

__device__ void gsys(int type) {
    // Not implement
    printf("Gsys %d\n", type);
}

__device__ void gsys(int type, char *name) {
    // Not implement
    printf("Gsys %d %s\n", type, name);
}


    return size;
}

void writeBinaryFile(const char *fileName, uchar *input, int fileSize) {
    FILE *fptr = fopen(fileName, "wb");
    // Read data from input file
    fwrite(input, sizeof(unsigned char), fileSize, fptr);
