Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs Abolish all the silly indirection macros for initiali...
details: https://anonhg.NetBSD.org/src/rev/c3e3395e3f82
branches: trunk
changeset: 984713:c3e3395e3f82
user: dholland <dholland%NetBSD.org@localhost>
date: Mon Jul 19 01:30:24 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.
Part 2; cvs randomly didn't commit these changes before, and then hid
them from me until I touched the files to force it to rethink. Dunno
what happened.
There's probably more of these, going to have to scan the tree the
hard way.
diffstat:
sys/fs/cd9660/cd9660_vnops.c | 53 +++++++++++++++----------------------------
sys/fs/puffs/puffs_vnops.c | 28 +++++++++-------------
sys/fs/tmpfs/tmpfs_fifoops.c | 30 ++++++++++++------------
sys/fs/tmpfs/tmpfs_specops.c | 28 +++++++++++-----------
4 files changed, 60 insertions(+), 79 deletions(-)
diffs (288 lines):
diff -r 701c7f9d4238 -r c3e3395e3f82 sys/fs/cd9660/cd9660_vnops.c
--- a/sys/fs/cd9660/cd9660_vnops.c Mon Jul 19 01:06:14 2021 +0000
+++ b/sys/fs/cd9660/cd9660_vnops.c Mon Jul 19 01:30:24 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660_vnops.c,v 1.60 2021/07/18 23:56:13 dholland Exp $ */
+/* $NetBSD: cd9660_vnops.c,v 1.61 2021/07/19 01:30:24 dholland Exp $ */
/*-
* Copyright (c) 1994
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.60 2021/07/18 23:56:13 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.61 2021/07/19 01:30:24 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -829,21 +829,6 @@
}
/*
- * Global vfs data structures for isofs
- */
-#define cd9660_create genfs_eopnotsupp
-#define cd9660_mknod genfs_eopnotsupp
-#define cd9660_write genfs_eopnotsupp
-#define cd9660_fsync genfs_nullop
-#define cd9660_remove genfs_eopnotsupp
-#define cd9660_rename genfs_eopnotsupp
-#define cd9660_mkdir genfs_eopnotsupp
-#define cd9660_rmdir genfs_eopnotsupp
-#define cd9660_advlock genfs_einval
-#define cd9660_bwrite genfs_eopnotsupp
-#define cd9660_revoke genfs_revoke
-
-/*
* Global vfs data structures for cd9660
*/
int (**cd9660_vnodeop_p)(void *);
@@ -851,34 +836,34 @@
{ &vop_default_desc, vn_default_error },
{ &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, cd9660_lookup }, /* lookup */
- { &vop_create_desc, cd9660_create }, /* create */
- { &vop_mknod_desc, cd9660_mknod }, /* mknod */
- { &vop_open_desc, cd9660_open }, /* open */
- { &vop_close_desc, cd9660_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, cd9660_access }, /* access */
{ &vop_accessx_desc, genfs_accessx }, /* accessx */
{ &vop_getattr_desc, cd9660_getattr }, /* getattr */
{ &vop_setattr_desc, cd9660_setattr }, /* setattr */
{ &vop_read_desc, cd9660_read }, /* read */
- { &vop_write_desc, cd9660_write }, /* write */
+ { &vop_write_desc, genfs_eopnotsupp }, /* write */
{ &vop_fallocate_desc, genfs_eopnotsupp }, /* fallocate */
{ &vop_fdiscard_desc, genfs_eopnotsupp }, /* fdiscard */
{ &vop_fcntl_desc, genfs_fcntl }, /* fcntl */
- { &vop_ioctl_desc, cd9660_ioctl }, /* ioctl */
- { &vop_poll_desc, cd9660_poll }, /* poll */
- { &vop_revoke_desc, cd9660_revoke }, /* revoke */
- { &vop_mmap_desc, cd9660_mmap }, /* mmap */
- { &vop_fsync_desc, cd9660_fsync }, /* fsync */
- { &vop_seek_desc, cd9660_seek }, /* seek */
- { &vop_remove_desc, cd9660_remove }, /* remove */
+ { &vop_ioctl_desc, genfs_enoioctl }, /* ioctl */
+ { &vop_poll_desc, genfs_poll }, /* poll */
+ { &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, cd9660_link }, /* link */
- { &vop_rename_desc, cd9660_rename }, /* rename */
- { &vop_mkdir_desc, cd9660_mkdir }, /* mkdir */
- { &vop_rmdir_desc, cd9660_rmdir }, /* rmdir */
+ { &vop_rename_desc, genfs_eopnotsupp }, /* rename */
+ { &vop_mkdir_desc, genfs_eopnotsupp }, /* mkdir */
+ { &vop_rmdir_desc, genfs_eopnotsupp }, /* rmdir */
{ &vop_symlink_desc, cd9660_symlink }, /* symlink */
{ &vop_readdir_desc, cd9660_readdir }, /* readdir */
{ &vop_readlink_desc, cd9660_readlink }, /* readlink */
- { &vop_abortop_desc, cd9660_abortop }, /* abortop */
+ { &vop_abortop_desc, genfs_abortop }, /* abortop */
{ &vop_inactive_desc, cd9660_inactive }, /* inactive */
{ &vop_reclaim_desc, cd9660_reclaim }, /* reclaim */
{ &vop_lock_desc, genfs_lock }, /* lock */
@@ -888,7 +873,7 @@
{ &vop_print_desc, cd9660_print }, /* print */
{ &vop_islocked_desc, genfs_islocked }, /* islocked */
{ &vop_pathconf_desc, cd9660_pathconf }, /* pathconf */
- { &vop_advlock_desc, cd9660_advlock }, /* advlock */
+ { &vop_advlock_desc, genfs_einval }, /* advlock */
{ &vop_bwrite_desc, vn_bwrite }, /* bwrite */
{ &vop_getpages_desc, genfs_getpages }, /* getpages */
{ &vop_putpages_desc, genfs_putpages }, /* putpages */
diff -r 701c7f9d4238 -r c3e3395e3f82 sys/fs/puffs/puffs_vnops.c
--- a/sys/fs/puffs/puffs_vnops.c Mon Jul 19 01:06:14 2021 +0000
+++ b/sys/fs/puffs/puffs_vnops.c Mon Jul 19 01:30:24 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_vnops.c,v 1.220 2021/07/18 23:56:13 dholland Exp $ */
+/* $NetBSD: puffs_vnops.c,v 1.221 2021/07/19 01:30:24 dholland Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.220 2021/07/18 23:56:13 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.221 2021/07/19 01:30:24 dholland Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -98,10 +98,6 @@
int puffs_vnop_checkop(void *);
-#define puffs_vnop_lock genfs_lock
-#define puffs_vnop_unlock genfs_unlock
-#define puffs_vnop_islocked genfs_islocked
-
int (**puffs_vnodeop_p)(void *);
const struct vnodeopv_entry_desc puffs_vnodeop_entries[] = {
{ &vop_default_desc, vn_default_error },
@@ -138,11 +134,11 @@
{ &vop_abortop_desc, puffs_vnop_abortop }, /* REAL abortop */
{ &vop_inactive_desc, puffs_vnop_inactive }, /* REAL inactive */
{ &vop_reclaim_desc, puffs_vnop_reclaim }, /* REAL reclaim */
- { &vop_lock_desc, puffs_vnop_lock }, /* REAL lock */
- { &vop_unlock_desc, puffs_vnop_unlock }, /* REAL unlock */
+ { &vop_lock_desc, genfs_lock }, /* REAL lock */
+ { &vop_unlock_desc, genfs_unlock }, /* REAL unlock */
{ &vop_bmap_desc, puffs_vnop_bmap }, /* REAL bmap */
{ &vop_print_desc, puffs_vnop_print }, /* REAL print */
- { &vop_islocked_desc, puffs_vnop_islocked }, /* REAL islocked */
+ { &vop_islocked_desc, genfs_islocked }, /* REAL islocked */
{ &vop_bwrite_desc, genfs_nullop }, /* REAL bwrite */
{ &vop_mmap_desc, puffs_vnop_mmap }, /* REAL mmap */
{ &vop_poll_desc, puffs_vnop_poll }, /* REAL poll */
@@ -176,10 +172,10 @@
{ &vop_fsync_desc, spec_fsync }, /* vflushbuf */
{ &vop_inactive_desc, puffs_vnop_inactive }, /* REAL inactive */
{ &vop_reclaim_desc, puffs_vnop_reclaim }, /* REAL reclaim */
- { &vop_lock_desc, puffs_vnop_lock }, /* REAL lock */
- { &vop_unlock_desc, puffs_vnop_unlock }, /* REAL unlock */
+ { &vop_lock_desc, genfs_lock }, /* REAL lock */
+ { &vop_unlock_desc, genfs_unlock }, /* REAL unlock */
{ &vop_print_desc, puffs_vnop_print }, /* REAL print */
- { &vop_islocked_desc, puffs_vnop_islocked }, /* REAL islocked */
+ { &vop_islocked_desc, genfs_islocked }, /* REAL islocked */
{ &vop_bwrite_desc, vn_bwrite }, /* bwrite */
{ &vop_getextattr_desc, puffs_vnop_checkop }, /* getextattr */
{ &vop_setextattr_desc, puffs_vnop_checkop }, /* setextattr */
@@ -210,11 +206,11 @@
{ &vop_fsync_desc, vn_fifo_bypass }, /* genfs_nullop*/
{ &vop_inactive_desc, puffs_vnop_inactive }, /* REAL inactive */
{ &vop_reclaim_desc, puffs_vnop_reclaim }, /* REAL reclaim */
- { &vop_lock_desc, puffs_vnop_lock }, /* REAL lock */
- { &vop_unlock_desc, puffs_vnop_unlock }, /* REAL unlock */
+ { &vop_lock_desc, genfs_lock }, /* REAL lock */
+ { &vop_unlock_desc, genfs_unlock }, /* REAL unlock */
{ &vop_strategy_desc, vn_fifo_bypass }, /* genfs_badop */
{ &vop_print_desc, puffs_vnop_print }, /* REAL print */
- { &vop_islocked_desc, puffs_vnop_islocked }, /* REAL islocked */
+ { &vop_islocked_desc, genfs_islocked }, /* REAL islocked */
{ &vop_bwrite_desc, vn_bwrite }, /* bwrite */
#if 0
{ &vop_openextattr_desc, _openextattr }, /* openextattr */
@@ -255,7 +251,7 @@
{ &vop_readdir_desc, puffs_vnop_readdir }, /* readdir */
{ &vop_readlink_desc, puffs_vnop_readlink }, /* readlink */
{ &vop_print_desc, puffs_vnop_print }, /* print */
- { &vop_islocked_desc, puffs_vnop_islocked }, /* islocked */
+ { &vop_islocked_desc, genfs_islocked }, /* islocked */
{ &vop_pathconf_desc, puffs_vnop_pathconf }, /* pathconf */
{ &vop_getpages_desc, puffs_vnop_getpages }, /* getpages */
{ NULL, NULL }
diff -r 701c7f9d4238 -r c3e3395e3f82 sys/fs/tmpfs/tmpfs_fifoops.c
--- a/sys/fs/tmpfs/tmpfs_fifoops.c Mon Jul 19 01:06:14 2021 +0000
+++ b/sys/fs/tmpfs/tmpfs_fifoops.c Mon Jul 19 01:30:24 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tmpfs_fifoops.c,v 1.14 2021/07/18 23:56:13 dholland Exp $ */
+/* $NetBSD: tmpfs_fifoops.c,v 1.15 2021/07/19 01:30:25 dholland Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_fifoops.c,v 1.14 2021/07/18 23:56:13 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_fifoops.c,v 1.15 2021/07/19 01:30:25 dholland Exp $");
#include <sys/param.h>
#include <sys/vnode.h>
@@ -51,22 +51,22 @@
{ &vop_default_desc, vn_default_error },
GENFS_FIFOOP_ENTRIES,
{ &vop_close_desc, tmpfs_fifo_close },
- { &vop_access_desc, tmpfs_fifo_access },
+ { &vop_access_desc, tmpfs_access },
{ &vop_accessx_desc, genfs_accessx },
- { &vop_getattr_desc, tmpfs_fifo_getattr },
- { &vop_setattr_desc, tmpfs_fifo_setattr },
+ { &vop_getattr_desc, tmpfs_getattr },
+ { &vop_setattr_desc, tmpfs_setattr },
{ &vop_read_desc, tmpfs_fifo_read },
{ &vop_write_desc, tmpfs_fifo_write },
- { &vop_fcntl_desc, tmpfs_fifo_fcntl },
- { &vop_fsync_desc, tmpfs_fifo_fsync },
- { &vop_inactive_desc, tmpfs_fifo_inactive },
- { &vop_reclaim_desc, tmpfs_fifo_reclaim },
- { &vop_lock_desc, tmpfs_fifo_lock },
- { &vop_unlock_desc, tmpfs_fifo_unlock },
- { &vop_strategy_desc, tmpfs_fifo_strategy },
- { &vop_print_desc, tmpfs_fifo_print },
- { &vop_islocked_desc, tmpfs_fifo_islocked },
- { &vop_bwrite_desc, tmpfs_fifo_bwrite },
+ { &vop_fcntl_desc, genfs_fcntl },
+ { &vop_fsync_desc, vn_fifo_bypass },
+ { &vop_inactive_desc, tmpfs_inactive },
+ { &vop_reclaim_desc, tmpfs_reclaim },
+ { &vop_lock_desc, genfs_lock },
+ { &vop_unlock_desc, genfs_unlock },
+ { &vop_strategy_desc, vn_fifo_bypass },
+ { &vop_print_desc, tmpfs_print },
+ { &vop_islocked_desc, genfs_islocked },
+ { &vop_bwrite_desc, genfs_nullop },
{ NULL, NULL }
};
diff -r 701c7f9d4238 -r c3e3395e3f82 sys/fs/tmpfs/tmpfs_specops.c
--- a/sys/fs/tmpfs/tmpfs_specops.c Mon Jul 19 01:06:14 2021 +0000
+++ b/sys/fs/tmpfs/tmpfs_specops.c Mon Jul 19 01:30:24 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tmpfs_specops.c,v 1.15 2021/07/18 23:56:13 dholland Exp $ */
+/* $NetBSD: tmpfs_specops.c,v 1.16 2021/07/19 01:30:25 dholland Exp $ */
/*
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_specops.c,v 1.15 2021/07/18 23:56:13 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_specops.c,v 1.16 2021/07/19 01:30:25 dholland Exp $");
#include <sys/param.h>
#include <sys/vnode.h>
@@ -54,21 +54,21 @@
{ &vop_default_desc, vn_default_error },
GENFS_SPECOP_ENTRIES,
{ &vop_close_desc, tmpfs_spec_close },
- { &vop_access_desc, tmpfs_spec_access },
+ { &vop_access_desc, tmpfs_access },
{ &vop_accessx_desc, genfs_accessx },
- { &vop_getattr_desc, tmpfs_spec_getattr },
- { &vop_setattr_desc, tmpfs_spec_setattr },
+ { &vop_getattr_desc, tmpfs_getattr },
+ { &vop_setattr_desc, tmpfs_setattr },
{ &vop_read_desc, tmpfs_spec_read },
{ &vop_write_desc, tmpfs_spec_write },
- { &vop_fcntl_desc, tmpfs_spec_fcntl },
- { &vop_fsync_desc, tmpfs_spec_fsync },
- { &vop_inactive_desc, tmpfs_spec_inactive },
- { &vop_reclaim_desc, tmpfs_spec_reclaim },
- { &vop_lock_desc, tmpfs_spec_lock },
- { &vop_unlock_desc, tmpfs_spec_unlock },
- { &vop_print_desc, tmpfs_spec_print },
- { &vop_islocked_desc, tmpfs_spec_islocked },
- { &vop_bwrite_desc, tmpfs_spec_bwrite },
+ { &vop_fcntl_desc, genfs_fcntl },
+ { &vop_fsync_desc, spec_fsync },
+ { &vop_inactive_desc, tmpfs_inactive },
+ { &vop_reclaim_desc, tmpfs_reclaim },
+ { &vop_lock_desc, genfs_lock },
+ { &vop_unlock_desc, genfs_unlock },
+ { &vop_print_desc, tmpfs_print },
+ { &vop_islocked_desc, genfs_islocked },
+ { &vop_bwrite_desc, vn_bwrite },
{ NULL, NULL }
};
Home |
Main Index |
Thread Index |
Old Index