Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jun 2013 16:10:46 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r251809 - head/sys/fs/ext2fs
Message-ID:  <201306161610.r5GGAk6x086100@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sun Jun 16 16:10:45 2013
New Revision: 251809
URL: http://svnweb.freebsd.org/changeset/base/251809

Log:
  Re-sort ext2fs headers to make things easier to find.
  
  In the ext2fs driver we have a mixture of headers:
  
  - The ext2_ prefixed headers have strong influence from NetBSD
  and are carry specific ext2/3/4 information.
  - The unprefixed headers are inspired on UFS and carry implementation
  specific information.
  
  Do some small adjustments so that the information is easier to
  find coming from either UFS or the NetBSD implementation.
  
  MFC after:	3 days

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c
  head/sys/fs/ext2fs/ext2_balloc.c
  head/sys/fs/ext2fs/ext2_dinode.h
  head/sys/fs/ext2fs/ext2fs.h
  head/sys/fs/ext2fs/fs.h
  head/sys/fs/ext2fs/inode.h

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_alloc.c	Sun Jun 16 16:07:34 2013	(r251808)
+++ head/sys/fs/ext2fs/ext2_alloc.c	Sun Jun 16 16:10:45 2013	(r251809)
@@ -46,10 +46,10 @@
 #include <sys/syslog.h>
 #include <sys/buf.h>
 
+#include <fs/ext2fs/fs.h>
 #include <fs/ext2fs/inode.h>
 #include <fs/ext2fs/ext2_mount.h>
 #include <fs/ext2fs/ext2fs.h>
-#include <fs/ext2fs/fs.h>
 #include <fs/ext2fs/ext2_extern.h>
 
 static daddr_t	ext2_alloccg(struct inode *, int, daddr_t, int);

Modified: head/sys/fs/ext2fs/ext2_balloc.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_balloc.c	Sun Jun 16 16:07:34 2013	(r251808)
+++ head/sys/fs/ext2fs/ext2_balloc.c	Sun Jun 16 16:10:45 2013	(r251809)
@@ -44,11 +44,13 @@
 #include <sys/mount.h>
 #include <sys/vnode.h>
 
+#include <fs/ext2fs/fs.h>
 #include <fs/ext2fs/inode.h>
 #include <fs/ext2fs/ext2fs.h>
-#include <fs/ext2fs/fs.h>
+#include <fs/ext2fs/ext2_dinode.h>
 #include <fs/ext2fs/ext2_extern.h>
 #include <fs/ext2fs/ext2_mount.h>
+
 /*
  * Balloc defines the structure of filesystem storage
  * by allocating the physical blocks on a device given

Modified: head/sys/fs/ext2fs/ext2_dinode.h
==============================================================================
--- head/sys/fs/ext2fs/ext2_dinode.h	Sun Jun 16 16:07:34 2013	(r251808)
+++ head/sys/fs/ext2fs/ext2_dinode.h	Sun Jun 16 16:10:45 2013	(r251809)
@@ -81,6 +81,16 @@
 				    EXT2F_ROCOMPAT_EXTRA_ISIZE))
 
 /*
+ * Constants relative to the data blocks
+ */
+#define	EXT2_NDIR_BLOCKS		12
+#define	EXT2_IND_BLOCK			EXT2_NDIR_BLOCKS
+#define	EXT2_DIND_BLOCK			(EXT2_IND_BLOCK + 1)
+#define	EXT2_TIND_BLOCK			(EXT2_DIND_BLOCK + 1)
+#define	EXT2_N_BLOCKS			(EXT2_TIND_BLOCK + 1)
+#define EXT2_MAXSYMLINKLEN		(EXT2_N_BLOCKS * sizeof(uint32_t))
+
+/*
  * Structure of an inode on the disk
  */
 struct ext2fs_dinode {

Modified: head/sys/fs/ext2fs/ext2fs.h
==============================================================================
--- head/sys/fs/ext2fs/ext2fs.h	Sun Jun 16 16:07:34 2013	(r251808)
+++ head/sys/fs/ext2fs/ext2fs.h	Sun Jun 16 16:10:45 2013	(r251809)
@@ -45,26 +45,6 @@
 #define EXT2_LINK_MAX		32000
 
 /*
- * A summary of contiguous blocks of various sizes is maintained
- * in each cylinder group. Normally this is set by the initial
- * value of fs_maxcontig.
- *
- * XXX:FS_MAXCONTIG is set to 16 to conserve space. Here we set
- * EXT2_MAXCONTIG to 32 for better performance.
- */
-#define EXT2_MAXCONTIG		32
-
-/*
- * Constants relative to the data blocks
- */
-#define	EXT2_NDIR_BLOCKS		12
-#define	EXT2_IND_BLOCK			EXT2_NDIR_BLOCKS
-#define	EXT2_DIND_BLOCK			(EXT2_IND_BLOCK + 1)
-#define	EXT2_TIND_BLOCK			(EXT2_DIND_BLOCK + 1)
-#define	EXT2_N_BLOCKS			(EXT2_TIND_BLOCK + 1)
-#define EXT2_MAXSYMLINKLEN		(EXT2_N_BLOCKS * sizeof(uint32_t))
-
-/*
  * The path name on which the file system is mounted is maintained
  * in fs_fsmnt. MAXMNTLEN defines the amount of space allocated in
  * the super block for this name.
@@ -175,11 +155,12 @@ struct m_ext2fs {
 	struct   csum *e2fs_clustersum; /* cluster summary in each cyl group */
 };
 
-/*
- * The second extended file system version
- */
-#define E2FS_DATE		"95/08/09"
-#define E2FS_VERSION		"0.5b"
+/* cluster summary information */
+
+struct csum {
+	int8_t   cs_init; /* cluster summary has been initialized */
+	int32_t *cs_sum;  /* cluster summary array */
+};
 
 /*
  * The second extended file system magic number
@@ -192,9 +173,6 @@ struct m_ext2fs {
 #define E2FS_REV0		0	/* The good old (original) format */
 #define E2FS_REV1		1 	/* V2 format w/ dynamic inode sizes */
 
-#define E2FS_CURRENT_REV	E2FS_REV0
-#define E2FS_MAX_SUPP_REV	E2FS_REV1
-
 #define E2FS_REV0_INODE_SIZE 128
 
 /*
@@ -251,23 +229,6 @@ struct m_ext2fs {
 	( EXT2_SB(sb)->e2fs->e2fs_features_incompat & htole32(mask) )
 
 /*
- * Definitions of behavior on errors
- */
-#define E2FS_BEH_CONTINUE		1	/* continue operation */
-#define E2FS_BEH_READONLY		2	/* remount fs read only */
-#define E2FS_BEH_PANIC			3	/* cause panic */
-#define E2FS_BEH_DEFAULT		E2FS_BEH_CONTINUE
-
-/*
- * OS identification
- */
-#define E2FS_OS_LINUX		0
-#define E2FS_OS_HURD		1
-#define E2FS_OS_MASIX		2
-#define E2FS_OS_FREEBSD		3
-#define E2FS_OS_LITES		4
-
-/*
  * File clean flags
  */
 #define	E2FS_ISCLEAN			0x0001	/* Unmounted cleanly */
@@ -290,12 +251,6 @@ struct ext2_gd {
 	uint16_t ext2bgd_csum;		/* group descriptor checksum */
 };
 
-/* cluster summary information */
-
-struct csum {
-	int8_t   cs_init; /* cluster summary has been initialized */
-	int32_t *cs_sum;  /* cluster summary array */
-};
 
 /* EXT2FS metadatas are stored in little-endian byte order. These macros
  * helps reading these metadatas

Modified: head/sys/fs/ext2fs/fs.h
==============================================================================
--- head/sys/fs/ext2fs/fs.h	Sun Jun 16 16:07:34 2013	(r251808)
+++ head/sys/fs/ext2fs/fs.h	Sun Jun 16 16:10:45 2013	(r251809)
@@ -65,6 +65,16 @@
 #define MAXMNTLEN	512
 
 /*
+ * A summary of contiguous blocks of various sizes is maintained
+ * in each cylinder group. Normally this is set by the initial
+ * value of fs_maxcontig.
+ *
+ * XXX:FS_MAXCONTIG is set to 16 to conserve space. Here we set
+ * EXT2_MAXCONTIG to 32 for better performance.
+ */
+#define EXT2_MAXCONTIG	32
+
+/*
  * Grigoriy Orlov <gluk@ptci.ru> has done some extensive work to fine
  * tune the layout preferences for directories within a filesystem.
  * His algorithm can be tuned by adjusting the following parameters

Modified: head/sys/fs/ext2fs/inode.h
==============================================================================
--- head/sys/fs/ext2fs/inode.h	Sun Jun 16 16:07:34 2013	(r251808)
+++ head/sys/fs/ext2fs/inode.h	Sun Jun 16 16:10:45 2013	(r251809)
@@ -41,14 +41,14 @@
 #include <sys/lock.h>
 #include <sys/queue.h>
 
-#define	NDADDR	12			/* Direct addresses in inode. */
-#define	NIADDR	3			/* Indirect addresses in inode. */
-
 /*
  * This must agree with the definition in <ufs/ufs/dir.h>.
  */
 #define	doff_t		int32_t
 
+#define	NDADDR	12			/* Direct addresses in inode. */
+#define	NIADDR	3			/* Indirect addresses in inode. */
+
 /*
  * The inode is used to describe each active (or recently active) file in the
  * EXT2FS filesystem. It is composed of two types of information. The first



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306161610.r5GGAk6x086100>