/*  This file is part of Whitix.
 *
 *  Whitix 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; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  Whitix is distributed in the hope that it will be useful,
 *  but 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 Whitix; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#include <reiserfs.h>

/* Document soon */

struct ReFsSuperBlock
{
	DWORD blockCount;
	DWORD freeBlocks;
	DWORD rootBlockNo;

	/* Journal information */
	DWORD journFirstBlock;
	DWORD journDev;
	DWORD journSize;
	DWORD journMaxTrans;
	DWORD journMagic;
	DWORD journMaxBatch;
	DWORD journMaxCommitAge;
	DWORD journMaxTransAge;

	WORD blockSize;
	WORD oidMaxSize;
	WORD oidCurSize;
	WORD uMountState;
	char magic[10];
	WORD fsState;
	DWORD hashFuncCode;
	WORD treeHeight;
	WORD bMapNo;
	WORD version;
	WORD reservedForJournal;

	DWORD vNodeGen;
	DWORD flags;
	BYTE uuid[16];
	BYTE label[16];
	char unUsed[88];
}PACKED;

struct SuperBlock* ReFsReadSuper(struct StorageDevice* dev,int flags,char* data)
{
	if (!dev || BlockSetSize(dev,1024))
		return NULL;

	struct Buffer* block=BlockRead(dev,0);
	if (!block)
		return NULL;

	ReFsSuperBlock* info=(RsFsSuperBlock*)(block->data);
	return true;
}

struct VfsFileSystem rFs={
};

int RFsInit()
{
	printf("ReiserFsInit\n");
}

FsInit(RFsInit);