Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys - Add a new vnode op: VOP_PARSEPATH.
details: https://anonhg.NetBSD.org/src/rev/5eee625199cf
branches: trunk
changeset: 1022015:5eee625199cf
user: dholland <dholland%NetBSD.org@localhost>
date: Tue Jun 29 22:34:05 2021 +0000
description:
- Add a new vnode op: VOP_PARSEPATH.
- Move namei_getcomponent to genfs_vnops.c and call it genfs_parsepath.
- Add a parsepath entry to every vnode ops table.
VOP_PARSEPATH takes a directory vnode to be searched and a complete
following path and chooses how much of that path to consume. To begin
with, all parsepath calls are genfs_parsepath, which locates the first
'/' as always.
Note that the call doesn't take the whole struct componentname, only
the string. The other bits of struct componentname should not be
needed and there's no reason to cause potential complications by
exposing them.
diffstat:
sys/coda/coda_vnops.c | 5 +++--
sys/fs/adosfs/advnops.c | 5 +++--
sys/fs/autofs/autofs_vnops.c | 5 +++--
sys/fs/cd9660/cd9660_vnops.c | 7 +++++--
sys/fs/efs/efs_vnops.c | 7 +++++--
sys/fs/filecorefs/filecore_vnops.c | 5 +++--
sys/fs/hfs/hfs_vnops.c | 7 +++++--
sys/fs/msdosfs/msdosfs_vnops.c | 5 +++--
sys/fs/nilfs/nilfs_vnops.c | 5 +++--
sys/fs/ntfs/ntfs_vnops.c | 5 +++--
sys/fs/ptyfs/ptyfs_vnops.c | 5 +++--
sys/fs/puffs/puffs_vnops.c | 8 ++++++--
sys/fs/sysvbfs/sysvbfs.c | 5 +++--
sys/fs/tmpfs/tmpfs_fifoops.c | 5 +++--
sys/fs/tmpfs/tmpfs_specops.c | 5 +++--
sys/fs/tmpfs/tmpfs_vnops.c | 5 +++--
sys/fs/udf/udf_vnops.c | 5 +++--
sys/fs/union/union_vnops.c | 5 +++--
sys/fs/unionfs/unionfs_vnops.c | 1 +
sys/fs/v7fs/v7fs_extern.c | 7 +++++--
sys/kern/vfs_lookup.c | 31 +++++--------------------------
sys/kern/vnode_if.src | 11 ++++++++++-
sys/miscfs/deadfs/dead_vnops.c | 5 +++--
sys/miscfs/fdesc/fdesc_vnops.c | 5 +++--
sys/miscfs/fifofs/fifo_vnops.c | 5 +++--
sys/miscfs/genfs/genfs.h | 3 ++-
sys/miscfs/genfs/genfs_vnops.c | 29 +++++++++++++++++++++++++++--
sys/miscfs/kernfs/kernfs_vnops.c | 6 ++++--
sys/miscfs/procfs/procfs_vnops.c | 5 +++--
sys/miscfs/specfs/spec_vnops.c | 5 +++--
sys/nfs/nfs_vnops.c | 7 +++++--
sys/rump/librump/rumpvfs/rumpfs.c | 5 +++--
sys/ufs/chfs/chfs_vnops.c | 5 ++++-
sys/ufs/ext2fs/ext2fs_vnops.c | 7 +++++--
sys/ufs/ffs/ffs_vnops.c | 7 +++++--
sys/ufs/lfs/lfs_vnops.c | 7 +++++--
sys/ufs/mfs/mfs_vnops.c | 5 +++--
37 files changed, 162 insertions(+), 93 deletions(-)
diffs (truncated from 1175 to 300 lines):
diff -r 8acb370fcdf8 -r 5eee625199cf sys/coda/coda_vnops.c
--- a/sys/coda/coda_vnops.c Tue Jun 29 22:29:59 2021 +0000
+++ b/sys/coda/coda_vnops.c Tue Jun 29 22:34:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: coda_vnops.c,v 1.114 2020/11/14 11:42:56 hannken Exp $ */
+/* $NetBSD: coda_vnops.c,v 1.115 2021/06/29 22:34:05 dholland Exp $ */
/*
*
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.114 2020/11/14 11:42:56 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coda_vnops.c,v 1.115 2021/06/29 22:34:05 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -101,6 +101,7 @@
const struct vnodeopv_entry_desc coda_vnodeop_entries[] = {
{ &vop_default_desc, coda_vop_error },
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, coda_lookup }, /* lookup */
{ &vop_create_desc, coda_create }, /* create */
{ &vop_mknod_desc, coda_vop_error }, /* mknod */
diff -r 8acb370fcdf8 -r 5eee625199cf sys/fs/adosfs/advnops.c
--- a/sys/fs/adosfs/advnops.c Tue Jun 29 22:29:59 2021 +0000
+++ b/sys/fs/adosfs/advnops.c Tue Jun 29 22:34:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: advnops.c,v 1.55 2020/06/27 17:29:17 christos Exp $ */
+/* $NetBSD: advnops.c,v 1.56 2021/06/29 22:34:05 dholland Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.55 2020/06/27 17:29:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: advnops.c,v 1.56 2021/06/29 22:34:05 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -95,6 +95,7 @@
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 */
diff -r 8acb370fcdf8 -r 5eee625199cf sys/fs/autofs/autofs_vnops.c
--- a/sys/fs/autofs/autofs_vnops.c Tue Jun 29 22:29:59 2021 +0000
+++ b/sys/fs/autofs/autofs_vnops.c Tue Jun 29 22:34:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autofs_vnops.c,v 1.6 2020/05/16 18:31:48 christos Exp $ */
+/* $NetBSD: autofs_vnops.c,v 1.7 2021/06/29 22:34:06 dholland Exp $ */
/*-
* Copyright (c) 2017 The NetBSD Foundation, Inc.
* Copyright (c) 2016 The DragonFly Project
@@ -34,7 +34,7 @@
*
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.6 2020/05/16 18:31:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.7 2021/06/29 22:34:06 dholland Exp $");
#include "autofs.h"
@@ -587,6 +587,7 @@
int (**autofs_vnodeop_p)(void *);
static const struct vnodeopv_entry_desc autofs_vnodeop_entries[] = {
{ &vop_default_desc, vn_default_error },
+ { &vop_parsepath_desc, genfs_parsepath },
{ &vop_lookup_desc, autofs_lookup },
{ &vop_open_desc, autofs_open },
{ &vop_close_desc, autofs_close },
diff -r 8acb370fcdf8 -r 5eee625199cf sys/fs/cd9660/cd9660_vnops.c
--- a/sys/fs/cd9660/cd9660_vnops.c Tue Jun 29 22:29:59 2021 +0000
+++ b/sys/fs/cd9660/cd9660_vnops.c Tue Jun 29 22:34:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660_vnops.c,v 1.58 2020/06/27 17:29:17 christos Exp $ */
+/* $NetBSD: cd9660_vnops.c,v 1.59 2021/06/29 22:34:06 dholland Exp $ */
/*-
* Copyright (c) 1994
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.58 2020/06/27 17:29:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd9660_vnops.c,v 1.59 2021/06/29 22:34:06 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -849,6 +849,7 @@
int (**cd9660_vnodeop_p)(void *);
const struct vnodeopv_entry_desc cd9660_vnodeop_entries[] = {
{ &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 */
@@ -902,6 +903,7 @@
int (**cd9660_specop_p)(void *);
const struct vnodeopv_entry_desc cd9660_specop_entries[] = {
{ &vop_default_desc, vn_default_error },
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, spec_lookup }, /* lookup */
{ &vop_create_desc, spec_create }, /* create */
{ &vop_mknod_desc, spec_mknod }, /* mknod */
@@ -953,6 +955,7 @@
int (**cd9660_fifoop_p)(void *);
const struct vnodeopv_entry_desc cd9660_fifoop_entries[] = {
{ &vop_default_desc, vn_default_error },
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, vn_fifo_bypass }, /* lookup */
{ &vop_create_desc, vn_fifo_bypass }, /* create */
{ &vop_mknod_desc, vn_fifo_bypass }, /* mknod */
diff -r 8acb370fcdf8 -r 5eee625199cf sys/fs/efs/efs_vnops.c
--- a/sys/fs/efs/efs_vnops.c Tue Jun 29 22:29:59 2021 +0000
+++ b/sys/fs/efs/efs_vnops.c Tue Jun 29 22:34:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efs_vnops.c,v 1.41 2020/06/27 17:29:17 christos Exp $ */
+/* $NetBSD: efs_vnops.c,v 1.42 2021/06/29 22:34:06 dholland Exp $ */
/*
* Copyright (c) 2006 Stephen M. Rumble <rumble%ephemeral.org@localhost>
@@ -17,7 +17,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: efs_vnops.c,v 1.41 2020/06/27 17:29:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: efs_vnops.c,v 1.42 2021/06/29 22:34:06 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -783,6 +783,7 @@
int (**efs_vnodeop_p)(void *);
const struct vnodeopv_entry_desc efs_vnodeop_entries[] = {
{ &vop_default_desc, vn_default_error}, /* error handler */
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, efs_lookup }, /* lookup */
{ &vop_create_desc, genfs_eopnotsupp}, /* create */
{ &vop_mknod_desc, genfs_eopnotsupp}, /* mknod */
@@ -842,6 +843,7 @@
int (**efs_specop_p)(void *);
const struct vnodeopv_entry_desc efs_specop_entries[] = {
{ &vop_default_desc, vn_default_error}, /* error handler */
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, spec_lookup }, /* lookup */
{ &vop_create_desc, spec_create }, /* create */
{ &vop_mknod_desc, spec_mknod }, /* mknod */
@@ -901,6 +903,7 @@
int (**efs_fifoop_p)(void *);
const struct vnodeopv_entry_desc efs_fifoop_entries[] = {
{ &vop_default_desc, vn_default_error}, /* error handler */
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, vn_fifo_bypass }, /* lookup */
{ &vop_create_desc, vn_fifo_bypass }, /* create */
{ &vop_mknod_desc, vn_fifo_bypass }, /* mknod */
diff -r 8acb370fcdf8 -r 5eee625199cf sys/fs/filecorefs/filecore_vnops.c
--- a/sys/fs/filecorefs/filecore_vnops.c Tue Jun 29 22:29:59 2021 +0000
+++ b/sys/fs/filecorefs/filecore_vnops.c Tue Jun 29 22:34:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: filecore_vnops.c,v 1.47 2020/06/27 17:29:18 christos Exp $ */
+/* $NetBSD: filecore_vnops.c,v 1.48 2021/06/29 22:34:06 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.47 2020/06/27 17:29:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: filecore_vnops.c,v 1.48 2021/06/29 22:34:06 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -554,6 +554,7 @@
int (**filecore_vnodeop_p)(void *);
const struct vnodeopv_entry_desc filecore_vnodeop_entries[] = {
{ &vop_default_desc, vn_default_error },
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, filecore_lookup }, /* lookup */
{ &vop_create_desc, filecore_create }, /* create */
{ &vop_mknod_desc, filecore_mknod }, /* mknod */
diff -r 8acb370fcdf8 -r 5eee625199cf sys/fs/hfs/hfs_vnops.c
--- a/sys/fs/hfs/hfs_vnops.c Tue Jun 29 22:29:59 2021 +0000
+++ b/sys/fs/hfs/hfs_vnops.c Tue Jun 29 22:34:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hfs_vnops.c,v 1.36 2020/05/16 18:31:49 christos Exp $ */
+/* $NetBSD: hfs_vnops.c,v 1.37 2021/06/29 22:34:06 dholland Exp $ */
/*-
* Copyright (c) 2005, 2007 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hfs_vnops.c,v 1.36 2020/05/16 18:31:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hfs_vnops.c,v 1.37 2021/06/29 22:34:06 dholland Exp $");
#ifdef _KERNEL_OPT
#include "opt_ipsec.h"
@@ -155,6 +155,7 @@
int (**hfs_vnodeop_p) (void *);
const struct vnodeopv_entry_desc hfs_vnodeop_entries[] = {
{ &vop_default_desc, vn_default_error },
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, hfs_vop_lookup }, /* lookup */
{ &vop_create_desc, genfs_eopnotsupp }, /* create */
{ &vop_whiteout_desc, genfs_eopnotsupp }, /* whiteout */
@@ -213,6 +214,7 @@
int (**hfs_specop_p) (void *);
const struct vnodeopv_entry_desc hfs_specop_entries[] = {
{ &vop_default_desc, vn_default_error },
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, spec_lookup }, /* lookup */
{ &vop_create_desc, spec_create }, /* create */
{ &vop_mknod_desc, spec_mknod }, /* mknod */
@@ -272,6 +274,7 @@
int (**hfs_fifoop_p) (void *);
const struct vnodeopv_entry_desc hfs_fifoop_entries[] = {
{ &vop_default_desc, vn_default_error },
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, vn_fifo_bypass }, /* lookup */
{ &vop_create_desc, vn_fifo_bypass }, /* create */
{ &vop_mknod_desc, vn_fifo_bypass }, /* mknod */
diff -r 8acb370fcdf8 -r 5eee625199cf sys/fs/msdosfs/msdosfs_vnops.c
--- a/sys/fs/msdosfs/msdosfs_vnops.c Tue Jun 29 22:29:59 2021 +0000
+++ b/sys/fs/msdosfs/msdosfs_vnops.c Tue Jun 29 22:34:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vnops.c,v 1.104 2020/06/27 17:29:18 christos Exp $ */
+/* $NetBSD: msdosfs_vnops.c,v 1.105 2021/06/29 22:34:07 dholland Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.104 2020/06/27 17:29:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.105 2021/06/29 22:34:07 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1841,6 +1841,7 @@
int (**msdosfs_vnodeop_p)(void *);
const struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = {
{ &vop_default_desc, vn_default_error },
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, msdosfs_lookup }, /* lookup */
{ &vop_create_desc, msdosfs_create }, /* create */
{ &vop_mknod_desc, genfs_eopnotsupp }, /* mknod */
diff -r 8acb370fcdf8 -r 5eee625199cf sys/fs/nilfs/nilfs_vnops.c
--- a/sys/fs/nilfs/nilfs_vnops.c Tue Jun 29 22:29:59 2021 +0000
+++ b/sys/fs/nilfs/nilfs_vnops.c Tue Jun 29 22:34:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nilfs_vnops.c,v 1.42 2020/06/27 17:29:18 christos Exp $ */
+/* $NetBSD: nilfs_vnops.c,v 1.43 2021/06/29 22:34:07 dholland Exp $ */
/*
* Copyright (c) 2008, 2009 Reinoud Zandijk
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.42 2020/06/27 17:29:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nilfs_vnops.c,v 1.43 2021/06/29 22:34:07 dholland Exp $");
#endif /* not lint */
@@ -1543,6 +1543,7 @@
const struct vnodeopv_entry_desc nilfs_vnodeop_entries[] = {
{ &vop_default_desc, vn_default_error },
+ { &vop_parsepath_desc, genfs_parsepath }, /* parsepath */
{ &vop_lookup_desc, nilfs_lookup }, /* lookup */
{ &vop_create_desc, nilfs_create }, /* create */
{ &vop_mknod_desc, nilfs_mknod }, /* mknod */ /* TODO */
diff -r 8acb370fcdf8 -r 5eee625199cf sys/fs/ntfs/ntfs_vnops.c
--- a/sys/fs/ntfs/ntfs_vnops.c Tue Jun 29 22:29:59 2021 +0000
+++ b/sys/fs/ntfs/ntfs_vnops.c Tue Jun 29 22:34:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ntfs_vnops.c,v 1.65 2020/06/27 17:29:18 christos Exp $ */
+/* $NetBSD: ntfs_vnops.c,v 1.66 2021/06/29 22:34:07 dholland Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.65 2020/06/27 17:29:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_vnops.c,v 1.66 2021/06/29 22:34:07 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
Home |
Main Index |
Thread Index |
Old Index