null-terminate-solaris-ops-20061228
authorDale Ghent <daleg@umbc.edu>
Thu, 28 Dec 2006 22:25:41 +0000 (22:25 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 28 Dec 2006 22:25:41 +0000 (22:25 +0000)
FIXES 50340

vfsops and vnodeops need a NULL at the end of the structs

src/afs/SOLARIS/osi_vfsops.c
src/afs/SOLARIS/osi_vnodeops.c

index e287fe9..d253a38 100644 (file)
@@ -238,15 +238,17 @@ afs_swapvp(struct vfs *afsp, struct vnode **avpp, char *nm)
 
 
 #ifdef AFS_SUN510_ENV
-struct fs_operation_def afs_vfsops_template[] = {
-    { VFSNAME_MOUNT,           afs_mount },
-    { VFSNAME_UNMOUNT,         afs_unmount },
-    { VFSNAME_ROOT,            afs_root },
-    { VFSNAME_STATVFS,         afs_statvfs },
-    { VFSNAME_SYNC,            afs_sync },
-    { VFSNAME_VGET,            afs_vget },
-    { VFSNAME_MOUNTROOT,       afs_mountroot },
-    { VFSNAME_FREEVFS,         fs_freevfs },
+/* The following list must always be NULL-terminated */
+const fs_operation_def_t afs_vfsops_template[] = {
+    VFSNAME_MOUNT,             afs_mount,
+    VFSNAME_UNMOUNT,           afs_unmount,
+    VFSNAME_ROOT,              afs_root,
+    VFSNAME_STATVFS,           afs_statvfs,
+    VFSNAME_SYNC,              afs_sync,
+    VFSNAME_VGET,              afs_vget,
+    VFSNAME_MOUNTROOT,         afs_mountroot,
+    VFSNAME_FREEVFS,           fs_freevfs,
+    NULL,                     NULL
 };
 struct vfsops *afs_vfsopsp;
 #else
index d55387d..05b0273 100644 (file)
@@ -1442,51 +1442,52 @@ extern int afs_lockctl();
 extern void gafs_inactive();
 
 #ifdef AFS_SUN510_ENV
-struct fs_operation_def afs_vnodeops_template[] = {
-    { VOPNAME_OPEN,            gafs_open },
-    { VOPNAME_CLOSE,           gafs_close },
-    { VOPNAME_READ,            afs_vmread },
-    { VOPNAME_WRITE,           afs_vmwrite },
-    { VOPNAME_IOCTL,           afs_ioctl },
-    { VOPNAME_SETFL,           fs_setfl },
-    { VOPNAME_GETATTR,         gafs_getattr },
-    { VOPNAME_SETATTR,         gafs_setattr },
-    { VOPNAME_ACCESS,          gafs_access },
-    { VOPNAME_LOOKUP,          gafs_lookup },
-    { VOPNAME_CREATE,          gafs_create },
-    { VOPNAME_REMOVE,          gafs_remove },
-    { VOPNAME_LINK,            gafs_link },
-    { VOPNAME_RENAME,          gafs_rename },
-    { VOPNAME_MKDIR,           gafs_mkdir },
-    { VOPNAME_RMDIR,           gafs_rmdir },
-    { VOPNAME_READDIR,         gafs_readdir },
-    { VOPNAME_SYMLINK,         gafs_symlink },   
-    { VOPNAME_READLINK,                gafs_readlink },
-    { VOPNAME_FSYNC,           gafs_fsync },
-    { VOPNAME_INACTIVE,                gafs_inactive },
-    { VOPNAME_FID,             gafs_fid },
-    { VOPNAME_RWLOCK,          afs_rwlock },
-    { VOPNAME_RWUNLOCK,                afs_rwunlock },
-    { VOPNAME_SEEK,            afs_seek },
-    { VOPNAME_CMP,             afs_cmp },
-    { VOPNAME_FRLOCK,          afs_frlock },
-    { VOPNAME_SPACE,           afs_space },
-    { VOPNAME_REALVP,          afs_realvp },
-    { VOPNAME_GETPAGE,         afs_getpage },
-    { VOPNAME_PUTPAGE,         afs_putpage },
-    { VOPNAME_MAP,             afs_map },
-    { VOPNAME_ADDMAP,          afs_addmap },
-    { VOPNAME_DELMAP,          afs_delmap },
-    { VOPNAME_POLL,            fs_poll },
-    { VOPNAME_DUMP,            afs_dump },
-    { VOPNAME_PATHCONF,                afs_pathconf },
-    { VOPNAME_PAGEIO,          afs_pageio },
-    { VOPNAME_DUMPCTL,         afs_dumpctl },   
-    { VOPNAME_DISPOSE,         afs_dispose },
-    { VOPNAME_GETSECATTR,      afs_getsecattr },
-    { VOPNAME_SETSECATTR,      afs_setsecattr },
-    { VOPNAME_SHRLOCK,         fs_shrlock },
-    NULL,
+/* The following list must always be NULL-terminated */
+const fs_operation_def_t afs_vnodeops_template[] = {
+    VOPNAME_OPEN,              gafs_open,
+    VOPNAME_CLOSE,             gafs_close,
+    VOPNAME_READ,              afs_vmread,
+    VOPNAME_WRITE,             afs_vmwrite,
+    VOPNAME_IOCTL,             afs_ioctl,
+    VOPNAME_SETFL,             fs_setfl,
+    VOPNAME_GETATTR,           gafs_getattr,
+    VOPNAME_SETATTR,           gafs_setattr,
+    VOPNAME_ACCESS,            gafs_access,
+    VOPNAME_LOOKUP,            gafs_lookup,
+    VOPNAME_CREATE,            gafs_create,
+    VOPNAME_REMOVE,            gafs_remove,
+    VOPNAME_LINK,              gafs_link,
+    VOPNAME_RENAME,            gafs_rename,
+    VOPNAME_MKDIR,             gafs_mkdir,
+    VOPNAME_RMDIR,             gafs_rmdir,
+    VOPNAME_READDIR,           gafs_readdir,
+    VOPNAME_SYMLINK,           gafs_symlink,   
+    VOPNAME_READLINK,          gafs_readlink,
+    VOPNAME_FSYNC,             gafs_fsync,
+    VOPNAME_INACTIVE,          gafs_inactive,
+    VOPNAME_FID,               gafs_fid,
+    VOPNAME_RWLOCK,            afs_rwlock,
+    VOPNAME_RWUNLOCK,          afs_rwunlock,
+    VOPNAME_SEEK,              afs_seek,
+    VOPNAME_CMP,               afs_cmp,
+    VOPNAME_FRLOCK,            afs_frlock,
+    VOPNAME_SPACE,             afs_space,
+    VOPNAME_REALVP,            afs_realvp,
+    VOPNAME_GETPAGE,           afs_getpage,
+    VOPNAME_PUTPAGE,           afs_putpage,
+    VOPNAME_MAP,               afs_map,
+    VOPNAME_ADDMAP,            afs_addmap,
+    VOPNAME_DELMAP,            afs_delmap,
+    VOPNAME_POLL,              fs_poll,
+    VOPNAME_DUMP,              afs_dump,
+    VOPNAME_PATHCONF,          afs_pathconf,
+    VOPNAME_PAGEIO,            afs_pageio,
+    VOPNAME_DUMPCTL,           afs_dumpctl,   
+    VOPNAME_DISPOSE,           afs_dispose,
+    VOPNAME_GETSECATTR,       afs_getsecattr,
+    VOPNAME_SETSECATTR,        afs_setsecattr,
+    VOPNAME_SHRLOCK,           fs_shrlock,
+    NULL,                     NULL
 };
 struct vnodeops *afs_ops;
 #else