mirror of https://github.com/vitalif/e2fsprogs
Fix support for configure --enable-jbd-debug
We haven't used this in a while, so it's bitrotted a bit. Fix it up so that it works correctly. Signed-off-by: Theodore Ts'o <tytso@mit.edu>debian
parent
4ea40c0bc2
commit
1fc23b5e77
|
@ -41,6 +41,10 @@ extern char *optarg;
|
||||||
#define BUFSIZ 8192
|
#define BUFSIZ 8192
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_JBD_DEBUG /* Enabled by configure --enable-jbd-debug */
|
||||||
|
int journal_enable_debug = -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
ss_request_table *extra_cmds;
|
ss_request_table *extra_cmds;
|
||||||
const char *debug_prog_name;
|
const char *debug_prog_name;
|
||||||
int sci_idx;
|
int sci_idx;
|
||||||
|
@ -76,7 +80,7 @@ static int debugfs_setup_tdb(const char *device_name, char *undo_file,
|
||||||
* Configuration via a conf file would be
|
* Configuration via a conf file would be
|
||||||
* nice
|
* nice
|
||||||
*/
|
*/
|
||||||
tdb_dir = getenv("E2FSPROGS_UNDO_DIR");
|
tdb_dir = ss_safe_getenv("E2FSPROGS_UNDO_DIR");
|
||||||
if (!tdb_dir)
|
if (!tdb_dir)
|
||||||
tdb_dir = "/var/lib/e2fsprogs";
|
tdb_dir = "/var/lib/e2fsprogs";
|
||||||
|
|
||||||
|
@ -2395,6 +2399,9 @@ int main(int argc, char **argv)
|
||||||
const char *opt_string = "niwcR:f:b:s:Vd:Dz:";
|
const char *opt_string = "niwcR:f:b:s:Vd:Dz:";
|
||||||
char *undo_file = NULL;
|
char *undo_file = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_JBD_DEBUG
|
||||||
|
char *jbd_debug;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (debug_prog_name == 0)
|
if (debug_prog_name == 0)
|
||||||
#ifdef READ_ONLY
|
#ifdef READ_ONLY
|
||||||
|
@ -2406,6 +2413,19 @@ int main(int argc, char **argv)
|
||||||
fprintf (stderr, "%s %s (%s)\n", debug_prog_name,
|
fprintf (stderr, "%s %s (%s)\n", debug_prog_name,
|
||||||
E2FSPROGS_VERSION, E2FSPROGS_DATE);
|
E2FSPROGS_VERSION, E2FSPROGS_DATE);
|
||||||
|
|
||||||
|
#ifdef CONFIG_JBD_DEBUG
|
||||||
|
jbd_debug = ss_safe_getenv("DEBUGFS_JBD_DEBUG");
|
||||||
|
if (jbd_debug) {
|
||||||
|
int res = sscanf(jbd_debug, "%d", &journal_enable_debug);
|
||||||
|
|
||||||
|
if (res != 1) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"DEBUGFS_JBD_DEBUG \"%s\" not an integer\n\n",
|
||||||
|
jbd_debug);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
while ((c = getopt (argc, argv, opt_string)) != EOF) {
|
while ((c = getopt (argc, argv, opt_string)) != EOF) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'R':
|
case 'R':
|
||||||
|
|
|
@ -66,7 +66,7 @@ static char *bad_blocks_file;
|
||||||
|
|
||||||
e2fsck_t e2fsck_global_ctx; /* Try your very best not to use this! */
|
e2fsck_t e2fsck_global_ctx; /* Try your very best not to use this! */
|
||||||
|
|
||||||
#ifdef CONFIG_JBD_DEBUG /* Enabled by configure --enable-jfs-debug */
|
#ifdef CONFIG_JBD_DEBUG /* Enabled by configure --enable-jbd-debug */
|
||||||
int journal_enable_debug = -1;
|
int journal_enable_debug = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,20 @@ extern int journal_enable_debug;
|
||||||
} while (0)
|
} while (0)
|
||||||
#else
|
#else
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
#ifdef __KERNEL__
|
||||||
#define jbd_debug(f, a...) /**/
|
#define jbd_debug(f, a...) /**/
|
||||||
#else
|
#else
|
||||||
|
extern int journal_enable_debug;
|
||||||
|
#define jbd_debug(n, f, a...) \
|
||||||
|
do { \
|
||||||
|
if ((n) <= journal_enable_debug) { \
|
||||||
|
printf("(%s, %d): %s: ", \
|
||||||
|
__FILE__, __LINE__, __func__); \
|
||||||
|
printf(f, ## a); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
#endif /*__KERNEL__ */
|
||||||
|
#else
|
||||||
#define jbd_debug(f, ...) /**/
|
#define jbd_debug(f, ...) /**/
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -95,6 +95,10 @@ static ext2_filsys global_fs; /* Try not to use this directly */
|
||||||
|
|
||||||
errcode_t ext2fs_run_ext3_journal(ext2_filsys *fs);
|
errcode_t ext2fs_run_ext3_journal(ext2_filsys *fs);
|
||||||
|
|
||||||
|
#ifdef CONFIG_JBD_DEBUG /* Enabled by configure --enable-jbd-debug */
|
||||||
|
int journal_enable_debug = -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ACL translation stuff */
|
/* ACL translation stuff */
|
||||||
#ifdef TRANSLATE_LINUX_ACLS
|
#ifdef TRANSLATE_LINUX_ACLS
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -124,6 +124,10 @@ static const char *please_dir_fsck =
|
||||||
void do_findfs(int argc, char **argv);
|
void do_findfs(int argc, char **argv);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_JBD_DEBUG /* Enabled by configure --enable-jbd-debug */
|
||||||
|
int journal_enable_debug = -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
|
Loading…
Reference in New Issue