diff options
author | kato <kato@FreeBSD.org> | 1997-08-24 11:23:17 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 1997-08-24 11:23:17 +0000 |
commit | 7057ee806edf30b9fcf15d2e4f995b7c225c1c13 (patch) | |
tree | 975940345a02124844411aa2c16508defc609020 /sys | |
parent | d8a42482fc35eca9e72da7ff9959771add0ffb95 (diff) | |
download | FreeBSD-src-7057ee806edf30b9fcf15d2e4f995b7c225c1c13.zip FreeBSD-src-7057ee806edf30b9fcf15d2e4f995b7c225c1c13.tar.gz |
Code cleanup. Removed !FreeBSD code arround sysctl stuff. Renamed
doclusterread/doclusterwrite into ext2_doclusterread and
ext2_doclusterwrite, which are unique names. Moved #include of
<sys/sysctl.h> to the top of the file.
Pointed out by: Bruce Evans <bde@zeta.org.au>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/gnu/ext2fs/ext2_readwrite.c | 4 | ||||
-rw-r--r-- | sys/gnu/ext2fs/ext2_vnops.c | 26 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_readwrite.c | 4 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_vnops.c | 26 |
4 files changed, 14 insertions, 46 deletions
diff --git a/sys/gnu/ext2fs/ext2_readwrite.c b/sys/gnu/ext2fs/ext2_readwrite.c index ae87153..e28cd0a 100644 --- a/sys/gnu/ext2fs/ext2_readwrite.c +++ b/sys/gnu/ext2fs/ext2_readwrite.c @@ -112,7 +112,7 @@ READ(ap) if (lblktosize(fs, nextlbn) >= ip->i_size) error = bread(vp, lbn, size, NOCRED, &bp); - else if (doclusterread) + else if (ext2_doclusterread) error = cluster_read(vp, ip->i_size, lbn, size, NOCRED, uio->uio_resid, (ap->a_ioflag >> 16), &bp); @@ -277,7 +277,7 @@ WRITE(ap) if (ioflag & IO_SYNC) { (void)bwrite(bp); } else if (xfersize + blkoffset == fs->s_frag_size) { - if (doclusterwrite) { + if (ext2_doclusterwrite) { #if defined(__FreeBSD__) bp->b_flags |= B_CLUSTEROK; #endif diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c index 4045fb6..1465efd 100644 --- a/sys/gnu/ext2fs/ext2_vnops.c +++ b/sys/gnu/ext2fs/ext2_vnops.c @@ -52,6 +52,7 @@ #include <sys/buf.h> #include <sys/proc.h> #include <sys/mount.h> +#include <sys/sysctl.h> #include <sys/time.h> #include <sys/vnode.h> @@ -236,30 +237,13 @@ static struct vnodeopv_desc ext2fs_fifoop_opv_desc = /* * Enabling cluster read/write operations. */ -#if defined(__FreeBSD__) -static int doclusterread = 1; -static int doclusterwrite = 1; -#include <sys/sysctl.h> +static int ext2_doclusterread = 1; +static int ext2_doclusterwrite = 1; SYSCTL_NODE(_vfs, MOUNT_EXT2FS, ext2fs, CTLFLAG_RW, 0, "EXT2FS filesystem"); SYSCTL_INT(_vfs_ext2fs, EXT2FS_CLUSTERREAD, doclusterread, - CTLFLAG_RW, &doclusterread, 0, ""); + CTLFLAG_RW, &ext2_doclusterread, 0, ""); SYSCTL_INT(_vfs_ext2fs, EXT2FS_CLUSTERWRITE, doclusterwrite, - CTLFLAG_RW, &doclusterwrite, 0, ""); -#else /* !FreeBSD */ -#ifdef DEBUG -static int doclusterread = 0; -static int doclusterwrite = 1; -#include <sys/sysctl.h> -SYSCTL_INT(_debug, 11, doclusterread, CTLFLAG_RW, &doclusterread, 0, ""); -SYSCTL_INT(_debug, 12, doclusterwrite, CTLFLAG_RW, &doclusterwrite, 0, ""); -#else /* !DEBUG */ -/* doclusterwrite is being tested - note that reallocblks is called when it's on, but this is not implemented */ -#define doclusterwrite 0 -/* doclusterread should work with new pagemove */ -#define doclusterread 1 -#endif /* DEBUG */ -#endif /* FreeBSD */ + CTLFLAG_RW, &ext2_doclusterwrite, 0, ""); #include <gnu/ext2fs/ext2_readwrite.c> diff --git a/sys/gnu/fs/ext2fs/ext2_readwrite.c b/sys/gnu/fs/ext2fs/ext2_readwrite.c index ae87153..e28cd0a 100644 --- a/sys/gnu/fs/ext2fs/ext2_readwrite.c +++ b/sys/gnu/fs/ext2fs/ext2_readwrite.c @@ -112,7 +112,7 @@ READ(ap) if (lblktosize(fs, nextlbn) >= ip->i_size) error = bread(vp, lbn, size, NOCRED, &bp); - else if (doclusterread) + else if (ext2_doclusterread) error = cluster_read(vp, ip->i_size, lbn, size, NOCRED, uio->uio_resid, (ap->a_ioflag >> 16), &bp); @@ -277,7 +277,7 @@ WRITE(ap) if (ioflag & IO_SYNC) { (void)bwrite(bp); } else if (xfersize + blkoffset == fs->s_frag_size) { - if (doclusterwrite) { + if (ext2_doclusterwrite) { #if defined(__FreeBSD__) bp->b_flags |= B_CLUSTEROK; #endif diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c index 4045fb6..1465efd 100644 --- a/sys/gnu/fs/ext2fs/ext2_vnops.c +++ b/sys/gnu/fs/ext2fs/ext2_vnops.c @@ -52,6 +52,7 @@ #include <sys/buf.h> #include <sys/proc.h> #include <sys/mount.h> +#include <sys/sysctl.h> #include <sys/time.h> #include <sys/vnode.h> @@ -236,30 +237,13 @@ static struct vnodeopv_desc ext2fs_fifoop_opv_desc = /* * Enabling cluster read/write operations. */ -#if defined(__FreeBSD__) -static int doclusterread = 1; -static int doclusterwrite = 1; -#include <sys/sysctl.h> +static int ext2_doclusterread = 1; +static int ext2_doclusterwrite = 1; SYSCTL_NODE(_vfs, MOUNT_EXT2FS, ext2fs, CTLFLAG_RW, 0, "EXT2FS filesystem"); SYSCTL_INT(_vfs_ext2fs, EXT2FS_CLUSTERREAD, doclusterread, - CTLFLAG_RW, &doclusterread, 0, ""); + CTLFLAG_RW, &ext2_doclusterread, 0, ""); SYSCTL_INT(_vfs_ext2fs, EXT2FS_CLUSTERWRITE, doclusterwrite, - CTLFLAG_RW, &doclusterwrite, 0, ""); -#else /* !FreeBSD */ -#ifdef DEBUG -static int doclusterread = 0; -static int doclusterwrite = 1; -#include <sys/sysctl.h> -SYSCTL_INT(_debug, 11, doclusterread, CTLFLAG_RW, &doclusterread, 0, ""); -SYSCTL_INT(_debug, 12, doclusterwrite, CTLFLAG_RW, &doclusterwrite, 0, ""); -#else /* !DEBUG */ -/* doclusterwrite is being tested - note that reallocblks is called when it's on, but this is not implemented */ -#define doclusterwrite 0 -/* doclusterread should work with new pagemove */ -#define doclusterread 1 -#endif /* DEBUG */ -#endif /* FreeBSD */ + CTLFLAG_RW, &ext2_doclusterwrite, 0, ""); #include <gnu/ext2fs/ext2_readwrite.c> |