From 79af20a81cbf4e919036b59902a6af1a8ef78e2a Mon Sep 17 00:00:00 2001 From: Ian Dowse Date: Thu, 16 May 2002 20:53:04 +0000 Subject: Give ext2fs its own static "dirchk" variable instead of using ufs's variable. Make this accessible as the sysctl vfs.e2fs.dirchk. --- sys/gnu/ext2fs/ext2_lookup.c | 16 ++++++++++++---- sys/gnu/fs/ext2fs/ext2_lookup.c | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) (limited to 'sys/gnu') diff --git a/sys/gnu/ext2fs/ext2_lookup.c b/sys/gnu/ext2fs/ext2_lookup.c index a49e5d6457e5..07e9b2f956f7 100644 --- a/sys/gnu/ext2fs/ext2_lookup.c +++ b/sys/gnu/ext2fs/ext2_lookup.c @@ -54,6 +54,7 @@ #include #include #include +#include #include @@ -63,6 +64,15 @@ #include #include +#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 a49e5d6457e5..07e9b2f956f7 100644 --- a/sys/gnu/fs/ext2fs/ext2_lookup.c +++ b/sys/gnu/fs/ext2fs/ext2_lookup.c @@ -54,6 +54,7 @@ #include #include #include +#include #include @@ -63,6 +64,15 @@ #include #include +#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); -- cgit v1.3