target: use \n as a separator for configuration
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 23 Nov 2011 19:53:17 +0000 (20:53 +0100)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 14 Dec 2011 11:27:23 +0000 (11:27 +0000)
The command
| echo rd_pages=32768 > ramdisk/control

Does not work because it writes "rd_pages=32768\n" and the parser which
matches for "rd_pages=%d" does not recognize it due to the \n. One way
of fixing this would be using "echo -n" instead.
This patch adds \n to the list of separators so we don't have to use the
-n argument which I find is more convinient.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_configfs.c
drivers/target/target_core_file.c
drivers/target/target_core_iblock.c
drivers/target/target_core_pscsi.c
drivers/target/target_core_rd.c

index 3c358907a4a63962bf5a0998a61e6ff7505838e5..37b2b3d03c6585eb3d6d8a76dfcc7f31e699ffc1 100644 (file)
@@ -1450,7 +1450,7 @@ static ssize_t target_core_dev_pr_store_attr_res_aptpl_metadata(
                return -ENOMEM;
 
        orig = opts;
-       while ((ptr = strsep(&opts, ",")) != NULL) {
+       while ((ptr = strsep(&opts, ",\n")) != NULL) {
                if (!*ptr)
                        continue;
 
index ed7e05353d6215f8f2939bb02834074b40d15bca..91bf11a0ab167254d73a8a93ac15587f2c52dc67 100644 (file)
@@ -497,7 +497,7 @@ static ssize_t fd_set_configfs_dev_params(
 
        orig = opts;
 
-       while ((ptr = strsep(&opts, ",")) != NULL) {
+       while ((ptr = strsep(&opts, ",\n")) != NULL) {
                if (!*ptr)
                        continue;
 
index feebbfe6cbd0936defeaeb927d2aca36c095b2ba..3c1a7aa658a279a9ba8c08b9eb1d375b6bb4e55a 100644 (file)
@@ -390,7 +390,7 @@ static ssize_t iblock_set_configfs_dev_params(struct se_hba *hba,
 
        orig = opts;
 
-       while ((ptr = strsep(&opts, ",")) != NULL) {
+       while ((ptr = strsep(&opts, ",\n")) != NULL) {
                if (!*ptr)
                        continue;
 
index 5d8851de3aee73f2b45f5da6965917276b03d475..bb44ed4d02721f4d582c0f3a70253b8e37a15e05 100644 (file)
@@ -817,7 +817,7 @@ static ssize_t pscsi_set_configfs_dev_params(struct se_hba *hba,
 
        orig = opts;
 
-       while ((ptr = strsep(&opts, ",")) != NULL) {
+       while ((ptr = strsep(&opts, ",\n")) != NULL) {
                if (!*ptr)
                        continue;
 
index 94b4087dadd539a07b06a9a9fbf721c213fbea35..8b68f7b82631ea8e0993da09228882820366067b 100644 (file)
@@ -472,7 +472,7 @@ static ssize_t rd_set_configfs_dev_params(
 
        orig = opts;
 
-       while ((ptr = strsep(&opts, ",")) != NULL) {
+       while ((ptr = strsep(&opts, ",\n")) != NULL) {
                if (!*ptr)
                        continue;