Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys dedup the eofs link/symlink methods
details: https://anonhg.NetBSD.org/src/rev/cebcf503b3a1
branches: trunk
changeset: 364482:cebcf503b3a1
user: christos <christos%NetBSD.org@localhost>
date: Sun Mar 27 17:10:55 2022 +0000
description:
dedup the eofs link/symlink methods
diffstat:
sys/fs/adosfs/advnops.c | 38 ++++----------------------------------
sys/fs/cd9660/cd9660_node.h | 4 +---
sys/fs/cd9660/cd9660_vnops.c | 36 ++++--------------------------------
sys/fs/filecorefs/filecore_node.h | 4 +---
sys/fs/filecorefs/filecore_vnops.c | 36 ++++--------------------------------
sys/miscfs/fdesc/fdesc_vnops.c | 38 ++++----------------------------------
sys/miscfs/genfs/genfs.h | 4 +++-
sys/miscfs/genfs/genfs_vnops.c | 18 ++++++++++++++++--
sys/miscfs/kernfs/kernfs_vnops.c | 38 ++++----------------------------------
sys/miscfs/procfs/procfs_vnops.c | 38 ++++----------------------------------
10 files changed, 45 insertions(+), 209 deletions(-)
diffs (truncated from 528 to 300 lines):
diff -r c6490d9d5729 -r cebcf503b3a1 sys/fs/adosfs/advnops.c
--- a/sys/fs/adosfs/advnops.c Sun Mar 27 16:36:11 2022 +0000
+++ b/sys/fs/adosfs/advnops.c Sun Mar 27 17:10:55 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: advnops.c,v 1.57 2021/07/18 23:57:13 dholland Exp $ */
+/* $NetBSD: advnops.c,v 1.58 2022/03/27 17:10:55 christos Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.57 2021/07/18 23:57:13 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.58 2022/03/27 17:10:55 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -61,8 +61,6 @@
int adosfs_read(void *);
int adosfs_write(void *);
int adosfs_strategy(void *);
-int adosfs_link(void *);
-int adosfs_symlink(void *);
int adosfs_bmap(void *);
int adosfs_print(void *);
int adosfs_readdir(void *);
@@ -97,11 +95,11 @@
{ &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_link_desc, genfs_erofs_link }, /* link */
{ &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_symlink_desc, genfs_erofs_symlink }, /* symlink */
{ &vop_readdir_desc, adosfs_readdir }, /* readdir */
{ &vop_readlink_desc, adosfs_readlink }, /* readlink */
{ &vop_abortop_desc, genfs_abortop }, /* abortop */
@@ -387,34 +385,6 @@
return(error);
}
-int
-adosfs_link(void *v)
-{
- struct vop_link_v2_args /* {
- struct vnode *a_dvp;
- struct vnode *a_vp;
- struct componentname *a_cnp;
- } */ *ap = v;
-
- VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
- return (EROFS);
-}
-
-int
-adosfs_symlink(void *v)
-{
- struct vop_symlink_v3_args /* {
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
- struct vattr *a_vap;
- char *a_target;
- } */ *ap = v;
-
- VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
- return (EROFS);
-}
-
/*
* Wait until the vnode has finished changing state.
*/
diff -r c6490d9d5729 -r cebcf503b3a1 sys/fs/cd9660/cd9660_node.h
--- a/sys/fs/cd9660/cd9660_node.h Sun Mar 27 16:36:11 2022 +0000
+++ b/sys/fs/cd9660/cd9660_node.h Sun Mar 27 17:10:55 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660_node.h,v 1.17 2021/07/18 23:57:13 dholland Exp $ */
+/* $NetBSD: cd9660_node.h,v 1.18 2022/03/27 17:10:55 christos Exp $ */
/*-
* Copyright (c) 1994
@@ -104,8 +104,6 @@
int cd9660_readlink(void *);
int cd9660_inactive(void *);
int cd9660_reclaim(void *);
-int cd9660_link(void *);
-int cd9660_symlink(void *);
int cd9660_bmap(void *);
int cd9660_lock(void *);
int cd9660_unlock(void *);
diff -r c6490d9d5729 -r cebcf503b3a1 sys/fs/cd9660/cd9660_vnops.c
--- a/sys/fs/cd9660/cd9660_vnops.c Sun Mar 27 16:36:11 2022 +0000
+++ b/sys/fs/cd9660/cd9660_vnops.c Sun Mar 27 17:10:55 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660_vnops.c,v 1.61 2021/07/19 01:30:24 dholland Exp $ */
+/* $NetBSD: cd9660_vnops.c,v 1.62 2022/03/27 17:10:55 christos Exp $ */
/*-
* Copyright (c) 1994
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.61 2021/07/19 01:30:24 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.62 2022/03/27 17:10:55 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -662,34 +662,6 @@
return (0);
}
-int
-cd9660_link(void *v)
-{
- struct vop_link_v2_args /* {
- struct vnode *a_dvp;
- struct vnode *a_vp;
- struct componentname *a_cnp;
- } */ *ap = v;
-
- VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
- return (EROFS);
-}
-
-int
-cd9660_symlink(void *v)
-{
- struct vop_symlink_v3_args /* {
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
- struct vattr *a_vap;
- char *a_target;
- } */ *ap = v;
-
- VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
- return (EROFS);
-}
-
/*
* Calculate the logical to physical mapping if not done already,
* then call the device strategy routine.
@@ -856,11 +828,11 @@
{ &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_link_desc, genfs_erofs_link }, /* link */
{ &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_symlink_desc, genfs_erofs_symlink }, /* symlink */
{ &vop_readdir_desc, cd9660_readdir }, /* readdir */
{ &vop_readlink_desc, cd9660_readlink }, /* readlink */
{ &vop_abortop_desc, genfs_abortop }, /* abortop */
diff -r c6490d9d5729 -r cebcf503b3a1 sys/fs/filecorefs/filecore_node.h
--- a/sys/fs/filecorefs/filecore_node.h Sun Mar 27 16:36:11 2022 +0000
+++ b/sys/fs/filecorefs/filecore_node.h Sun Mar 27 17:10:55 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: filecore_node.h,v 1.7 2021/07/18 23:57:14 dholland Exp $ */
+/* $NetBSD: filecore_node.h,v 1.8 2022/03/27 17:10:55 christos Exp $ */
/*-
* Copyright (c) 1994 The Regents of the University of California.
@@ -119,8 +119,6 @@
int filecore_readlink(void *);
int filecore_inactive(void *);
int filecore_reclaim(void *);
-int filecore_link(void *);
-int filecore_symlink(void *);
int filecore_bmap(void *);
int filecore_strategy(void *);
int filecore_print(void *);
diff -r c6490d9d5729 -r cebcf503b3a1 sys/fs/filecorefs/filecore_vnops.c
--- a/sys/fs/filecorefs/filecore_vnops.c Sun Mar 27 16:36:11 2022 +0000
+++ b/sys/fs/filecorefs/filecore_vnops.c Sun Mar 27 17:10:55 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: filecore_vnops.c,v 1.49 2021/07/18 23:57:14 dholland Exp $ */
+/* $NetBSD: filecore_vnops.c,v 1.50 2022/03/27 17:10:55 christos 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.49 2021/07/18 23:57:14 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filecore_vnops.c,v 1.50 2022/03/27 17:10:55 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -416,34 +416,6 @@
return (EINVAL);
}
-int
-filecore_link(void *v)
-{
- struct vop_link_v2_args /* {
- struct vnode *a_dvp;
- struct vnode *a_vp;
- struct componentname *a_cnp;
- } */ *ap = v;
-
- VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
- return (EROFS);
-}
-
-int
-filecore_symlink(void *v)
-{
- struct vop_symlink_v3_args /* {
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
- struct vattr *a_vap;
- char *a_target;
- } */ *ap = v;
-
- VOP_ABORTOP(ap->a_dvp, ap->a_cnp);
- return (EROFS);
-}
-
/*
* Calculate the logical to physical mapping if not done already,
* then call the device strategy routine.
@@ -559,11 +531,11 @@
{ &vop_fsync_desc, genfs_nullop }, /* fsync */
{ &vop_seek_desc, genfs_seek }, /* seek */
{ &vop_remove_desc, genfs_eopnotsupp }, /* remove */
- { &vop_link_desc, filecore_link }, /* link */
+ { &vop_link_desc, genfs_erofs_link }, /* link */
{ &vop_rename_desc, genfs_eopnotsupp }, /* rename */
{ &vop_mkdir_desc, genfs_eopnotsupp }, /* mkdir */
{ &vop_rmdir_desc, genfs_eopnotsupp }, /* rmdir */
- { &vop_symlink_desc, filecore_symlink }, /* symlink */
+ { &vop_symlink_desc, genfs_erofs_symlink }, /* symlink */
{ &vop_readdir_desc, filecore_readdir }, /* readdir */
{ &vop_readlink_desc, filecore_readlink }, /* readlink */
{ &vop_abortop_desc, genfs_abortop }, /* abortop */
diff -r c6490d9d5729 -r cebcf503b3a1 sys/miscfs/fdesc/fdesc_vnops.c
--- a/sys/miscfs/fdesc/fdesc_vnops.c Sun Mar 27 16:36:11 2022 +0000
+++ b/sys/miscfs/fdesc/fdesc_vnops.c Sun Mar 27 17:10:55 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdesc_vnops.c,v 1.139 2022/01/15 19:33:58 riastradh Exp $ */
+/* $NetBSD: fdesc_vnops.c,v 1.140 2022/03/27 17:10:55 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdesc_vnops.c,v 1.139 2022/01/15 19:33:58 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdesc_vnops.c,v 1.140 2022/03/27 17:10:55 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -83,8 +83,6 @@
int fdesc_ioctl(void *);
int fdesc_poll(void *);
int fdesc_kqfilter(void *);
-int fdesc_link(void *);
-int fdesc_symlink(void *);
int fdesc_readdir(void *);
int fdesc_readlink(void *);
int fdesc_inactive(void *);
@@ -120,11 +118,11 @@
{ &vop_fsync_desc, genfs_nullop }, /* fsync */
{ &vop_seek_desc, genfs_seek }, /* seek */
{ &vop_remove_desc, genfs_eopnotsupp }, /* remove */
- { &vop_link_desc, fdesc_link }, /* link */
+ { &vop_link_desc, genfs_erofs_link }, /* link */
{ &vop_rename_desc, genfs_eopnotsupp }, /* rename */
{ &vop_mkdir_desc, genfs_eopnotsupp }, /* mkdir */
{ &vop_rmdir_desc, genfs_eopnotsupp }, /* rmdir */
- { &vop_symlink_desc, fdesc_symlink }, /* symlink */
+ { &vop_symlink_desc, genfs_erofs_symlink }, /* symlink */
{ &vop_readdir_desc, fdesc_readdir }, /* readdir */
{ &vop_readlink_desc, fdesc_readlink }, /* readlink */
{ &vop_abortop_desc, genfs_abortop }, /* abortop */
@@ -912,31 +910,3 @@
printf("tag VT_NON, fdesc vnode\n");
return (0);
}
-
-int
-fdesc_link(void *v)
-{
- struct vop_link_v2_args /* {
- struct vnode *a_dvp;
- struct vnode *a_vp;
- struct componentname *a_cnp;
- } */ *ap = v;
Home |
Main Index |
Thread Index |
Old Index