Skip to content
Permalink
Browse files
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>
  • Loading branch information
allisonhenderson committed Oct 13, 2021
1 parent 5c08985 commit 48776e0f1211f8a28fd4945391c26bd0ada2d101
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
@@ -30,7 +30,7 @@ struct xfs_attr_list_context;

static inline bool xfs_has_larp(struct xfs_mount *mp)
{
return false;
return xfs_globals.larp;
}

/*
@@ -41,5 +41,6 @@ struct xfs_globals xfs_globals = {
#endif
#ifdef DEBUG
.pwork_threads = -1, /* automatic thread detection */
.larp = false, /* log attribute replay */
#endif
};
@@ -83,6 +83,7 @@ extern xfs_param_t xfs_params;
struct xfs_globals {
#ifdef DEBUG
int pwork_threads; /* parallel workqueue threads */
bool larp; /* log attribute replay */
#endif
int log_recovery_delay; /* log recovery delay (secs) */
int mount_delay; /* mount setup delay (secs) */
@@ -227,6 +227,29 @@ pwork_threads_show(
return snprintf(buf, PAGE_SIZE, "%d\n", xfs_globals.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 */

static struct attribute *xfs_dbg_attrs[] = {
@@ -236,6 +259,7 @@ static struct attribute *xfs_dbg_attrs[] = {
ATTR_LIST(always_cow),
#ifdef DEBUG
ATTR_LIST(pwork_threads),
ATTR_LIST(larp),
#endif
NULL,
};

0 comments on commit 48776e0

Please sign in to comment.