diff options
author | iedowse <iedowse@FreeBSD.org> | 2002-05-16 20:53:04 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2002-05-16 20:53:04 +0000 |
commit | a04a4b7576b2a8b870c2cd96a9ffb01f97c99e81 (patch) | |
tree | e4402c9176503645a1fe1838545e8c8507e9f6df /sys | |
parent | 158d29fe97f26f702055f314b6eab3f9333b0ff5 (diff) | |
download | FreeBSD-src-a04a4b7576b2a8b870c2cd96a9ffb01f97c99e81.zip FreeBSD-src-a04a4b7576b2a8b870c2cd96a9ffb01f97c99e81.tar.gz |
Give ext2fs its own static "dirchk" variable instead of using ufs's
variable. Make this accessible as the sysctl vfs.e2fs.dirchk.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/gnu/ext2fs/ext2_lookup.c | 16 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_lookup.c | 16 |
2 files changed, 24 insertions, 8 deletions
diff --git a/sys/gnu/ext2fs/ext2_lookup.c b/sys/gnu/ext2fs/ext2_lookup.c index a49e5d6..07e9b2f 100644 --- a/sys/gnu/ext2fs/ext2_lookup.c +++ b/sys/gnu/ext2fs/ext2_lookup.c @@ -54,6 +54,7 @@ #include <sys/vnode.h> #include <sys/malloc.h> #include <sys/dirent.h> +#include <sys/sysctl.h> #include <ufs/ufs/dir.h> @@ -63,6 +64,15 @@ #include <gnu/ext2fs/ext2_fs.h> #include <gnu/ext2fs/ext2_fs_sb.h> +#ifdef DIAGNOSTIC +static int dirchk = 1; +#else +static int dirchk = 0; +#endif + +SYSCTL_NODE(_vfs, OID_AUTO, e2fs, CTLFLAG_RD, 0, "EXT2FS filesystem"); +SYSCTL_INT(_vfs_e2fs, OID_AUTO, dircheck, CTLFLAG_RW, &dirchk, 0, ""); + /* DIRBLKSIZE in ffs is DEV_BSIZE (in most cases 512) while it is the native blocksize in ext2fs - thus, a #define @@ -70,8 +80,6 @@ */ #undef DIRBLKSIZ -extern int dirchk; - static u_char ext2_ft_to_dt[] = { DT_UNKNOWN, /* EXT2_FT_UNKNOWN */ DT_REG, /* EXT2_FT_REG_FILE */ @@ -407,8 +415,8 @@ searchloop: * Get pointer to next entry. * Full validation checks are slow, so we only check * enough to insure forward progress through the - * directory. Complete checks can be run by patching - * "dirchk" to be true. + * directory. Complete checks can be run by setting + * "vfs.e2fs.dirchk" to be true. */ ep = (struct ext2_dir_entry_2 *) ((char *)bp->b_data + entryoffsetinblock); diff --git a/sys/gnu/fs/ext2fs/ext2_lookup.c b/sys/gnu/fs/ext2fs/ext2_lookup.c index a49e5d6..07e9b2f 100644 --- a/sys/gnu/fs/ext2fs/ext2_lookup.c +++ b/sys/gnu/fs/ext2fs/ext2_lookup.c @@ -54,6 +54,7 @@ #include <sys/vnode.h> #include <sys/malloc.h> #include <sys/dirent.h> +#include <sys/sysctl.h> #include <ufs/ufs/dir.h> @@ -63,6 +64,15 @@ #include <gnu/ext2fs/ext2_fs.h> #include <gnu/ext2fs/ext2_fs_sb.h> +#ifdef DIAGNOSTIC +static int dirchk = 1; +#else +static int dirchk = 0; +#endif + +SYSCTL_NODE(_vfs, OID_AUTO, e2fs, CTLFLAG_RD, 0, "EXT2FS filesystem"); +SYSCTL_INT(_vfs_e2fs, OID_AUTO, dircheck, CTLFLAG_RW, &dirchk, 0, ""); + /* DIRBLKSIZE in ffs is DEV_BSIZE (in most cases 512) while it is the native blocksize in ext2fs - thus, a #define @@ -70,8 +80,6 @@ */ #undef DIRBLKSIZ -extern int dirchk; - static u_char ext2_ft_to_dt[] = { DT_UNKNOWN, /* EXT2_FT_UNKNOWN */ DT_REG, /* EXT2_FT_REG_FILE */ @@ -407,8 +415,8 @@ searchloop: * Get pointer to next entry. * Full validation checks are slow, so we only check * enough to insure forward progress through the - * directory. Complete checks can be run by patching - * "dirchk" to be true. + * directory. Complete checks can be run by setting + * "vfs.e2fs.dirchk" to be true. */ ep = (struct ext2_dir_entry_2 *) ((char *)bp->b_data + entryoffsetinblock); |