aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorGleb Kurtsou <gleb@FreeBSD.org>2012-05-25 09:16:59 +0000
committerGleb Kurtsou <gleb@FreeBSD.org>2012-05-25 09:16:59 +0000
commitfb2a3e6ea1857a4bacdf35637e76840de865fd8c (patch)
tree780906a18e908e8904cad2e0edbb351f5c34aa43 /sys
parent6aca1fbc91e858be38df0504b2ce9eb6f8fb4c7b (diff)
downloadsrc-fb2a3e6ea1857a4bacdf35637e76840de865fd8c.tar.gz
src-fb2a3e6ea1857a4bacdf35637e76840de865fd8c.zip
Use C99-style initialization for struct dirent in preparation for
changing the structure. Sponsored by: Google Summer of Code 2011
Notes
Notes: svn path=/head/; revision=235984
Diffstat (limited to 'sys')
-rw-r--r--sys/fs/hpfs/hpfs_vnops.c19
-rw-r--r--sys/fs/ntfs/ntfs_vnops.c18
2 files changed, 29 insertions, 8 deletions
diff --git a/sys/fs/hpfs/hpfs_vnops.c b/sys/fs/hpfs/hpfs_vnops.c
index ccf4f3cabe9e..9abe77c3a1ed 100644
--- a/sys/fs/hpfs/hpfs_vnops.c
+++ b/sys/fs/hpfs/hpfs_vnops.c
@@ -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 /* {
diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c
index 76776a14c01f..8de8ca461770 100644
--- a/sys/fs/ntfs/ntfs_vnops.c
+++ b/sys/fs/ntfs/ntfs_vnops.c
@@ -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)