Give ext2fs its own static "dirchk" variable instead of using ufs's

variable. Make this accessible as the sysctl vfs.e2fs.dirchk.
This commit is contained in:
Ian Dowse 2002-05-16 20:53:04 +00:00
parent 13a263882f
commit 79af20a81c
2 changed files with 24 additions and 8 deletions

View File

@ -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);

View File

@ -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);