PERFORCE change 164354 for review

Aditya Sarawgi truncs at FreeBSD.org
Sun Jun 14 17:32:08 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=164354

Change 164354 by truncs at aditya on 2009/06/14 17:31:18

	New Directory structure. The max length of a name in directory is EXT2FS_MAXNAMLEN. Ext2 rev 0 has 16 bits of e2d_namelen but for rev 1 
	this has been split into 8 bits e2d_namlen and 8 bits e2d_type.

Affected files ...

.. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_fs.h#20 edit

Differences ...

==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_fs.h#20 (text+ko) ====

@@ -235,27 +235,16 @@
 /*
  * Inode flags
  */
-#define	EXT2_SECRM_FL			0x00000001 /* Secure deletion */
-#define	EXT2_UNRM_FL			0x00000002 /* Undelete */
-#define	EXT2_COMPR_FL			0x00000004 /* Compress file */
-#define EXT2_SYNC_FL			0x00000008 /* Synchronous updates */
-#define EXT2_IMMUTABLE_FL		0x00000010 /* Immutable file */
-#define EXT2_APPEND_FL			0x00000020 /* writes to file may only append */
-#define EXT2_NODUMP_FL			0x00000040 /* do not dump file */
-#define EXT2_NOATIME_FL			0x00000080 /* do not update atime */
-/* Reserved for compression usage... */
-#define EXT2_DIRTY_FL			0x00000100
-#define EXT2_COMPRBLK_FL		0x00000200 /* One or more compressed clusters */
-#define EXT2_NOCOMP_FL			0x00000400 /* Don't compress */
-#define EXT2_ECOMPR_FL			0x00000800 /* Compression error */
-/* End compression flags --- maybe not all used */	
-#define EXT2_BTREE_FL			0x00001000 /* btree format dir */
-#define EXT2_RESERVED_FL		0x80000000 /* reserved for ext2 lib */
+#define EXT2_SECRM		0x00000001	/* Secure deletion */
+#define EXT2_UNRM		0x00000002	/* Undelete */
+#define EXT2_COMPR		0x00000004	/* Compress file */
+#define EXT2_SYNC		0x00000008	/* Synchronous updates */
+#define EXT2_IMMUTABLE		0x00000010	/* Immutable file */
+#define EXT2_APPEND		0x00000020	/* writes to file may only append */
+#define EXT2_NODUMP		0x00000040	/* do not dump file */
+#define EXT2_NOATIME		0x00000080	/* do not update atime */
 
-#define EXT2_FL_USER_VISIBLE		0x00001FFF /* User visible flags */
-#define EXT2_FL_USER_MODIFIABLE		0x000000FF /* User modifiable flags */
 
-
 /*
  * Structure of an inode on the disk
  */
@@ -362,7 +351,7 @@
 
 
 
-/* 
+/*
  * In-Memory Superblock
  */
 
@@ -401,7 +390,7 @@
 	uint32_t e2fs_blocksize_bits;
 	char e2fs_wasvalid;       /* valid at mount time */
 	off_t e2fs_maxfilesize;
-};	
+};
 
 
 #ifdef __KERNEL__
@@ -476,29 +465,27 @@
 /*
  * Structure of a directory entry
  */
-#define EXT2_NAME_LEN 255
+#define EXT2FS_MAXNAMLEN 255
 
-struct ext2_dir_entry {
-	__u32	inode;			/* Inode number */
-	__u16	rec_len;		/* Directory entry length */
-	__u16	name_len;		/* Name length */
-	char	name[EXT2_NAME_LEN];	/* File name */
+struct	ext2fs_direct {
+	u_int32_t e2d_ino;		/* inode number of entry */
+	u_int16_t e2d_reclen;		/* length of this record */
+	u_int16_t e2d_namlen;		/* length of string in d_name */
+	char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */
 };
-
 /*
  * The new version of the directory entry.  Since EXT2 structures are
  * stored in intel byte order, and the name_len field could never be
  * bigger than 255 chars, it's safe to reclaim the extra byte for the
  * file_type field.
  */
-struct ext2_dir_entry_2 {
-	__u32	inode;			/* Inode number */
-	__u16	rec_len;		/* Directory entry length */
-	__u8	name_len;		/* Name length */
-	__u8	file_type;
-	char	name[EXT2_NAME_LEN];	/* File name */
+struct	ext2fs_direct_2 {
+	u_int32_t e2d_ino;		/* inode number of entry */
+	u_int16_t e2d_reclen;		/* length of this record */
+	u_int8_t e2d_namlen;		/* length of string in d_name */
+	u_int8_t e2d_type;		/* file type */
+	char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */
 };
-
 /*
  * Ext2 directory file types.  Only the low 3 bits are used.  The
  * other bits are reserved for now.


More information about the p4-projects mailing list