diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2007-12-27 13:59:13 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2007-12-27 13:59:13 +0000 |
commit | f32f6ed7eeed1a84f69f7f790e84a93f5ea11a73 (patch) | |
tree | 2234a075b86cc6d6b409cc9a84fcf98205456982 /sys/miscfs | |
parent | 81ffa8b843b1adb19ebe5dfe4bde01457853a3e8 (diff) |
fifofs, deadfs and specfs all have the same "trivial lookup routine that
always fails". Introduce vop_generic_lookup(), which is a trivial lookup
routine that always fails and use that instead, zap the redundant copies.
ok toby@, tedu@, art@
Diffstat (limited to 'sys/miscfs')
-rw-r--r-- | sys/miscfs/deadfs/dead_vnops.c | 18 | ||||
-rw-r--r-- | sys/miscfs/fifofs/fifo.h | 3 | ||||
-rw-r--r-- | sys/miscfs/fifofs/fifo_vnops.c | 17 | ||||
-rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 16 | ||||
-rw-r--r-- | sys/miscfs/specfs/specdev.h | 3 |
5 files changed, 8 insertions, 49 deletions
diff --git a/sys/miscfs/deadfs/dead_vnops.c b/sys/miscfs/deadfs/dead_vnops.c index 1472298457c..ee1cbebc62a 100644 --- a/sys/miscfs/deadfs/dead_vnops.c +++ b/sys/miscfs/deadfs/dead_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dead_vnops.c,v 1.18 2007/06/01 23:47:57 deraadt Exp $ */ +/* $OpenBSD: dead_vnops.c,v 1.19 2007/12/27 13:59:12 thib Exp $ */ /* $NetBSD: dead_vnops.c,v 1.16 1996/02/13 13:12:48 mycroft Exp $ */ /* @@ -48,7 +48,6 @@ int dead_badop(void *); int dead_ebadf(void *); -int dead_lookup(void *); #define dead_create dead_badop #define dead_mknod dead_badop int dead_open(void *); @@ -88,7 +87,7 @@ int (**dead_vnodeop_p)(void *); struct vnodeopv_entry_desc dead_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, - { &vop_lookup_desc, dead_lookup }, /* lookup */ + { &vop_lookup_desc, vop_generic_lookup }, /* lookup */ { &vop_create_desc, dead_create }, /* create */ { &vop_mknod_desc, dead_mknod }, /* mknod */ { &vop_open_desc, dead_open }, /* open */ @@ -127,19 +126,6 @@ struct vnodeopv_desc dead_vnodeop_opv_desc = { &dead_vnodeop_p, dead_vnodeop_entries }; /* - * Trivial lookup routine that always fails. - */ -/* ARGSUSED */ -int -dead_lookup(void *v) -{ - struct vop_lookup_args *ap = v; - - *ap->a_vpp = NULL; - return (ENOTDIR); -} - -/* * Open always fails as if device did not exist. */ /* ARGSUSED */ diff --git a/sys/miscfs/fifofs/fifo.h b/sys/miscfs/fifofs/fifo.h index b3b0754285d..d83d145435b 100644 --- a/sys/miscfs/fifofs/fifo.h +++ b/sys/miscfs/fifofs/fifo.h @@ -1,4 +1,4 @@ -/* $OpenBSD: fifo.h,v 1.16 2007/01/16 17:52:18 thib Exp $ */ +/* $OpenBSD: fifo.h,v 1.17 2007/12/27 13:59:12 thib Exp $ */ /* $NetBSD: fifo.h,v 1.10 1996/02/09 22:40:15 christos Exp $ */ /* @@ -39,7 +39,6 @@ int fifo_badop(void *); int fifo_ebadf(void *); -int fifo_lookup(void *); #define fifo_create fifo_badop #define fifo_mknod fifo_badop int fifo_open(void *); diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c index 3f6fcdd622d..cfee73b3922 100644 --- a/sys/miscfs/fifofs/fifo_vnops.c +++ b/sys/miscfs/fifofs/fifo_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fifo_vnops.c,v 1.25 2007/10/29 15:38:00 chl Exp $ */ +/* $OpenBSD: fifo_vnops.c,v 1.26 2007/12/27 13:59:12 thib Exp $ */ /* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */ /* @@ -64,7 +64,7 @@ struct fifoinfo { int (**fifo_vnodeop_p)(void *); struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, - { &vop_lookup_desc, fifo_lookup }, /* lookup */ + { &vop_lookup_desc, vop_generic_lookup }, /* lookup */ { &vop_create_desc, fifo_create }, /* create */ { &vop_mknod_desc, fifo_mknod }, /* mknod */ { &vop_open_desc, fifo_open }, /* open */ @@ -124,19 +124,6 @@ struct filterops fifowrite_filtops = { 1, NULL, filt_fifowdetach, filt_fifowrite }; /* - * Trivial lookup routine that always fails. - */ -/* ARGSUSED */ -int -fifo_lookup(void *v) -{ - struct vop_lookup_args *ap = v; - - *ap->a_vpp = NULL; - return (ENOTDIR); -} - -/* * Open called to set up a new instance of a fifo or * to find an active instance of a fifo. */ diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index d6507439703..97bfdf61f85 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spec_vnops.c,v 1.43 2007/06/18 08:30:07 jasper Exp $ */ +/* $OpenBSD: spec_vnops.c,v 1.44 2007/12/27 13:59:12 thib Exp $ */ /* $NetBSD: spec_vnops.c,v 1.29 1996/04/22 01:42:38 christos Exp $ */ /* @@ -58,7 +58,7 @@ struct vnode *speclisth[SPECHSZ]; int (**spec_vnodeop_p)(void *); struct vnodeopv_entry_desc spec_vnodeop_entries[] = { { &vop_default_desc, vn_default_error }, - { &vop_lookup_desc, spec_lookup }, /* lookup */ + { &vop_lookup_desc, vop_generic_lookup }, /* lookup */ { &vop_create_desc, spec_create }, /* create */ { &vop_mknod_desc, spec_mknod }, /* mknod */ { &vop_open_desc, spec_open }, /* open */ @@ -107,18 +107,6 @@ spec_vnoperate(void *v) } /* - * Trivial lookup routine that always fails. - */ -int -spec_lookup(void *v) -{ - struct vop_lookup_args *ap = v; - - *ap->a_vpp = NULL; - return (ENOTDIR); -} - -/* * Open a special file. */ /* ARGSUSED */ diff --git a/sys/miscfs/specfs/specdev.h b/sys/miscfs/specfs/specdev.h index 24db8d31f1a..fc40a7e2805 100644 --- a/sys/miscfs/specfs/specdev.h +++ b/sys/miscfs/specfs/specdev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: specdev.h,v 1.20 2007/06/02 00:45:21 thib Exp $ */ +/* $OpenBSD: specdev.h,v 1.21 2007/12/27 13:59:12 thib Exp $ */ /* $NetBSD: specdev.h,v 1.12 1996/02/13 13:13:01 mycroft Exp $ */ /* @@ -92,7 +92,6 @@ struct uio; int spec_badop(void *); int spec_ebadf(void *); -int spec_lookup(void *); #define spec_create spec_badop #define spec_mknod spec_badop int spec_open(void *); |