xfs: convert drop_writes to use the errortag mechanism

We now have enhanced error injection that can control the frequency
with which errors happen, so convert drop_writes to use this.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
This commit is contained in:
Darrick J. Wong
2017-06-20 17:54:48 -07:00
parent 9e24cfd044
commit f8c47250ba
5 changed files with 15 additions and 68 deletions

View File

@@ -90,49 +90,7 @@ to_mp(struct kobject *kobject)
return container_of(kobj, struct xfs_mount, m_kobj);
}
#ifdef DEBUG
STATIC ssize_t
drop_writes_store(
struct kobject *kobject,
const char *buf,
size_t count)
{
struct xfs_mount *mp = to_mp(kobject);
int ret;
int val;
ret = kstrtoint(buf, 0, &val);
if (ret)
return ret;
if (val == 1)
mp->m_drop_writes = true;
else if (val == 0)
mp->m_drop_writes = false;
else
return -EINVAL;
return count;
}
STATIC ssize_t
drop_writes_show(
struct kobject *kobject,
char *buf)
{
struct xfs_mount *mp = to_mp(kobject);
return snprintf(buf, PAGE_SIZE, "%d\n", mp->m_drop_writes ? 1 : 0);
}
XFS_SYSFS_ATTR_RW(drop_writes);
#endif /* DEBUG */
static struct attribute *xfs_mp_attrs[] = {
#ifdef DEBUG
ATTR_LIST(drop_writes),
#endif
NULL,
};