Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 May 2012 09:16:59 +0000 (UTC)
From:      Gleb Kurtsou <gleb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r235984 - in head/sys/fs: hpfs ntfs
Message-ID:  <201205250916.q4P9GxQv092841@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gleb
Date: Fri May 25 09:16:59 2012
New Revision: 235984
URL: http://svn.freebsd.org/changeset/base/235984

Log:
  Use C99-style initialization for struct dirent in preparation for
  changing the structure.
  
  Sponsored by:	Google Summer of Code 2011

Modified:
  head/sys/fs/hpfs/hpfs_vnops.c
  head/sys/fs/ntfs/ntfs_vnops.c

Modified: head/sys/fs/hpfs/hpfs_vnops.c
==============================================================================
--- head/sys/fs/hpfs/hpfs_vnops.c	Fri May 25 08:55:59 2012	(r235983)
+++ head/sys/fs/hpfs/hpfs_vnops.c	Fri May 25 09:16:59 2012	(r235984)
@@ -797,10 +797,21 @@ hpfs_de_uiomove (
 }
 
 
-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: head/sys/fs/ntfs/ntfs_vnops.c
==============================================================================
--- head/sys/fs/ntfs/ntfs_vnops.c	Fri May 25 08:55:59 2012	(r235983)
+++ head/sys/fs/ntfs/ntfs_vnops.c	Fri May 25 09:16:59 2012	(r235984)
@@ -493,8 +493,13 @@ ntfs_readdir(ap)
 
 	/* 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;
@@ -508,8 +513,13 @@ ntfs_readdir(ap)
 
 	/* 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)



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