svn commit: r225197 - in projects/ino64/sys/fs: hpfs ntfs
Matthew D Fleming
mdf at FreeBSD.org
Fri Aug 26 17:37:09 UTC 2011
Author: mdf
Date: Fri Aug 26 17:37:09 2011
New Revision: 225197
URL: http://svn.freebsd.org/changeset/base/225197
Log:
Use C99-style struct initialization for dirent in preparation for
changing the structure.
GSoC r222843.
Code by Gleb Kurtsou.
Modified:
projects/ino64/sys/fs/hpfs/hpfs_vnops.c
projects/ino64/sys/fs/ntfs/ntfs_vnops.c
Modified: projects/ino64/sys/fs/hpfs/hpfs_vnops.c
==============================================================================
--- projects/ino64/sys/fs/hpfs/hpfs_vnops.c Fri Aug 26 17:35:22 2011 (r225196)
+++ projects/ino64/sys/fs/hpfs/hpfs_vnops.c Fri Aug 26 17:37:09 2011 (r225197)
@@ -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: projects/ino64/sys/fs/ntfs/ntfs_vnops.c
==============================================================================
--- projects/ino64/sys/fs/ntfs/ntfs_vnops.c Fri Aug 26 17:35:22 2011 (r225196)
+++ projects/ino64/sys/fs/ntfs/ntfs_vnops.c Fri Aug 26 17:37:09 2011 (r225197)
@@ -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)
More information about the svn-src-projects
mailing list