From f8c47250ba46eb221d1ac537266ac65bcf2866d5 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 20 Jun 2017 17:54:48 -0700 Subject: 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 Reviewed-by: Brian Foster Reviewed-by: Carlos Maiolino --- fs/xfs/xfs_sysfs.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'fs/xfs/xfs_sysfs.c') diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c index ec6e0e2f95d6..56610a973593 100644 --- a/fs/xfs/xfs_sysfs.c +++ b/fs/xfs/xfs_sysfs.c @@ -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, }; -- cgit v1.2.3