Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1531716
| From | Matias Bjørling <m@bjorling.me> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 08/23] lightnvm: remove sysfs configuration interface |
| Date | 2016-11-28 22:50 +0100 |
| Message-ID | <sIBYf-7z9-73@gated-at.bofh.it> (permalink) |
| References | <sIBOx-7vt-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Javier González <jg@lightnvm.io>
LightNVM used to be managed and configured through sysfs. Since the
introduction of management ioctls this interface is redundant and
outdated. Get rid of it.
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <m@bjorling.me>
---
drivers/lightnvm/core.c | 134 ------------------------------------------------
1 file changed, 134 deletions(-)
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
index 6527cf6..d4433d3 100644
--- a/drivers/lightnvm/core.c
+++ b/drivers/lightnvm/core.c
@@ -780,140 +780,6 @@ static int __nvm_configure_create(struct nvm_ioctl_create *create)
return dev->mt->create_tgt(dev, create);
}
-#ifdef CONFIG_NVM_DEBUG
-static int nvm_configure_show(const char *val)
-{
- struct nvm_dev *dev;
- char opcode, devname[DISK_NAME_LEN];
- int ret;
-
- ret = sscanf(val, "%c %32s", &opcode, devname);
- if (ret != 2) {
- pr_err("nvm: invalid command. Use \"opcode devicename\".\n");
- return -EINVAL;
- }
-
- down_write(&nvm_lock);
- dev = nvm_find_nvm_dev(devname);
- up_write(&nvm_lock);
- if (!dev) {
- pr_err("nvm: device not found\n");
- return -EINVAL;
- }
-
- if (!dev->mt)
- return 0;
-
- dev->mt->lun_info_print(dev);
-
- return 0;
-}
-
-static int nvm_configure_remove(const char *val)
-{
- struct nvm_ioctl_remove remove;
- struct nvm_dev *dev;
- char opcode;
- int ret = 0;
-
- ret = sscanf(val, "%c %256s", &opcode, remove.tgtname);
- if (ret != 2) {
- pr_err("nvm: invalid command. Use \"d targetname\".\n");
- return -EINVAL;
- }
-
- remove.flags = 0;
-
- list_for_each_entry(dev, &nvm_devices, devices) {
- ret = dev->mt->remove_tgt(dev, &remove);
- if (!ret)
- break;
- }
-
- return ret;
-}
-
-static int nvm_configure_create(const char *val)
-{
- struct nvm_ioctl_create create;
- char opcode;
- int lun_begin, lun_end, ret;
-
- ret = sscanf(val, "%c %256s %256s %48s %u:%u", &opcode, create.dev,
- create.tgtname, create.tgttype,
- &lun_begin, &lun_end);
- if (ret != 6) {
- pr_err("nvm: invalid command. Use \"opcode device name tgttype lun_begin:lun_end\".\n");
- return -EINVAL;
- }
-
- create.flags = 0;
- create.conf.type = NVM_CONFIG_TYPE_SIMPLE;
- create.conf.s.lun_begin = lun_begin;
- create.conf.s.lun_end = lun_end;
-
- return __nvm_configure_create(&create);
-}
-
-
-/* Exposes administrative interface through /sys/module/lnvm/configure_by_str */
-static int nvm_configure_by_str_event(const char *val,
- const struct kernel_param *kp)
-{
- char opcode;
- int ret;
-
- ret = sscanf(val, "%c", &opcode);
- if (ret != 1) {
- pr_err("nvm: string must have the format of \"cmd ...\"\n");
- return -EINVAL;
- }
-
- switch (opcode) {
- case 'a':
- return nvm_configure_create(val);
- case 'd':
- return nvm_configure_remove(val);
- case 's':
- return nvm_configure_show(val);
- default:
- pr_err("nvm: invalid command\n");
- return -EINVAL;
- }
-
- return 0;
-}
-
-static int nvm_configure_get(char *buf, const struct kernel_param *kp)
-{
- int sz;
- struct nvm_dev *dev;
-
- sz = sprintf(buf, "available devices:\n");
- down_write(&nvm_lock);
- list_for_each_entry(dev, &nvm_devices, devices) {
- if (sz > 4095 - DISK_NAME_LEN - 2)
- break;
- sz += sprintf(buf + sz, " %32s\n", dev->name);
- }
- up_write(&nvm_lock);
-
- return sz;
-}
-
-static const struct kernel_param_ops nvm_configure_by_str_event_param_ops = {
- .set = nvm_configure_by_str_event,
- .get = nvm_configure_get,
-};
-
-#undef MODULE_PARAM_PREFIX
-#define MODULE_PARAM_PREFIX "lnvm."
-
-module_param_cb(configure_debug, &nvm_configure_by_str_event_param_ops, NULL,
- 0644);
-
-#endif /* CONFIG_NVM_DEBUG */
-
static long nvm_ioctl_info(struct file *file, void __user *arg)
{
struct nvm_ioctl_info *info;
--
2.9.3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/23] LightNVM patches for 4.10 Matias Bjørling <m@bjorling.me> - 2016-11-28 22:40 +0100 [PATCH 16/23] lightnvm: remove get_lun operation on gennvm Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 11/23] lightnvm: remove unnecessary variables in rrpc Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 05/23] lightnvm: export set bad block table Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 01/23] nvme: lightnvm: frees wrong cmd structure Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 13/23] lightnvm: remove gen_lun abstraction Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 21/23] lightnvm: introduce max_phys_sects helper function Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 14/23] lightnvm: manage lun partitions internally in mm Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 04/23] lightnvm: do not protect block 0 Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 20/23] lightnvm: introduce helpers for generic ops in rrpc Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 03/23] lightnvm: enable to send hint to erase command Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 09/23] lightnvm: cleanup unused target operations Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 17/23] lightnvm: remove debug lun statistics from gennvm Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 07/23] lightnvm: rrpc: split bios of size > 256kb Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 12/23] lightnvm: use constant name instead of value Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 02/23] nvme: lightnvm: attach lightnvm sysfs to nvme block device Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 08/23] lightnvm: remove sysfs configuration interface Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 19/23] lightnvm: eliminate nvm_lun abstraction in mm Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 10/23] lightnvm: make address conversion functions global Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 22/23] lightnvm: use target nvm on target-specific ops. Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 23/23] lightnvm: transform target get/set bad block Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 18/23] lightnvm: eliminate nvm_block abstraction on mm Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100 [PATCH 06/23] lightnvm: add ECC error codes Matias Bjørling <m@bjorling.me> - 2016-11-28 22:50 +0100
csiph-web