[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

node types etc.



Please comment.


/* Compatibility flags. */
#define CJFFS_COMPAT_MASK 0xc000      /* What do to if an unknown nodetype is found */

/* INCOMPAT: Fail to mount the filesystem */
#define CJFFS_FEATURE_INCOMPAT 0xc000
/* ROCOMPAT: Mount read-only */
#define CJFFS_FEATURE_ROCOMPAT 0x8000
/* RWCOMPAT_COPY: Mount read/write, and copy the node when it's GC'd */
#define CJFFS_FEATURE_RWCOMPAT_COPY 0x4000
/* RWCOMPAT_DELETE: Mount read/write, and delete the node when it's GC'd */
#define CJFFS_FEATURE_RWCOMPAT_DELETE 0x0000

#define CJFFS_NODETYPE_DIRENT (CJFFS_FEATURE_INCOMPAT | 1)
#define CJFFS_NODETYPE_INODE (CJFFS_FEATURE_INCOMPAT | 2)
// Maybe later...
//#define CJFFS_NODETYPE_CHECKPOINT (CJFFS_FEATURE_RWCOMPAT_DELETE | 3)
//#define CJFFS_NODETYPE_OPTIONS (CJFFS_FEATURE_RWCOMPAT_COPY | 4)

struct cjffs_unknown_node
{
	/* All start like this */
	__u32 magic;
	__u16 nodetype;
	__u16 totlen; /* So we can skip over nodes we don't grok */
};

struct cjffs_raw_dirent
{
	__u32 magic;
	__u16 nodetype;	/* == JFFS_NODETYPE_DIRENT */
	__u16 totlen;
	__u32 pino;
	__u32 version;
	__u32 ino;
	__u8 spare:7;
	__u8 unlinked:1;
	__u8 nsize;
	__u16 chksum; /* including name */
//	__u8 name[nsize];
};

/* The CJFFS raw inode structure: Used for storage on physical media.  */
/* Perhaps the uid, gid, atime, mtime and ctime members should have
   more space due to future changes in the Linux kernel. Anyhow, since
   a user of this filesystem probably have to fix a large number of
   other things, we have decided to not be forward compatible.  */
struct cjffs_raw_inode
{
	__u32 magic;      /* A constant magic number.  */
	__u16 nodetype;   /* == JFFS_NODETYPE_INODE */
	__u16 totlen;     /* Total length of this node (inc data, etc.) */
	__u32 ino;        /* Inode number.  */
	__u32 version;    /* Version number.  */
	__u32 mode;       /* The file's type or mode.  */
	__u16 uid;        /* The file's owner.  */
	__u16 gid;        /* The file's group.  */
	__u32 atime;      /* Last access time.  */
	__u32 mtime;      /* Last modification time.  */
	__u32 ctime;      /* Creation time.  */
	__u32 offset;     /* Where to begin to write.  */
	__u32 csize;      /* (Compressed) data size */
	__u32 dsize;	  /* Size of the node's data. (after decompression) */
	__u32 rsize;      /* How much are going to be replaced?  */
	__u16 chksum;
	__u8 compr;       /* Compression algorithm used */
	__u8 spare:6;     /* For future use.  */
	__u8 deleted:1;   /* Has this inode been deleted?  */
	__u8 accurate:1;  /* This raw node is obsolete if accurate == 0.  */
	__u32 dchksum;    /* Checksum for the (compressed) data.  */
//	__u8 data[dsize];
};

--
dwmw2



To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com