diff options
author | kato <kato@FreeBSD.org> | 1997-08-25 10:26:18 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 1997-08-25 10:26:18 +0000 |
commit | 90e0972a81a26e29c994e1115e530dfab8caa4fe (patch) | |
tree | 2ffa311e7da9a6a6d4f84363760b42cfd4392c50 /sys | |
parent | 012df9a25ba8070bb2136ac3016c63f959f76f5f (diff) | |
download | FreeBSD-src-90e0972a81a26e29c994e1115e530dfab8caa4fe.zip FreeBSD-src-90e0972a81a26e29c994e1115e530dfab8caa4fe.tar.gz |
Added a sysctl arg, vfs.cd9660.doclusterread. Deleted debug and
!FreeBSD code arround cluster read stuff.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/fs/cd9660/cd9660_vnops.c | 34 | ||||
-rw-r--r-- | sys/isofs/cd9660/cd9660_vnops.c | 34 |
2 files changed, 36 insertions, 32 deletions
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 7540200..e6f7dee 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95 - * $Id: cd9660_vnops.c,v 1.34 1997/04/14 18:15:47 phk Exp $ + * $Id: cd9660_vnops.c,v 1.35 1997/04/15 08:05:08 bde Exp $ */ #include <sys/param.h> @@ -44,6 +44,7 @@ #include <sys/namei.h> #include <sys/kernel.h> #include <sys/stat.h> +#include <sys/sysctl.h> #include <sys/buf.h> #include <sys/mount.h> #include <sys/vnode.h> @@ -81,6 +82,17 @@ static int cd9660_print __P((struct vop_print_args *)); static int cd9660_islocked __P((struct vop_islocked_args *)); /* + * Sysctl values for the cd9660 filesystem. + */ +#define CD9660_CLUSTERREAD 1 /* cluster reading enabled */ +#define CD9660_MAXID 2 /* number of valid cd9660 ids */ + +#define CD9660_NAMES { \ + {0, 0}, \ + { "doclusterread", CTLTYPE_INT}, \ +} + +/* * Setattr call. Only allowed for block and character special devices. */ int @@ -288,20 +300,10 @@ cd9660_getattr(ap) return (0); } -#if ISO_DEFAULT_BLOCK_SIZE >= PAGE_SIZE -#ifdef DEBUG -extern int doclusterread; -#else -#define doclusterread 1 -#endif -#else -/* XXX until cluster routines can handle block sizes less than one page */ -#if defined(__FreeBSD__) -#define doclusterread 1 -#else -#define doclusterread 0 -#endif -#endif +static int cd9660_doclusterread = 1; +SYSCTL_NODE(_vfs, MOUNT_CD9660, cd9660, CTLFLAG_RW, 0, "CD9660 filesystem"); +SYSCTL_INT(_vfs_cd9660, CD9660_CLUSTERREAD, doclusterread, + CTLFLAG_RW, &cd9660_doclusterread, 0, ""); /* * Vnode op for reading. @@ -343,7 +345,7 @@ cd9660_read(ap) n = diff; size = blksize(imp, ip, lbn); rablock = lbn + 1; - if (doclusterread) { + if (cd9660_doclusterread) { if (lblktosize(imp, rablock) <= ip->i_size) error = cluster_read(vp, (off_t)ip->i_size, lbn, size, NOCRED, uio->uio_resid, diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 7540200..e6f7dee 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.19 (Berkeley) 5/27/95 - * $Id: cd9660_vnops.c,v 1.34 1997/04/14 18:15:47 phk Exp $ + * $Id: cd9660_vnops.c,v 1.35 1997/04/15 08:05:08 bde Exp $ */ #include <sys/param.h> @@ -44,6 +44,7 @@ #include <sys/namei.h> #include <sys/kernel.h> #include <sys/stat.h> +#include <sys/sysctl.h> #include <sys/buf.h> #include <sys/mount.h> #include <sys/vnode.h> @@ -81,6 +82,17 @@ static int cd9660_print __P((struct vop_print_args *)); static int cd9660_islocked __P((struct vop_islocked_args *)); /* + * Sysctl values for the cd9660 filesystem. + */ +#define CD9660_CLUSTERREAD 1 /* cluster reading enabled */ +#define CD9660_MAXID 2 /* number of valid cd9660 ids */ + +#define CD9660_NAMES { \ + {0, 0}, \ + { "doclusterread", CTLTYPE_INT}, \ +} + +/* * Setattr call. Only allowed for block and character special devices. */ int @@ -288,20 +300,10 @@ cd9660_getattr(ap) return (0); } -#if ISO_DEFAULT_BLOCK_SIZE >= PAGE_SIZE -#ifdef DEBUG -extern int doclusterread; -#else -#define doclusterread 1 -#endif -#else -/* XXX until cluster routines can handle block sizes less than one page */ -#if defined(__FreeBSD__) -#define doclusterread 1 -#else -#define doclusterread 0 -#endif -#endif +static int cd9660_doclusterread = 1; +SYSCTL_NODE(_vfs, MOUNT_CD9660, cd9660, CTLFLAG_RW, 0, "CD9660 filesystem"); +SYSCTL_INT(_vfs_cd9660, CD9660_CLUSTERREAD, doclusterread, + CTLFLAG_RW, &cd9660_doclusterread, 0, ""); /* * Vnode op for reading. @@ -343,7 +345,7 @@ cd9660_read(ap) n = diff; size = blksize(imp, ip, lbn); rablock = lbn + 1; - if (doclusterread) { + if (cd9660_doclusterread) { if (lblktosize(imp, rablock) <= ip->i_size) error = cluster_read(vp, (off_t)ip->i_size, lbn, size, NOCRED, uio->uio_resid, |