Remove all traces of undocumented feature ISODEVMAP.
This commit is contained in:
parent
2036033748
commit
3320ec6530
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94
|
||||
* $Id$
|
||||
* $Id: cd9660_node.c,v 1.18 1997/02/22 09:38:48 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -63,11 +63,6 @@ u_long isohash;
|
||||
#define INOHASH(device, inum) (((device) + ((inum)>>12)) & isohash)
|
||||
struct simplelock cd9660_ihash_slock;
|
||||
|
||||
#ifdef ISODEVMAP
|
||||
struct iso_node **idvhashtbl;
|
||||
u_long idvhash;
|
||||
#define DNOHASH(device, inum) (((device) + ((inum)>>12)) & idvhash)
|
||||
#endif
|
||||
|
||||
static unsigned cd9660_chars2ui __P((unsigned char *begin, int len));
|
||||
|
||||
@ -81,67 +76,9 @@ cd9660_init(vfsp)
|
||||
|
||||
isohashtbl = hashinit(desiredvnodes, M_ISOFSMNT, &isohash);
|
||||
simple_lock_init(&cd9660_ihash_slock);
|
||||
#ifdef ISODEVMAP
|
||||
idvhashtbl = hashinit(desiredvnodes / 8, M_ISOFSMNT, &idvhash);
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef ISODEVMAP
|
||||
/*
|
||||
* Enter a new node into the device hash list
|
||||
*/
|
||||
struct iso_dnode *
|
||||
iso_dmap(device, inum, create)
|
||||
dev_t device;
|
||||
ino_t inum;
|
||||
int create;
|
||||
{
|
||||
register struct iso_dnode **dpp, *dp, *dq;
|
||||
|
||||
dpp = &idvhashtbl[DNOHASH(device, inum)];
|
||||
for (dp = *dpp;; dp = dp->d_next) {
|
||||
if (dp == NULL)
|
||||
return (NULL);
|
||||
if (inum == dp->i_number && device == dp->i_dev)
|
||||
return (dp);
|
||||
|
||||
if (!create)
|
||||
return (NULL);
|
||||
|
||||
MALLOC(dp, struct iso_dnode *, sizeof(struct iso_dnode), M_CACHE,
|
||||
M_WAITOK);
|
||||
dp->i_dev = dev;
|
||||
dp->i_number = ino;
|
||||
|
||||
if (dq = *dpp)
|
||||
dq->d_prev = dp->d_next;
|
||||
dp->d_next = dq;
|
||||
dp->d_prev = dpp;
|
||||
*dpp = dp;
|
||||
|
||||
return (dp);
|
||||
}
|
||||
|
||||
void
|
||||
iso_dunmap(device)
|
||||
dev_t device;
|
||||
{
|
||||
struct iso_dnode **dpp, *dp, *dq;
|
||||
|
||||
for (dpp = idvhashtbl; dpp <= idvhashtbl + idvhash; dpp++) {
|
||||
for (dp = *dpp; dp != NULL; dp = dq)
|
||||
dq = dp->d_next;
|
||||
if (device == dp->i_dev) {
|
||||
if (dq)
|
||||
dq->d_prev = dp->d_prev;
|
||||
*dp->d_prev = dq;
|
||||
FREE(dp, M_CACHE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Use the device/inum pair to find the incore inode, and return a pointer
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_node.h 8.6 (Berkeley) 5/14/95
|
||||
* $Id$
|
||||
* $Id: cd9660_node.h,v 1.10 1997/02/22 09:38:49 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -59,17 +59,6 @@ typedef struct {
|
||||
dev_t iso_rdev; /* Major/Minor number for special */
|
||||
} ISO_RRIP_INODE;
|
||||
|
||||
#ifdef ISODEVMAP
|
||||
/*
|
||||
* FOr device# (major,minor) translation table
|
||||
*/
|
||||
struct iso_dnode {
|
||||
struct iso_dnode *d_next, **d_prev; /* hash chain */
|
||||
dev_t i_dev; /* device where dnode resides */
|
||||
ino_t i_number; /* the identity of the inode */
|
||||
dev_t d_dev; /* device # for translation */
|
||||
};
|
||||
#endif
|
||||
|
||||
struct iso_node {
|
||||
struct iso_node *i_next, **i_prev; /* hash chain */
|
||||
@ -123,7 +112,3 @@ void cd9660_ihashins __P((struct iso_node *));
|
||||
void cd9660_ihashrem __P((struct iso_node *));
|
||||
int cd9660_tstamp_conv7 __P((u_char *, struct timespec *, enum ISO_FTYPE));
|
||||
int cd9660_tstamp_conv17 __P((u_char *, struct timespec *));
|
||||
#ifdef ISODEVMAP
|
||||
struct iso_dnode *iso_dmap __P((dev_t, ino_t, int));
|
||||
void iso_dunmap __P((dev_t));
|
||||
#endif
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95
|
||||
* $Id: cd9660_vfsops.c,v 1.20 1997/03/23 03:36:11 bde Exp $
|
||||
* $Id: cd9660_vfsops.c,v 1.21 1997/03/24 11:24:32 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -428,10 +428,6 @@ cd9660_unmount(mp, mntflags, p)
|
||||
|
||||
isomp = VFSTOISOFS(mp);
|
||||
|
||||
#ifdef ISODEVMAP
|
||||
if (isomp->iso_ftype == ISO_FTYPE_RRIP)
|
||||
iso_dunmap(isomp->im_dev);
|
||||
#endif
|
||||
|
||||
isomp->im_devvp->v_specflags &= ~SI_MOUNTEDON;
|
||||
error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p);
|
||||
@ -764,10 +760,6 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
|
||||
/*
|
||||
* if device, look at device number table for translation
|
||||
*/
|
||||
#ifdef ISODEVMAP
|
||||
if (dp = iso_dmap(dev, ino, 0))
|
||||
ip->inode.iso_rdev = dp->d_dev;
|
||||
#endif
|
||||
vp->v_op = cd9660_specop_p;
|
||||
if (nvp = checkalias(vp, ip->inode.iso_rdev, mp)) {
|
||||
/*
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95
|
||||
* $Id: cd9660_vnops.c,v 1.32 1997/02/22 09:38:51 peter Exp $
|
||||
* $Id: cd9660_vnops.c,v 1.33 1997/04/10 15:05:26 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -92,48 +92,10 @@ cd9660_mknod(ndp, vap, cred, p)
|
||||
struct vattr *vap;
|
||||
struct proc *p;
|
||||
{
|
||||
#ifndef ISODEVMAP
|
||||
free(ndp->ni_pnbuf, M_NAMEI);
|
||||
vput(ndp->ni_dvp);
|
||||
vput(ndp->ni_vp);
|
||||
return (EINVAL);
|
||||
#else
|
||||
register struct vnode *vp;
|
||||
struct iso_node *ip;
|
||||
struct iso_dnode *dp;
|
||||
int error;
|
||||
|
||||
vp = ndp->ni_vp;
|
||||
ip = VTOI(vp);
|
||||
|
||||
if (ip->i_mnt->iso_ftype != ISO_FTYPE_RRIP
|
||||
|| vap->va_type != vp->v_type
|
||||
|| (vap->va_type != VCHR && vap->va_type != VBLK)) {
|
||||
free(ndp->ni_pnbuf, M_NAMEI);
|
||||
vput(ndp->ni_dvp);
|
||||
vput(ndp->ni_vp);
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
dp = iso_dmap(ip->i_dev,ip->i_number,1);
|
||||
if (ip->inode.iso_rdev == vap->va_rdev || vap->va_rdev == VNOVAL) {
|
||||
/* same as the unmapped one, delete the mapping */
|
||||
remque(dp);
|
||||
FREE(dp,M_CACHE);
|
||||
} else
|
||||
/* enter new mapping */
|
||||
dp->d_dev = vap->va_rdev;
|
||||
|
||||
/*
|
||||
* Remove inode so that it will be reloaded by iget and
|
||||
* checked to see if it is an alias of an existing entry
|
||||
* in the inode cache.
|
||||
*/
|
||||
vput(vp);
|
||||
vp->v_type = VNON;
|
||||
vgone(vp);
|
||||
return (0);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_node.c 8.2 (Berkeley) 1/23/94
|
||||
* $Id$
|
||||
* $Id: cd9660_node.c,v 1.18 1997/02/22 09:38:48 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -63,11 +63,6 @@ u_long isohash;
|
||||
#define INOHASH(device, inum) (((device) + ((inum)>>12)) & isohash)
|
||||
struct simplelock cd9660_ihash_slock;
|
||||
|
||||
#ifdef ISODEVMAP
|
||||
struct iso_node **idvhashtbl;
|
||||
u_long idvhash;
|
||||
#define DNOHASH(device, inum) (((device) + ((inum)>>12)) & idvhash)
|
||||
#endif
|
||||
|
||||
static unsigned cd9660_chars2ui __P((unsigned char *begin, int len));
|
||||
|
||||
@ -81,67 +76,9 @@ cd9660_init(vfsp)
|
||||
|
||||
isohashtbl = hashinit(desiredvnodes, M_ISOFSMNT, &isohash);
|
||||
simple_lock_init(&cd9660_ihash_slock);
|
||||
#ifdef ISODEVMAP
|
||||
idvhashtbl = hashinit(desiredvnodes / 8, M_ISOFSMNT, &idvhash);
|
||||
#endif
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef ISODEVMAP
|
||||
/*
|
||||
* Enter a new node into the device hash list
|
||||
*/
|
||||
struct iso_dnode *
|
||||
iso_dmap(device, inum, create)
|
||||
dev_t device;
|
||||
ino_t inum;
|
||||
int create;
|
||||
{
|
||||
register struct iso_dnode **dpp, *dp, *dq;
|
||||
|
||||
dpp = &idvhashtbl[DNOHASH(device, inum)];
|
||||
for (dp = *dpp;; dp = dp->d_next) {
|
||||
if (dp == NULL)
|
||||
return (NULL);
|
||||
if (inum == dp->i_number && device == dp->i_dev)
|
||||
return (dp);
|
||||
|
||||
if (!create)
|
||||
return (NULL);
|
||||
|
||||
MALLOC(dp, struct iso_dnode *, sizeof(struct iso_dnode), M_CACHE,
|
||||
M_WAITOK);
|
||||
dp->i_dev = dev;
|
||||
dp->i_number = ino;
|
||||
|
||||
if (dq = *dpp)
|
||||
dq->d_prev = dp->d_next;
|
||||
dp->d_next = dq;
|
||||
dp->d_prev = dpp;
|
||||
*dpp = dp;
|
||||
|
||||
return (dp);
|
||||
}
|
||||
|
||||
void
|
||||
iso_dunmap(device)
|
||||
dev_t device;
|
||||
{
|
||||
struct iso_dnode **dpp, *dp, *dq;
|
||||
|
||||
for (dpp = idvhashtbl; dpp <= idvhashtbl + idvhash; dpp++) {
|
||||
for (dp = *dpp; dp != NULL; dp = dq)
|
||||
dq = dp->d_next;
|
||||
if (device == dp->i_dev) {
|
||||
if (dq)
|
||||
dq->d_prev = dp->d_prev;
|
||||
*dp->d_prev = dq;
|
||||
FREE(dp, M_CACHE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Use the device/inum pair to find the incore inode, and return a pointer
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_node.h 8.6 (Berkeley) 5/14/95
|
||||
* $Id$
|
||||
* $Id: cd9660_node.h,v 1.10 1997/02/22 09:38:49 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -59,17 +59,6 @@ typedef struct {
|
||||
dev_t iso_rdev; /* Major/Minor number for special */
|
||||
} ISO_RRIP_INODE;
|
||||
|
||||
#ifdef ISODEVMAP
|
||||
/*
|
||||
* FOr device# (major,minor) translation table
|
||||
*/
|
||||
struct iso_dnode {
|
||||
struct iso_dnode *d_next, **d_prev; /* hash chain */
|
||||
dev_t i_dev; /* device where dnode resides */
|
||||
ino_t i_number; /* the identity of the inode */
|
||||
dev_t d_dev; /* device # for translation */
|
||||
};
|
||||
#endif
|
||||
|
||||
struct iso_node {
|
||||
struct iso_node *i_next, **i_prev; /* hash chain */
|
||||
@ -123,7 +112,3 @@ void cd9660_ihashins __P((struct iso_node *));
|
||||
void cd9660_ihashrem __P((struct iso_node *));
|
||||
int cd9660_tstamp_conv7 __P((u_char *, struct timespec *, enum ISO_FTYPE));
|
||||
int cd9660_tstamp_conv17 __P((u_char *, struct timespec *));
|
||||
#ifdef ISODEVMAP
|
||||
struct iso_dnode *iso_dmap __P((dev_t, ino_t, int));
|
||||
void iso_dunmap __P((dev_t));
|
||||
#endif
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_vfsops.c 8.18 (Berkeley) 5/22/95
|
||||
* $Id: cd9660_vfsops.c,v 1.20 1997/03/23 03:36:11 bde Exp $
|
||||
* $Id: cd9660_vfsops.c,v 1.21 1997/03/24 11:24:32 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -428,10 +428,6 @@ cd9660_unmount(mp, mntflags, p)
|
||||
|
||||
isomp = VFSTOISOFS(mp);
|
||||
|
||||
#ifdef ISODEVMAP
|
||||
if (isomp->iso_ftype == ISO_FTYPE_RRIP)
|
||||
iso_dunmap(isomp->im_dev);
|
||||
#endif
|
||||
|
||||
isomp->im_devvp->v_specflags &= ~SI_MOUNTEDON;
|
||||
error = VOP_CLOSE(isomp->im_devvp, FREAD, NOCRED, p);
|
||||
@ -764,10 +760,6 @@ cd9660_vget_internal(mp, ino, vpp, relocated, isodir)
|
||||
/*
|
||||
* if device, look at device number table for translation
|
||||
*/
|
||||
#ifdef ISODEVMAP
|
||||
if (dp = iso_dmap(dev, ino, 0))
|
||||
ip->inode.iso_rdev = dp->d_dev;
|
||||
#endif
|
||||
vp->v_op = cd9660_specop_p;
|
||||
if (nvp = checkalias(vp, ip->inode.iso_rdev, mp)) {
|
||||
/*
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95
|
||||
* $Id: cd9660_vnops.c,v 1.32 1997/02/22 09:38:51 peter Exp $
|
||||
* $Id: cd9660_vnops.c,v 1.33 1997/04/10 15:05:26 bde Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -92,48 +92,10 @@ cd9660_mknod(ndp, vap, cred, p)
|
||||
struct vattr *vap;
|
||||
struct proc *p;
|
||||
{
|
||||
#ifndef ISODEVMAP
|
||||
free(ndp->ni_pnbuf, M_NAMEI);
|
||||
vput(ndp->ni_dvp);
|
||||
vput(ndp->ni_vp);
|
||||
return (EINVAL);
|
||||
#else
|
||||
register struct vnode *vp;
|
||||
struct iso_node *ip;
|
||||
struct iso_dnode *dp;
|
||||
int error;
|
||||
|
||||
vp = ndp->ni_vp;
|
||||
ip = VTOI(vp);
|
||||
|
||||
if (ip->i_mnt->iso_ftype != ISO_FTYPE_RRIP
|
||||
|| vap->va_type != vp->v_type
|
||||
|| (vap->va_type != VCHR && vap->va_type != VBLK)) {
|
||||
free(ndp->ni_pnbuf, M_NAMEI);
|
||||
vput(ndp->ni_dvp);
|
||||
vput(ndp->ni_vp);
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
dp = iso_dmap(ip->i_dev,ip->i_number,1);
|
||||
if (ip->inode.iso_rdev == vap->va_rdev || vap->va_rdev == VNOVAL) {
|
||||
/* same as the unmapped one, delete the mapping */
|
||||
remque(dp);
|
||||
FREE(dp,M_CACHE);
|
||||
} else
|
||||
/* enter new mapping */
|
||||
dp->d_dev = vap->va_rdev;
|
||||
|
||||
/*
|
||||
* Remove inode so that it will be reloaded by iget and
|
||||
* checked to see if it is an alias of an existing entry
|
||||
* in the inode cache.
|
||||
*/
|
||||
vput(vp);
|
||||
vp->v_type = VNON;
|
||||
vgone(vp);
|
||||
return (0);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user