Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 May 2010 13:26:34 GMT
From:      Zheng Liu <lz@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 177821 for review
Message-ID:  <201005061326.o46DQY23013930@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@177821?ac=10

Change 177821 by lz@gnehzuil-freebsd on 2010/05/06 13:26:28

	Add related data structure.
	
		* Add a file named ext2_rsv_win.h. It defines some data structures
		* Add some fields in ext2fs.h and inode.h
		* Add init and destroy code in ext2_vfsops.c

Affected files ...

.. //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2_rsv_win.h#1 add
.. //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2_vfsops.c#2 edit
.. //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2fs.h#2 edit
.. //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/inode.h#2 edit

Differences ...

==== //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2_vfsops.c#2 (text+ko) ====

@@ -581,6 +581,12 @@
 	if ((error = compute_sb_data(devvp, ump->um_e2fs->e2fs, ump->um_e2fs)))
 		goto out;
 
+	/* Initial reservation window index and lock */
+	bzero(&ump->um_e2fs->e2fs_rsv_win_lock, sizeof(struct mtx));
+	mtx_init(&ump->um_e2fs->e2fs_rsv_win_lock,
+		 "reservation window lock", NULL, MTX_SPIN);
+	RB_INIT(&ump->um_e2fs->e2fs_tree);
+
 	brelse(bp);
 	bp = NULL;
 	fs = ump->um_e2fs;
@@ -680,6 +686,7 @@
 	g_topology_unlock();
 	PICKUP_GIANT();
 	vrele(ump->um_devvp);
+	mtx_destroy(&fs->e2fs_rsv_win_lock);
 	free(fs->e2fs_gd, M_EXT2MNT);
 	free(fs->e2fs_contigdirs, M_EXT2MNT);
 	free(fs->e2fs, M_EXT2MNT);

==== //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/ext2fs.h#2 (text+ko) ====

@@ -38,6 +38,8 @@
 #define _FS_EXT2FS_EXT2_FS_H
 
 #include <sys/types.h>
+#include <sys/lock.h>
+#include <fs/ext2fs/ext2_rsv_win.h>
 
 /*
  * Special inode numbers
@@ -174,6 +176,9 @@
 	char e2fs_wasvalid;       /* valid at mount time */
 	off_t e2fs_maxfilesize;
 	struct ext2_gd *e2fs_gd; /* Group Descriptors */
+
+	struct mtx e2fs_rsv_win_lock; /* Protect reservation window RB tree */
+	struct ext2_rsv_win_tree e2fs_tree;  /* Reservation window index */
 };
 
 /*

==== //depot/projects/soc2010/extfs/src/sys/fs/ext2fs/inode.h#2 (text+ko) ====

@@ -40,6 +40,7 @@
 
 #include <sys/lock.h>
 #include <sys/queue.h>
+#include <fs/ext2fs/ext2_rsv_win.h>
 
 #define	ROOTINO	((ino_t)2)
 
@@ -100,6 +101,8 @@
 	int32_t		i_gen;		/* Generation number. */
 	u_int32_t	i_uid;		/* File owner. */
 	u_int32_t	i_gid;		/* File group. */
+
+	struct ext2_rsv_win_info *i_rsv_winp; /* Reservation window info */
 };
 
 /*



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