diff options
author | phk <phk@FreeBSD.org> | 2001-04-29 11:48:41 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2001-04-29 11:48:41 +0000 |
commit | 608c1caf3bebcc3d9b0a01af62a7f57d2c6427ea (patch) | |
tree | 6b5998142cb5ea2562e19f6c067038ea2328965d /sys/fs | |
parent | c7663963a91bb0760538088c78d32f2c8585bb43 (diff) | |
download | FreeBSD-src-608c1caf3bebcc3d9b0a01af62a7f57d2c6427ea.zip FreeBSD-src-608c1caf3bebcc3d9b0a01af62a7f57d2c6427ea.tar.gz |
Add a vop_stdbmap(), and make it part of the default vop vector.
Make 7 filesystems which don't really know about VOP_BMAP rely
on the default vector, rather than more or less complete local
vop_nopbmap() implementations.
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 23 | ||||
-rw-r--r-- | sys/fs/fdescfs/fdesc_vnops.c | 1 | ||||
-rw-r--r-- | sys/fs/fifofs/fifo_vnops.c | 28 | ||||
-rw-r--r-- | sys/fs/ntfs/ntfs_vnops.c | 7 | ||||
-rw-r--r-- | sys/fs/nwfs/nwfs_vnops.c | 25 | ||||
-rw-r--r-- | sys/fs/portalfs/portal_vnops.c | 1 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_vnops.c | 31 | ||||
-rw-r--r-- | sys/fs/smbfs/smbfs_vnops.c | 26 | ||||
-rw-r--r-- | sys/fs/specfs/spec_vnops.c | 1 | ||||
-rw-r--r-- | sys/fs/unionfs/union_vnops.c | 28 |
10 files changed, 3 insertions, 168 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index da9ff0f..41cdc18 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -685,7 +685,6 @@ static vop_t **devfs_vnodeop_p; static struct vnodeopv_entry_desc devfs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) devfs_access }, - { &vop_bmap_desc, (vop_t *) devfs_badop }, { &vop_getattr_desc, (vop_t *) devfs_getattr }, { &vop_lookup_desc, (vop_t *) devfs_lookup }, { &vop_pathconf_desc, (vop_t *) vop_stdpathconf }, @@ -705,31 +704,9 @@ static struct vnodeopv_desc devfs_vnodeop_opv_desc = VNODEOP_SET(devfs_vnodeop_opv_desc); -#if 0 -int -foo(ap) - struct vop_generic_args *ap; -{ - int i; - - i = spec_vnoperate(ap); - printf("foo(%s) = %d\n", ap->a_desc->vdesc_name, i); - return (i); -} -#endif - static vop_t **devfs_specop_p; static struct vnodeopv_entry_desc devfs_specop_entries[] = { -#if 1 { &vop_default_desc, (vop_t *) spec_vnoperate }, -#else - { &vop_default_desc, (vop_t *) foo }, - { &vop_lock_desc, (vop_t *) spec_vnoperate }, - { &vop_unlock_desc, (vop_t *) spec_vnoperate }, - { &vop_lease_desc, (vop_t *) spec_vnoperate }, - { &vop_strategy_desc, (vop_t *) spec_vnoperate }, - { &vop_bmap_desc, (vop_t *) spec_vnoperate }, -#endif { &vop_access_desc, (vop_t *) devfs_access }, { &vop_getattr_desc, (vop_t *) devfs_getattr }, { &vop_print_desc, (vop_t *) devfs_print }, diff --git a/sys/fs/fdescfs/fdesc_vnops.c b/sys/fs/fdescfs/fdesc_vnops.c index 2b29f1c..5846ac7 100644 --- a/sys/fs/fdescfs/fdesc_vnops.c +++ b/sys/fs/fdescfs/fdesc_vnops.c @@ -557,7 +557,6 @@ fdesc_badop() static struct vnodeopv_entry_desc fdesc_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) vop_null }, - { &vop_bmap_desc, (vop_t *) fdesc_badop }, { &vop_getattr_desc, (vop_t *) fdesc_getattr }, { &vop_inactive_desc, (vop_t *) fdesc_inactive }, { &vop_lookup_desc, (vop_t *) fdesc_lookup }, diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index 79ee0aa..3cd5425 100644 --- a/sys/fs/fifofs/fifo_vnops.c +++ b/sys/fs/fifofs/fifo_vnops.c @@ -72,7 +72,6 @@ static int fifo_write __P((struct vop_write_args *)); static int fifo_ioctl __P((struct vop_ioctl_args *)); static int fifo_poll __P((struct vop_poll_args *)); static int fifo_kqfilter __P((struct vop_kqfilter_args *)); -static int fifo_bmap __P((struct vop_bmap_args *)); static int fifo_pathconf __P((struct vop_pathconf_args *)); static int fifo_advlock __P((struct vop_advlock_args *)); @@ -91,7 +90,6 @@ static struct vnodeopv_entry_desc fifo_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) vop_ebadf }, { &vop_advlock_desc, (vop_t *) fifo_advlock }, - { &vop_bmap_desc, (vop_t *) fifo_bmap }, { &vop_close_desc, (vop_t *) fifo_close }, { &vop_create_desc, (vop_t *) fifo_badop }, { &vop_getattr_desc, (vop_t *) vop_ebadf }, @@ -463,32 +461,6 @@ fifo_poll(ap) } /* - * This is a noop, simply returning what one has been given. - */ -static int -fifo_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct vnode **a_vpp; - daddr_t *a_bnp; - int *a_runp; - int *a_runb; - } */ *ap; -{ - - if (ap->a_vpp != NULL) - *ap->a_vpp = ap->a_vp; - if (ap->a_bnp != NULL) - *ap->a_bnp = ap->a_bn; - if (ap->a_runp != NULL) - *ap->a_runp = 0; - if (ap->a_runb != NULL) - *ap->a_runb = 0; - return (0); -} - -/* * Device close routine */ /* ARGSUSED */ diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c index 66ac769..26d55bb 100644 --- a/sys/fs/ntfs/ntfs_vnops.c +++ b/sys/fs/ntfs/ntfs_vnops.c @@ -121,6 +121,7 @@ ntfs_putpages(ap) } #endif +#if defined(__NetBSD__) /* * This is a noop, simply returning what one has been given. */ @@ -142,12 +143,9 @@ ntfs_bmap(ap) *ap->a_bnp = ap->a_bn; if (ap->a_runp != NULL) *ap->a_runp = 0; -#if !defined(__NetBSD__) - if (ap->a_runb != NULL) - *ap->a_runb = 0; -#endif return (0); } +#endif static int ntfs_read(ap) @@ -871,7 +869,6 @@ struct vnodeopv_entry_desc ntfs_vnodeop_entries[] = { { &vop_readdir_desc, (vop_t *)ntfs_readdir }, { &vop_fsync_desc, (vop_t *)ntfs_fsync }, - { &vop_bmap_desc, (vop_t *)ntfs_bmap }, { &vop_getpages_desc, (vop_t *) ntfs_getpages }, { &vop_putpages_desc, (vop_t *) ntfs_putpages }, { &vop_strategy_desc, (vop_t *)ntfs_strategy }, diff --git a/sys/fs/nwfs/nwfs_vnops.c b/sys/fs/nwfs/nwfs_vnops.c index e7e6b72..1e5361f 100644 --- a/sys/fs/nwfs/nwfs_vnops.c +++ b/sys/fs/nwfs/nwfs_vnops.c @@ -78,7 +78,6 @@ static int nwfs_mkdir(struct vop_mkdir_args *); static int nwfs_rmdir(struct vop_rmdir_args *); static int nwfs_symlink(struct vop_symlink_args *); static int nwfs_readdir(struct vop_readdir_args *); -static int nwfs_bmap(struct vop_bmap_args *); static int nwfs_strategy(struct vop_strategy_args *); static int nwfs_print(struct vop_print_args *); static int nwfs_pathconf(struct vop_pathconf_args *ap); @@ -88,7 +87,6 @@ vop_t **nwfs_vnodeop_p; static struct vnodeopv_entry_desc nwfs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) nwfs_access }, - { &vop_bmap_desc, (vop_t *) nwfs_bmap }, { &vop_open_desc, (vop_t *) nwfs_open }, { &vop_close_desc, (vop_t *) nwfs_close }, { &vop_create_desc, (vop_t *) nwfs_create }, @@ -826,29 +824,6 @@ static int nwfs_strategy (ap) return (error); } -static int -nwfs_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct vnode **a_vpp; - daddr_t *a_bnp; - int *a_runp; - int *a_runb; - } */ *ap; -{ - struct vnode *vp = ap->a_vp; - - if (ap->a_vpp != NULL) - *ap->a_vpp = vp; - if (ap->a_bnp != NULL) - *ap->a_bnp = ap->a_bn * btodb(vp->v_mount->mnt_stat.f_iosize); - if (ap->a_runp != NULL) - *ap->a_runp = 0; - if (ap->a_runb != NULL) - *ap->a_runb = 0; - return (0); -} /* * How to keep the brain busy ... diff --git a/sys/fs/portalfs/portal_vnops.c b/sys/fs/portalfs/portal_vnops.c index 621059a..b53c4ca 100644 --- a/sys/fs/portalfs/portal_vnops.c +++ b/sys/fs/portalfs/portal_vnops.c @@ -575,7 +575,6 @@ vop_t **portal_vnodeop_p; static struct vnodeopv_entry_desc portal_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) vop_null }, - { &vop_bmap_desc, (vop_t *) portal_badop }, { &vop_getattr_desc, (vop_t *) portal_getattr }, { &vop_lookup_desc, (vop_t *) portal_lookup }, { &vop_open_desc, (vop_t *) portal_open }, diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index dc53c76..f7201fb 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/procfs/procfs_vnops.c @@ -318,36 +318,6 @@ procfs_ioctl(ap) } /* - * do block mapping for pfsnode (vp). - * since we don't use the buffer cache - * for procfs this function should never - * be called. in any case, it's not clear - * what part of the kernel ever makes use - * of this function. for sanity, this is the - * usual no-op bmap, although returning - * (EIO) would be a reasonable alternative. - */ -static int -procfs_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct vnode **a_vpp; - daddr_t *a_bnp; - int *a_runp; - } */ *ap; -{ - - if (ap->a_vpp != NULL) - *ap->a_vpp = ap->a_vp; - if (ap->a_bnp != NULL) - *ap->a_bnp = ap->a_bn; - if (ap->a_runp != NULL) - *ap->a_runp = 0; - return (0); -} - -/* * _reclaim is called when getnewvnode() * wants to make use of an entry on the vnode * free list. at this time the filesystem needs @@ -1019,7 +989,6 @@ static struct vnodeopv_entry_desc procfs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) procfs_access }, { &vop_advlock_desc, (vop_t *) procfs_badop }, - { &vop_bmap_desc, (vop_t *) procfs_bmap }, { &vop_close_desc, (vop_t *) procfs_close }, { &vop_create_desc, (vop_t *) procfs_badop }, { &vop_getattr_desc, (vop_t *) procfs_getattr }, diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index 1d0637e..11bfd50 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -78,7 +78,6 @@ static int smbfs_mkdir(struct vop_mkdir_args *); static int smbfs_rmdir(struct vop_rmdir_args *); static int smbfs_symlink(struct vop_symlink_args *); static int smbfs_readdir(struct vop_readdir_args *); -static int smbfs_bmap(struct vop_bmap_args *); static int smbfs_strategy(struct vop_strategy_args *); static int smbfs_print(struct vop_print_args *); static int smbfs_pathconf(struct vop_pathconf_args *ap); @@ -92,7 +91,6 @@ static struct vnodeopv_entry_desc smbfs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) smbfs_access }, { &vop_advlock_desc, (vop_t *) smbfs_advlock }, - { &vop_bmap_desc, (vop_t *) smbfs_bmap }, { &vop_close_desc, (vop_t *) smbfs_close }, { &vop_create_desc, (vop_t *) smbfs_create }, { &vop_fsync_desc, (vop_t *) smbfs_fsync }, @@ -900,30 +898,6 @@ smbfs_strategy (ap) return error; } -static int -smbfs_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct vnode **a_vpp; - daddr_t *a_bnp; - int *a_runp; - int *a_runb; - } */ *ap; -{ - struct vnode *vp = ap->a_vp; - - if (ap->a_vpp != NULL) - *ap->a_vpp = vp; - if (ap->a_bnp != NULL) - *ap->a_bnp = ap->a_bn * btodb(vp->v_mount->mnt_stat.f_iosize); - if (ap->a_runp != NULL) - *ap->a_runp = 0; - if (ap->a_runb != NULL) - *ap->a_runb = 0; - return (0); -} - int smbfs_ioctl(ap) struct vop_ioctl_args /* { diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index 2940f40..95922c8 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -73,7 +73,6 @@ static struct vnodeopv_entry_desc spec_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) vop_ebadf }, { &vop_advlock_desc, (vop_t *) spec_advlock }, - { &vop_bmap_desc, (vop_t *) spec_bmap }, { &vop_close_desc, (vop_t *) spec_close }, { &vop_create_desc, (vop_t *) vop_panic }, { &vop_freeblks_desc, (vop_t *) spec_freeblks }, diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index 2ca72d7..9529da5 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -69,7 +69,6 @@ SYSCTL_INT(_vfs, OID_AUTO, uniondebug, CTLFLAG_RD, &uniondebug, 0, ""); static int union_access __P((struct vop_access_args *ap)); static int union_advlock __P((struct vop_advlock_args *ap)); -static int union_bmap __P((struct vop_bmap_args *ap)); static int union_close __P((struct vop_close_args *ap)); static int union_create __P((struct vop_create_args *ap)); static int union_fsync __P((struct vop_fsync_args *ap)); @@ -1823,31 +1822,6 @@ union_unlock(ap) return(error); } -/* - * union_bmap: - * - * There isn't much we can do. We cannot push through to the real vnode - * to get to the underlying device because this will bypass data - * cached by the real vnode. - * - * For some reason we cannot return the 'real' vnode either, it seems - * to blow up memory maps. - */ - -static int -union_bmap(ap) - struct vop_bmap_args /* { - struct vnode *a_vp; - daddr_t a_bn; - struct vnode **a_vpp; - daddr_t *a_bnp; - int *a_runp; - int *a_runb; - } */ *ap; -{ - return(EOPNOTSUPP); -} - static int union_print(ap) struct vop_print_args /* { @@ -1941,7 +1915,7 @@ static struct vnodeopv_entry_desc union_vnodeop_entries[] = { { &vop_default_desc, (vop_t *) vop_defaultop }, { &vop_access_desc, (vop_t *) union_access }, { &vop_advlock_desc, (vop_t *) union_advlock }, - { &vop_bmap_desc, (vop_t *) union_bmap }, + { &vop_bmap_desc, (vop_t *) vop_eopnotsupp }, { &vop_close_desc, (vop_t *) union_close }, { &vop_create_desc, (vop_t *) union_create }, { &vop_fsync_desc, (vop_t *) union_fsync }, |