mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
xfs: Add larp debug option
This patch adds a debug option to enable log attribute replay. Eventually this can be removed when delayed attrs becomes permanent. Signed-off-by: Allison Henderson <allison.henderson@oracle.com> Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
parent
abd61ca3c3
commit
535e2f75c4
@ -30,7 +30,11 @@ struct xfs_attr_list_context;
|
|||||||
|
|
||||||
static inline bool xfs_has_larp(struct xfs_mount *mp)
|
static inline bool xfs_has_larp(struct xfs_mount *mp)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG
|
||||||
|
return xfs_globals.larp;
|
||||||
|
#else
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -41,5 +41,6 @@ struct xfs_globals xfs_globals = {
|
|||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
.pwork_threads = -1, /* automatic thread detection */
|
.pwork_threads = -1, /* automatic thread detection */
|
||||||
|
.larp = false, /* log attribute replay */
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -83,6 +83,7 @@ extern xfs_param_t xfs_params;
|
|||||||
struct xfs_globals {
|
struct xfs_globals {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
int pwork_threads; /* parallel workqueue threads */
|
int pwork_threads; /* parallel workqueue threads */
|
||||||
|
bool larp; /* log attribute replay */
|
||||||
#endif
|
#endif
|
||||||
int log_recovery_delay; /* log recovery delay (secs) */
|
int log_recovery_delay; /* log recovery delay (secs) */
|
||||||
int mount_delay; /* mount setup delay (secs) */
|
int mount_delay; /* mount setup delay (secs) */
|
||||||
|
@ -228,6 +228,29 @@ pwork_threads_show(
|
|||||||
return sysfs_emit(buf, "%d\n", xfs_globals.pwork_threads);
|
return sysfs_emit(buf, "%d\n", xfs_globals.pwork_threads);
|
||||||
}
|
}
|
||||||
XFS_SYSFS_ATTR_RW(pwork_threads);
|
XFS_SYSFS_ATTR_RW(pwork_threads);
|
||||||
|
|
||||||
|
static ssize_t
|
||||||
|
larp_store(
|
||||||
|
struct kobject *kobject,
|
||||||
|
const char *buf,
|
||||||
|
size_t count)
|
||||||
|
{
|
||||||
|
ssize_t ret;
|
||||||
|
|
||||||
|
ret = kstrtobool(buf, &xfs_globals.larp);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
STATIC ssize_t
|
||||||
|
larp_show(
|
||||||
|
struct kobject *kobject,
|
||||||
|
char *buf)
|
||||||
|
{
|
||||||
|
return snprintf(buf, PAGE_SIZE, "%d\n", xfs_globals.larp);
|
||||||
|
}
|
||||||
|
XFS_SYSFS_ATTR_RW(larp);
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
static struct attribute *xfs_dbg_attrs[] = {
|
static struct attribute *xfs_dbg_attrs[] = {
|
||||||
@ -237,6 +260,7 @@ static struct attribute *xfs_dbg_attrs[] = {
|
|||||||
ATTR_LIST(always_cow),
|
ATTR_LIST(always_cow),
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
ATTR_LIST(pwork_threads),
|
ATTR_LIST(pwork_threads),
|
||||||
|
ATTR_LIST(larp),
|
||||||
#endif
|
#endif
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user