Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/ufs Abolish all the silly indirection macros for ini...
details: https://anonhg.NetBSD.org/src/rev/82868cae5c46
branches: trunk
changeset: 984710:82868cae5c46
user: dholland <dholland%NetBSD.org@localhost>
date: Sun Jul 18 23:57:13 2021 +0000
description:
Abolish all the silly indirection macros for initializing vnode ops tables.
These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.
diffstat:
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c | 37 +++-----
sys/fs/adosfs/advnops.c | 63 +++++----------
sys/fs/cd9660/cd9660_node.h | 9 +-
sys/fs/filecorefs/filecore_node.h | 8 +-
sys/fs/filecorefs/filecore_vnops.c | 60 +++++---------
sys/fs/msdosfs/denode.h | 9 +-
sys/fs/msdosfs/msdosfs_vnops.c | 16 +-
sys/fs/ptyfs/ptyfs_vnops.c | 70 +++++-----------
sys/fs/tmpfs/tmpfs_fifoops.h | 39 +---------
sys/fs/tmpfs/tmpfs_specops.h | 39 +---------
sys/fs/tmpfs/tmpfs_vnops.c | 32 +++---
sys/fs/tmpfs/tmpfs_vnops.h | 16 +---
sys/miscfs/deadfs/dead_vnops.c | 34 ++-----
sys/miscfs/procfs/procfs_vnops.c | 74 ++++++-----------
sys/miscfs/specfs/spec_vnops.c | 52 ++++++------
sys/miscfs/specfs/specdev.h | 26 +------
sys/nfs/nfs_vnops.c | 30 +++---
sys/nfs/nfsnode.h | 10 +--
sys/ufs/ext2fs/ext2fs_vnops.c | 40 ++++----
sys/ufs/ffs/ffs_vnops.c | 40 ++++----
sys/ufs/lfs/lfs_vnops.c | 42 +++++-----
sys/ufs/lfs/ulfs_extern.h | 12 +--
sys/ufs/mfs/mfs_extern.h | 3 +-
sys/ufs/mfs/mfs_vnops.c | 62 +++++++-------
sys/ufs/mfs/mfsnode.h | 30 +-------
sys/ufs/ufs/ufs_extern.h | 13 +--
26 files changed, 288 insertions(+), 578 deletions(-)
diffs (truncated from 1861 to 300 lines):
diff -r f115fd66f6ff -r 82868cae5c46 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c Sun Jul 18 23:56:12 2021 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c Sun Jul 18 23:57:13 2021 +0000
@@ -6337,13 +6337,6 @@
.gop_putrange = zfs_netbsd_gop_putrange,
};
-#define zfs_netbsd_lock genfs_lock
-#define zfs_netbsd_unlock genfs_unlock
-#define zfs_netbsd_islocked genfs_islocked
-#define zfs_netbsd_seek genfs_seek
-#define zfs_netbsd_mmap genfs_mmap
-#define zfs_netbsd_fcntl genfs_fcntl
-
int (**zfs_vnodeop_p)(void *);
const struct vnodeopv_entry_desc zfs_vnodeop_entries[] = {
{ &vop_default_desc, vn_default_error },
@@ -6366,8 +6359,8 @@
{ &vop_fsync_desc, zfs_netbsd_fsync },
{ &vop_remove_desc, zfs_netbsd_remove },
{ &vop_link_desc, zfs_netbsd_link },
- { &vop_lock_desc, zfs_netbsd_lock },
- { &vop_unlock_desc, zfs_netbsd_unlock },
+ { &vop_lock_desc, genfs_lock },
+ { &vop_unlock_desc, genfs_unlock },
{ &vop_rename_desc, zfs_netbsd_rename },
{ &vop_mkdir_desc, zfs_netbsd_mkdir },
{ &vop_rmdir_desc, zfs_netbsd_rmdir },
@@ -6377,14 +6370,14 @@
{ &vop_inactive_desc, zfs_netbsd_inactive },
{ &vop_reclaim_desc, zfs_netbsd_reclaim },
{ &vop_pathconf_desc, zfs_netbsd_pathconf },
- { &vop_seek_desc, zfs_netbsd_seek },
+ { &vop_seek_desc, genfs_seek },
{ &vop_getpages_desc, zfs_netbsd_getpages },
{ &vop_putpages_desc, zfs_netbsd_putpages },
- { &vop_mmap_desc, zfs_netbsd_mmap },
- { &vop_islocked_desc, zfs_netbsd_islocked },
+ { &vop_mmap_desc, genfs_mmap },
+ { &vop_islocked_desc, genfs_islocked },
{ &vop_advlock_desc, zfs_netbsd_advlock },
{ &vop_print_desc, zfs_netbsd_print },
- { &vop_fcntl_desc, zfs_netbsd_fcntl },
+ { &vop_fcntl_desc, genfs_fcntl },
{ NULL, NULL }
};
@@ -6403,14 +6396,14 @@
{ &vop_read_desc, /**/zfs_netbsd_read },
{ &vop_write_desc, /**/zfs_netbsd_write },
{ &vop_fsync_desc, zfs_spec_fsync },
- { &vop_lock_desc, zfs_netbsd_lock },
- { &vop_unlock_desc, zfs_netbsd_unlock },
+ { &vop_lock_desc, genfs_lock },
+ { &vop_unlock_desc, genfs_unlock },
{ &vop_inactive_desc, zfs_netbsd_inactive },
{ &vop_reclaim_desc, zfs_netbsd_reclaim },
- { &vop_islocked_desc, zfs_netbsd_islocked },
- { &vop_bwrite_desc, spec_bwrite },
+ { &vop_islocked_desc, genfs_islocked },
+ { &vop_bwrite_desc, vn_bwrite },
{ &vop_print_desc, zfs_netbsd_print },
- { &vop_fcntl_desc, zfs_netbsd_fcntl },
+ { &vop_fcntl_desc, genfs_fcntl },
{ NULL, NULL }
};
@@ -6429,15 +6422,15 @@
{ &vop_read_desc, /**/zfs_netbsd_read },
{ &vop_write_desc, /**/zfs_netbsd_write },
{ &vop_fsync_desc, zfs_netbsd_fsync },
- { &vop_lock_desc, zfs_netbsd_lock },
- { &vop_unlock_desc, zfs_netbsd_unlock },
+ { &vop_lock_desc, genfs_lock },
+ { &vop_unlock_desc, genfs_unlock },
{ &vop_inactive_desc, zfs_netbsd_inactive },
{ &vop_reclaim_desc, zfs_netbsd_reclaim },
- { &vop_islocked_desc, zfs_netbsd_islocked },
+ { &vop_islocked_desc, genfs_islocked },
{ &vop_bwrite_desc, vn_bwrite },
{ &vop_strategy_desc, vn_fifo_bypass },
{ &vop_print_desc, zfs_netbsd_print },
- { &vop_fcntl_desc, zfs_netbsd_fcntl },
+ { &vop_fcntl_desc, genfs_fcntl },
{ NULL, NULL }
};
diff -r f115fd66f6ff -r 82868cae5c46 sys/fs/adosfs/advnops.c
--- a/sys/fs/adosfs/advnops.c Sun Jul 18 23:56:12 2021 +0000
+++ b/sys/fs/adosfs/advnops.c Sun Jul 18 23:57:13 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: advnops.c,v 1.56 2021/06/29 22:34:05 dholland Exp $ */
+/* $NetBSD: advnops.c,v 1.57 2021/07/18 23:57:13 dholland Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.56 2021/06/29 22:34:05 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.57 2021/07/18 23:57:13 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -57,17 +57,12 @@
extern struct vnodeops adosfs_vnodeops;
-#define adosfs_open genfs_nullop
int adosfs_getattr(void *);
int adosfs_read(void *);
int adosfs_write(void *);
-#define adosfs_fcntl genfs_fcntl
-#define adosfs_ioctl genfs_enoioctl
-#define adosfs_poll genfs_poll
int adosfs_strategy(void *);
int adosfs_link(void *);
int adosfs_symlink(void *);
-#define adosfs_abortop genfs_abortop
int adosfs_bmap(void *);
int adosfs_print(void *);
int adosfs_readdir(void *);
@@ -77,55 +72,39 @@
int adosfs_reclaim(void *);
int adosfs_pathconf(void *);
-#define adosfs_close genfs_nullop
-#define adosfs_fsync genfs_nullop
-#define adosfs_seek genfs_seek
-
-#define adosfs_advlock genfs_einval
-#define adosfs_bwrite genfs_eopnotsupp
-#define adosfs_create genfs_eopnotsupp
-#define adosfs_mkdir genfs_eopnotsupp
-#define adosfs_mknod genfs_eopnotsupp
-#define adosfs_revoke genfs_revoke
-#define adosfs_mmap genfs_mmap
-#define adosfs_remove genfs_eopnotsupp
-#define adosfs_rename genfs_eopnotsupp
-#define adosfs_rmdir genfs_eopnotsupp
-#define adosfs_setattr genfs_eopnotsupp
-
const struct vnodeopv_entry_desc adosfs_vnodeop_entries[] = {
{ &vop_default_desc, vn_default_error },
{ &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, adosfs_lookup }, /* lookup */
- { &vop_create_desc, adosfs_create }, /* create */
- { &vop_mknod_desc, adosfs_mknod }, /* mknod */
- { &vop_open_desc, adosfs_open }, /* open */
- { &vop_close_desc, adosfs_close }, /* close */
+ { &vop_create_desc, genfs_eopnotsupp }, /* create */
+ { &vop_mknod_desc, genfs_eopnotsupp }, /* mknod */
+ { &vop_open_desc, genfs_nullop }, /* open */
+ { &vop_close_desc, genfs_nullop }, /* close */
{ &vop_access_desc, adosfs_access }, /* access */
{ &vop_accessx_desc, genfs_accessx }, /* accessx */
{ &vop_getattr_desc, adosfs_getattr }, /* getattr */
- { &vop_setattr_desc, adosfs_setattr }, /* setattr */
+ { &vop_setattr_desc, genfs_eopnotsupp }, /* setattr */
{ &vop_read_desc, adosfs_read }, /* read */
{ &vop_write_desc, adosfs_write }, /* write */
{ &vop_fallocate_desc, genfs_eopnotsupp }, /* fallocate */
{ &vop_fdiscard_desc, genfs_eopnotsupp }, /* fdiscard */
- { &vop_fcntl_desc, adosfs_fcntl }, /* fcntl */
- { &vop_ioctl_desc, adosfs_ioctl }, /* ioctl */
- { &vop_poll_desc, adosfs_poll }, /* poll */
+ { &vop_fcntl_desc, genfs_fcntl }, /* fcntl */
+ { &vop_ioctl_desc, genfs_enoioctl }, /* ioctl */
+ { &vop_poll_desc, genfs_poll }, /* poll */
{ &vop_kqfilter_desc, genfs_kqfilter }, /* kqfilter */
- { &vop_revoke_desc, adosfs_revoke }, /* revoke */
- { &vop_mmap_desc, adosfs_mmap }, /* mmap */
- { &vop_fsync_desc, adosfs_fsync }, /* fsync */
- { &vop_seek_desc, adosfs_seek }, /* seek */
- { &vop_remove_desc, adosfs_remove }, /* remove */
+ { &vop_revoke_desc, genfs_revoke }, /* revoke */
+ { &vop_mmap_desc, genfs_mmap }, /* mmap */
+ { &vop_fsync_desc, genfs_nullop }, /* fsync */
+ { &vop_seek_desc, genfs_seek }, /* seek */
+ { &vop_remove_desc, genfs_eopnotsupp }, /* remove */
{ &vop_link_desc, adosfs_link }, /* link */
- { &vop_rename_desc, adosfs_rename }, /* rename */
- { &vop_mkdir_desc, adosfs_mkdir }, /* mkdir */
- { &vop_rmdir_desc, adosfs_rmdir }, /* rmdir */
+ { &vop_rename_desc, genfs_eopnotsupp }, /* rename */
+ { &vop_mkdir_desc, genfs_eopnotsupp }, /* mkdir */
+ { &vop_rmdir_desc, genfs_eopnotsupp }, /* rmdir */
{ &vop_symlink_desc, adosfs_symlink }, /* symlink */
{ &vop_readdir_desc, adosfs_readdir }, /* readdir */
{ &vop_readlink_desc, adosfs_readlink }, /* readlink */
- { &vop_abortop_desc, adosfs_abortop }, /* abortop */
+ { &vop_abortop_desc, genfs_abortop }, /* abortop */
{ &vop_inactive_desc, adosfs_inactive }, /* inactive */
{ &vop_reclaim_desc, adosfs_reclaim }, /* reclaim */
{ &vop_lock_desc, genfs_lock }, /* lock */
@@ -135,8 +114,8 @@
{ &vop_print_desc, adosfs_print }, /* print */
{ &vop_islocked_desc, genfs_islocked }, /* islocked */
{ &vop_pathconf_desc, adosfs_pathconf }, /* pathconf */
- { &vop_advlock_desc, adosfs_advlock }, /* advlock */
- { &vop_bwrite_desc, adosfs_bwrite }, /* bwrite */
+ { &vop_advlock_desc, genfs_einval }, /* advlock */
+ { &vop_bwrite_desc, genfs_eopnotsupp }, /* bwrite */
{ &vop_getpages_desc, genfs_getpages }, /* getpages */
{ &vop_putpages_desc, genfs_putpages }, /* putpages */
{ NULL, NULL }
diff -r f115fd66f6ff -r 82868cae5c46 sys/fs/cd9660/cd9660_node.h
--- a/sys/fs/cd9660/cd9660_node.h Sun Jul 18 23:56:12 2021 +0000
+++ b/sys/fs/cd9660/cd9660_node.h Sun Jul 18 23:57:13 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660_node.h,v 1.16 2014/06/16 09:55:49 hannken Exp $ */
+/* $NetBSD: cd9660_node.h,v 1.17 2021/07/18 23:57:13 dholland Exp $ */
/*-
* Copyright (c) 1994
@@ -97,18 +97,11 @@
* Prototypes for ISOFS vnode operations
*/
int cd9660_lookup(void *);
-#define cd9660_open genfs_nullop
-#define cd9660_close genfs_nullop
int cd9660_access(void *);
int cd9660_getattr(void *);
int cd9660_read(void *);
-#define cd9660_ioctl genfs_enoioctl
-#define cd9660_poll genfs_poll
-#define cd9660_mmap genfs_mmap
-#define cd9660_seek genfs_seek
int cd9660_readdir(void *);
int cd9660_readlink(void *);
-#define cd9660_abortop genfs_abortop
int cd9660_inactive(void *);
int cd9660_reclaim(void *);
int cd9660_link(void *);
diff -r f115fd66f6ff -r 82868cae5c46 sys/fs/filecorefs/filecore_node.h
--- a/sys/fs/filecorefs/filecore_node.h Sun Jul 18 23:56:12 2021 +0000
+++ b/sys/fs/filecorefs/filecore_node.h Sun Jul 18 23:57:13 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: filecore_node.h,v 1.6 2014/10/04 13:27:24 hannken Exp $ */
+/* $NetBSD: filecore_node.h,v 1.7 2021/07/18 23:57:14 dholland Exp $ */
/*-
* Copyright (c) 1994 The Regents of the University of California.
@@ -112,17 +112,11 @@
* Prototypes for Filecore vnode operations
*/
int filecore_lookup(void *);
-#define filecore_open genfs_nullop
-#define filecore_close genfs_nullop
int filecore_access(void *);
int filecore_getattr(void *);
int filecore_read(void *);
-#define filecore_poll genfs_poll
-#define filecore_mmap genfs_mmap
-#define filecore_seek genfs_seek
int filecore_readdir(void *);
int filecore_readlink(void *);
-#define filecore_abortop genfs_abortop
int filecore_inactive(void *);
int filecore_reclaim(void *);
int filecore_link(void *);
diff -r f115fd66f6ff -r 82868cae5c46 sys/fs/filecorefs/filecore_vnops.c
--- a/sys/fs/filecorefs/filecore_vnops.c Sun Jul 18 23:56:12 2021 +0000
+++ b/sys/fs/filecorefs/filecore_vnops.c Sun Jul 18 23:57:13 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: filecore_vnops.c,v 1.48 2021/06/29 22:34:06 dholland Exp $ */
+/* $NetBSD: filecore_vnops.c,v 1.49 2021/07/18 23:57:14 dholland Exp $ */
/*-
* Copyright (c) 1994 The Regents of the University of California.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: filecore_vnops.c,v 1.48 2021/06/29 22:34:06 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filecore_vnops.c,v 1.49 2021/07/18 23:57:14 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -531,24 +531,6 @@
}
/*
- * Global vfs data structures for isofs
- */
-#define filecore_create genfs_eopnotsupp
-#define filecore_mknod genfs_eopnotsupp
-#define filecore_write genfs_eopnotsupp
-#define filecore_setattr genfs_eopnotsupp
-#define filecore_fcntl genfs_fcntl
-#define filecore_ioctl genfs_enoioctl
-#define filecore_fsync genfs_nullop
-#define filecore_remove genfs_eopnotsupp
-#define filecore_rename genfs_eopnotsupp
-#define filecore_mkdir genfs_eopnotsupp
-#define filecore_rmdir genfs_eopnotsupp
-#define filecore_advlock genfs_eopnotsupp
-#define filecore_bwrite genfs_eopnotsupp
-#define filecore_revoke genfs_revoke
Home |
Main Index |
Thread Index |
Old Index