summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/devfs
diff options
context:
space:
mode:
authorrsb <none@none>2007-03-26 17:41:06 -0700
committerrsb <none@none>2007-03-26 17:41:06 -0700
commitaa59c4cb15a6ac5d4e585dadf7a055b580abf579 (patch)
tree67105846ea7ea656699224cf37f3cf859c00cd6a /usr/src/uts/common/fs/devfs
parentaf2c4821c0a23e873f2a63bca4145080aa2183e3 (diff)
downloadillumos-joyent-aa59c4cb15a6ac5d4e585dadf7a055b580abf579.tar.gz
PSARC/2007/124 Strong Type-Checking for VFS Operation Registration Mechanism
6505923 Need better type checking for vnodeops 6531594 lxpr_readlink() is missing the "cred_t *cr" arg 6532559 vfs_strayops does not use the vnode/vfs operation registration mechanism
Diffstat (limited to 'usr/src/uts/common/fs/devfs')
-rw-r--r--usr/src/uts/common/fs/devfs/devfs_vfsops.c17
-rw-r--r--usr/src/uts/common/fs/devfs/devfs_vnops.c47
2 files changed, 33 insertions, 31 deletions
diff --git a/usr/src/uts/common/fs/devfs/devfs_vfsops.c b/usr/src/uts/common/fs/devfs/devfs_vfsops.c
index a0a69bb77d..2e83ba30cd 100644
--- a/usr/src/uts/common/fs/devfs/devfs_vfsops.c
+++ b/usr/src/uts/common/fs/devfs/devfs_vfsops.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -42,6 +42,7 @@
#include <sys/time.h>
#include <sys/pathname.h>
#include <sys/vfs.h>
+#include <sys/vfs_opreg.h>
#include <sys/vnode.h>
#include <sys/stat.h>
#include <sys/uio.h>
@@ -129,13 +130,13 @@ static int
devfsinit(int fstype, char *name)
{
static const fs_operation_def_t devfs_vfsops_template[] = {
- VFSNAME_MOUNT, devfs_mount,
- VFSNAME_UNMOUNT, devfs_unmount,
- VFSNAME_ROOT, devfs_root,
- VFSNAME_STATVFS, devfs_statvfs,
- VFSNAME_SYNC, (fs_generic_func_p) fs_sync,
- VFSNAME_MOUNTROOT, devfs_mountroot,
- NULL, NULL
+ VFSNAME_MOUNT, { .vfs_mount = devfs_mount },
+ VFSNAME_UNMOUNT, { .vfs_unmount = devfs_unmount },
+ VFSNAME_ROOT, { .vfs_root = devfs_root },
+ VFSNAME_STATVFS, { .vfs_statvfs = devfs_statvfs },
+ VFSNAME_SYNC, { .vfs_sync = fs_sync },
+ VFSNAME_MOUNTROOT, { .vfs_mountroot = devfs_mountroot },
+ NULL, NULL
};
int error;
int dev;
diff --git a/usr/src/uts/common/fs/devfs/devfs_vnops.c b/usr/src/uts/common/fs/devfs/devfs_vnops.c
index 3d2d696b38..c55295b0f6 100644
--- a/usr/src/uts/common/fs/devfs/devfs_vnops.c
+++ b/usr/src/uts/common/fs/devfs/devfs_vnops.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -44,6 +44,7 @@
#include <sys/time.h>
#include <sys/vfs.h>
#include <sys/vnode.h>
+#include <sys/vfs_opreg.h>
#include <sys/file.h>
#include <sys/fcntl.h>
#include <sys/flock.h>
@@ -1104,26 +1105,26 @@ devfs_seek(struct vnode *vp, offset_t ooff, offset_t *noffp)
vnodeops_t *dv_vnodeops;
const fs_operation_def_t dv_vnodeops_template[] = {
- VOPNAME_OPEN, devfs_open,
- VOPNAME_CLOSE, devfs_close,
- VOPNAME_READ, devfs_read,
- VOPNAME_WRITE, devfs_write,
- VOPNAME_IOCTL, devfs_ioctl,
- VOPNAME_GETATTR, devfs_getattr,
- VOPNAME_SETATTR, devfs_setattr,
- VOPNAME_ACCESS, devfs_access,
- VOPNAME_LOOKUP, devfs_lookup,
- VOPNAME_CREATE, devfs_create,
- VOPNAME_READDIR, devfs_readdir,
- VOPNAME_FSYNC, devfs_fsync,
- VOPNAME_INACTIVE, (fs_generic_func_p) devfs_inactive,
- VOPNAME_FID, devfs_fid,
- VOPNAME_RWLOCK, devfs_rwlock,
- VOPNAME_RWUNLOCK, (fs_generic_func_p) devfs_rwunlock,
- VOPNAME_SEEK, devfs_seek,
- VOPNAME_PATHCONF, devfs_pathconf,
- VOPNAME_DISPOSE, fs_error,
- VOPNAME_SETSECATTR, devfs_setsecattr,
- VOPNAME_GETSECATTR, devfs_getsecattr,
- NULL, NULL
+ VOPNAME_OPEN, { .vop_open = devfs_open },
+ VOPNAME_CLOSE, { .vop_close = devfs_close },
+ VOPNAME_READ, { .vop_read = devfs_read },
+ VOPNAME_WRITE, { .vop_write = devfs_write },
+ VOPNAME_IOCTL, { .vop_ioctl = devfs_ioctl },
+ VOPNAME_GETATTR, { .vop_getattr = devfs_getattr },
+ VOPNAME_SETATTR, { .vop_setattr = devfs_setattr },
+ VOPNAME_ACCESS, { .vop_access = devfs_access },
+ VOPNAME_LOOKUP, { .vop_lookup = devfs_lookup },
+ VOPNAME_CREATE, { .vop_create = devfs_create },
+ VOPNAME_READDIR, { .vop_readdir = devfs_readdir },
+ VOPNAME_FSYNC, { .vop_fsync = devfs_fsync },
+ VOPNAME_INACTIVE, { .vop_inactive = devfs_inactive },
+ VOPNAME_FID, { .vop_fid = devfs_fid },
+ VOPNAME_RWLOCK, { .vop_rwlock = devfs_rwlock },
+ VOPNAME_RWUNLOCK, { .vop_rwunlock = devfs_rwunlock },
+ VOPNAME_SEEK, { .vop_seek = devfs_seek },
+ VOPNAME_PATHCONF, { .vop_pathconf = devfs_pathconf },
+ VOPNAME_DISPOSE, { .error = fs_error },
+ VOPNAME_SETSECATTR, { .vop_setsecattr = devfs_setsecattr },
+ VOPNAME_GETSECATTR, { .vop_getsecattr = devfs_getsecattr },
+ NULL, NULL
};