socsvn commit: r222843 - in soc2011/gk/ino64-head/sys/fs: hpfs ntfs

gk at FreeBSD.org gk at FreeBSD.org
Sun Jun 5 16:21:40 UTC 2011


Author: gk
Date: Sun Jun  5 16:21:38 2011
New Revision: 222843
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=222843

Log:
  Use C99-style struct initialization for dirent

Modified:
  soc2011/gk/ino64-head/sys/fs/hpfs/hpfs_vnops.c
  soc2011/gk/ino64-head/sys/fs/ntfs/ntfs_vnops.c

Modified: soc2011/gk/ino64-head/sys/fs/hpfs/hpfs_vnops.c
==============================================================================
--- soc2011/gk/ino64-head/sys/fs/hpfs/hpfs_vnops.c	Sun Jun  5 16:21:26 2011	(r222842)
+++ soc2011/gk/ino64-head/sys/fs/hpfs/hpfs_vnops.c	Sun Jun  5 16:21:38 2011	(r222843)
@@ -797,10 +797,20 @@
 }
 
 
-static struct dirent hpfs_de_dot =
-	{ 0, sizeof(struct dirent), DT_DIR, 1, "." };
-static struct dirent hpfs_de_dotdot =
-	{ 0, sizeof(struct dirent), DT_DIR, 2, ".." };
+static struct dirent hpfs_de_dot = {
+	.d_fileno = 0,
+	.d_reclen = sizeof(struct dirent),
+	.d_type = DT_DIR,
+	.d_namlen = 1,
+	.d_name = "."
+};
+static struct dirent hpfs_de_dotdot = {
+	.d_fileno = 0,
+	.d_reclen = sizeof(struct dirent),
+	.d_type = DT_DIR,
+	.d_namlen = 2,
+	.d_name = ".."
+};
 int
 hpfs_readdir(ap)
 	struct vop_readdir_args /* {

Modified: soc2011/gk/ino64-head/sys/fs/ntfs/ntfs_vnops.c
==============================================================================
--- soc2011/gk/ino64-head/sys/fs/ntfs/ntfs_vnops.c	Sun Jun  5 16:21:26 2011	(r222842)
+++ soc2011/gk/ino64-head/sys/fs/ntfs/ntfs_vnops.c	Sun Jun  5 16:21:38 2011	(r222843)
@@ -500,8 +500,13 @@
 
 	/* Simulate . in every dir except ROOT */
 	if( ip->i_number != NTFS_ROOTINO ) {
-		struct dirent dot = { NTFS_ROOTINO,
-				sizeof(struct dirent), DT_DIR, 1, "." };
+		struct dirent dot = {
+			.d_fileno = NTFS_ROOTINO,
+			.d_reclen = sizeof(struct dirent),
+			.d_type = DT_DIR,
+			.d_namlen = 1,
+			.d_name = "."
+		};
 
 		if( uio->uio_offset < sizeof(struct dirent) ) {
 			dot.d_fileno = ip->i_number;
@@ -515,8 +520,13 @@
 
 	/* Simulate .. in every dir including ROOT */
 	if( uio->uio_offset < 2 * sizeof(struct dirent) ) {
-		struct dirent dotdot = { NTFS_ROOTINO,
-				sizeof(struct dirent), DT_DIR, 2, ".." };
+		struct dirent dotdot = {
+			.d_fileno = NTFS_ROOTINO,
+			.d_reclen = sizeof(struct dirent),
+			.d_type = DT_DIR,
+			.d_namlen = 2,
+			.d_name = ".."
+		};
 
 		error = uiomove((char *)&dotdot,sizeof(struct dirent),uio);
 		if(error)


More information about the svn-soc-all mailing list